@media screen and (max-width: 926px) and (max-height: 428px) and (orientation: landscape) {
    body {
      height: 100vh;
      padding: 5px;
      margin: 0;
      box-sizing: border-box;
    }
  
    .chat-container {
        width: 98vw;
        height: 80vh;
        display: flex;
        flex-direction: column;
        padding: 15px;
    }
  
    .auth-buttons {
      position: absolute;
      top: 5px;
      left: 5px;
      z-index: 1000;
    }
  
    .auth-buttons button {
      font-size: 0.7rem;
      padding: 3px 6px;
    }
  
    .session-buttons {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 0;
    }
  
    #newSessionButton,
    .session-dropdown {
      font-size: 0.7rem;
      padding: 3px 6px;
    }
  
    .session-dropdown {
      width: 60%;
    }
  
    .chat-messages {
      flex-grow: 1;
      height: calc(100% - 100px);
      overflow-y: auto;
    }
  
    .chat-input-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 0;
    }
  
    #messageInput {
      flex-grow: 1;
      height: 40px;
      font-size: 0.8rem;
    }
  
    .button-container {
      display: flex;
      gap: 5px;
    }
  
    #sendButton,
    #clearButton {
      font-size: 0.7rem;
      padding: 5px 10px;
    }
  
    .file-upload {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 0;
    }
  
    #uploadDirectorySelect,
    #addCustomDirectoryBtn,
    #fileInput,
    #uploadForm button {
      font-size: 0.7rem;
      padding: 3px 6px;
    }
  
    #uploadDirectorySelect {
      width: 25%;
    }
  
    #fileInput {
      width: 40%;
    }
  
    .message {
      font-size: 0.8rem;
      max-width: 90%;
    }
  
    .auth-modal__content,
    .custom-directory-modal__content {
      width: 50%;
      max-width: 300px;
      margin: 10px auto;
    }
  }
  
  @media screen and (max-width: 768px) and (orientation: portrait) {
    /* Existing portrait mode styles */
    body {
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0;
      margin: 0;
      box-sizing: border-box;
    }
  
    .chat-container {
      width: calc(100% - 20px);
      height: calc(90vh - 25px);
      max-width: none;
      max-height: none;
      margin: 10px;
      transform: none;
      display: flex;
      flex-direction: column;
    }
  
    .chat-messages {
      flex-grow: 1;
      height: auto;
    }
  
    .chat-input-container {
      flex-shrink: 0;
    }
  
    .file-upload {
      flex-shrink: 0;
    }
  
    .message {
      font-size: 0.9em;
      max-width: 85%;
    }
  
    #messageInput,
    #sendButton,
    #clearButton,
    #uploadDirectorySelect,
    #addCustomDirectoryBtn,
    #fileInput,
    #uploadForm button,
    #newSessionButton,
    .session-dropdown,
    .auth-buttons button {
      font-size: 1em;
    }
  
    .auth-buttons {
      position: absolute;
      top: 10px;
      right: 10px;
    }
  
    .auth-modal__content,
    .custom-directory-modal__content {
      width: calc(100% - 40px);
      max-width: 400px;
      margin: 20px;
    }
  }
  
  @media screen and (max-width: 480px) and (orientation: portrait) {
    /* Existing smaller portrait mode styles */
    .chat-container {
      width: calc(100% - 10px);
      height: calc(90vh - 10px);
      margin: 5px;
    }
  
    .message {
      font-size: 0.8em;
    }
  
    #messageInput,
    #sendButton,
    #clearButton,
    #uploadDirectorySelect,
    #addCustomDirectoryBtn,
    #fileInput,
    #uploadForm button,
    #newSessionButton,
    .session-dropdown,
    .auth-buttons button {
      font-size: 0.9em;
    }
  
    .auth-buttons {
      top: 5px;
      right: 5px;
    }
  
    .auth-modal__content,
    .custom-directory-modal__content {
      width: calc(100% - 20px);
      margin: 10px;
    }
  }