:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --text-primary: #343541;
  --text-secondary: #6e6e80;
  --border-color: #e5e5e5;
  --accent-color: #7c5cff;
  --accent-hover: #6a48f0;
  --user-msg-bg: #f7f7f8;
  --ai-msg-bg: #ffffff;
  --error-color: #ff4757;
  --info-color: #3498db;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --scrollbar-thumb: #c1c1c1;
  --scrollbar-track: #f1f1f1;
  --header-bg: rgba(255, 255, 255, 0.95);
  --input-bg: #ffffff;
  --primary-color: #7c5cff;
  --primary-light: #9c84ff;
  --primary-dark: #5a3bff;
  --secondary-color: #ff5cad;
  --background-primary: #f9f9f9;
  --background-secondary: #ffffff;
  --background-tertiary: #f0f0f0;
  --container-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --main-padding: 20px;
  --sidebar-width: 300px;
  --chat-container-max-width: 1200px;
}

[data-theme="dark"] {
  --bg-primary: #202123;
  --bg-secondary: #343541;
  --text-primary: #ececf1;
  --text-secondary: #9ca3af;
  --border-color: #4d4d4f;
  --accent-color: #7c5cff;
  --accent-hover: #9c84ff;
  --user-msg-bg: #343541;
  --ai-msg-bg: #444654;
  --error-color: #ff6b6b;
  --info-color: #60a5fa;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --scrollbar-thumb: #565869;
  --scrollbar-track: #40414f;
  --header-bg: rgba(32, 33, 35, 0.95);
  --input-bg: #40414f;
  --primary-color: #7c5cff;
  --primary-light: #9c84ff;
  --primary-dark: #5a3bff;
  --secondary-color: #ff5cad;
  --background-primary: #1a1a1a;
  --background-secondary: #222;
  --background-tertiary: #333;
  --container-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --success-color: #2ecc71;
  --warning-color: #f39c12;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-primary);
  max-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Header styles */
.app-header {
  display: flex;
  align-items: center;
  padding: 0.7rem max(1rem, calc((100% - 800px) / 2));
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--accent-color);
  font-size: 1.5rem;
}

.logo h1 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}

.theme-toggle:hover {
  background-color: var(--border-color);
}

.theme-toggle i {
  font-size: 1rem;
}

/* Model selector */
.model-selection {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

#model-selector {
  appearance: none;
  padding: 0.4rem 2rem 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 100%;
}

.model-selection::after {
  content: "▼";
  font-size: 0.6rem;
  position: absolute;
  right: 0.6rem;
  top: 0.7rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.status-indicator {
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  background-color: #ccc;
}

.status-dot.online {
  background-color: #28a745;
}

.status-dot.connecting {
  background-color: #ff9800;
}

.status-dot.error {
  background-color: #ff4757;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}

.user-button:hover {
  background-color: var(--border-color);
}

.user-button i {
  font-size: 1rem;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  width: 220px;
  z-index: 100;
  display: none;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.user-dropdown.active {
  display: block;
}

.user-info {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.user-actions {
  list-style: none;
  padding: 10px 0;
}

.user-actions li a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.user-actions li a:hover {
  background-color: var(--bg-secondary);
}

.user-actions li a i {
  margin-right: 10px;
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
}

/* Chat container styles */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-secondary);
  height: calc(100vh - 60px); /* Account for header */
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-top: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  overscroll-behavior: contain; /* Prevent scroll chaining */
  padding-bottom: 20px; /* Add space at bottom of chat */
}

.message-container {
  display: flex;
  padding: 1.2rem max(1.5rem, calc((100% - 800px) / 2));
  transition: background-color 0.2s ease;
  margin-bottom: 16px;
  transition: opacity 0.3s ease;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 8px;
  max-width: 100%;
  word-wrap: break-word;
  width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.message-container.user {
  background-color: var(--user-msg-bg);
}

.message-container.assistant {
  background-color: var(--ai-msg-bg);
}

.message-container.system {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(52, 152, 219, 0.1);
}

.message-container.error {
  background-color: rgba(231, 76, 60, 0.1);
}

.message-container.loading {
  opacity: 0.7;
}

.message {
  display: flex;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.user .message-avatar {
  background-color: #4361ee;
  color: white;
}

.assistant .message-avatar {
  background-color: var(--accent-color);
  color: white;
}

.system .message-avatar {
  background-color: var(--info-color);
  color: white;
}

.error .message-avatar {
  background-color: var(--error-color);
  color: white;
}

/* Model-specific message styling */
.model-deepseek .message-avatar {
  background-color: #4a56e2; /* Special color for DeepSeek */
}

.model-o1-mini .message-avatar {
  background-color: #e24a77; /* Special color for O1 Mini */
}

.message-content {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  white-space: pre-wrap; /* Preserve whitespace but wrap text */
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.message-content p {
  margin-bottom: 0.8rem;
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Improved code block styling */
.message-content pre {
  background-color: rgba(0, 0, 0, 0.06);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.8rem 0;
  max-width: 100%;
  white-space: pre-wrap; /* Allow code to wrap */
  border-left: 3px solid var(--accent-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .message-content pre {
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.message-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  word-break: break-word; /* Prevent code from overflowing */
}

[data-theme="dark"] .message-content code {
  background-color: rgba(255, 255, 255, 0.1);
}

.message-content pre code {
  background-color: transparent;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-all;
  display: block;
  tab-size: 2;
  color: inherit;
}

/* Model-specific message styling */
.model-deepseek .message-content {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  white-space: pre-wrap;
}

.model-o1-mini .message-content {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

.model-o1-mini .message-content pre {
  border-left-color: #e24a77; /* Special color for O1 Mini code blocks */
}

.model-deepseek .message-content pre {
  border-left-color: #4a56e2; /* Special color for DeepSeek code blocks */
}

/* Language-specific syntax highlighting */
.message-content pre code.language-python,
.message-content pre code.language-javascript,
.message-content pre code.language-js,
.message-content pre code.language-html,
.message-content pre code.language-css,
.message-content pre code.language-c {
  color: inherit;
}

/* Loading animation */
.loading-indicator {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.5rem;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
}

/* Chat input form */
.chat-input-container {
  border-top: 1px solid var(--border-color);
  padding: 1rem max(1.5rem, calc((100% - 800px) / 2)) 1.5rem;
  background-color: var(--bg-primary);
  position: relative;
  z-index: 10;
}

.chat-input-form {
  display: flex;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

#user-input {
  flex: 1;
  padding: 1rem 3rem 1rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  background-color: var(--input-bg);
  color: var(--text-primary);
  resize: none;
  min-height: 56px;
  max-height: 200px;
  box-shadow: 0 2px 6px var(--shadow-color);
  line-height: 1.5;
}

#user-input::placeholder {
  color: var(--text-secondary);
}

#user-input:focus {
  border-color: var(--accent-color);
}

.chat-input-form button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-features {
  display: flex;
  max-width: 800px;
  margin: 0.5rem auto 0;
  justify-content: space-between;
  align-items: center;
}

.shortcut-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

kbd {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  margin: 0 0.2rem;
}

.feature-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
}

.feature-button:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Footer styles */
.app-footer {
  padding: 0.8rem max(1.5rem, calc((100% - 800px) / 2));
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Model status banner */
.model-status-banner {
  background-color: #f0e6ff;
  color: #6a48f0;
  padding: 0.5rem max(1rem, calc((100% - 800px) / 2));
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  line-height: 1.4;
  border-bottom: 1px solid #dcd2f9;
}

[data-theme="dark"] .model-status-banner {
  background-color: #312657;
  color: #c4adff;
  border-bottom-color: #41347a;
}

.model-status-banner i {
  margin-right: 0.5rem;
}

.banner-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.banner-close:hover {
  opacity: 0.7;
}

/* Authentication Styles */
.auth-container {
  background-color: var(--bg-primary);
  min-height: 100vh;
}

.auth-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.auth-card {
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 8px 30px var(--shadow-color);
  padding: 30px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-header h2 i {
  margin-right: 10px;
}

.auth-header p {
  color: var(--text-secondary);
}

.auth-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.input-with-icon input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.remember-me {
  display: flex;
  align-items: center;
}

.remember-me input {
  margin-right: 8px;
}

.forgot-password {
  color: var(--accent-color);
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

.auth-button {
  width: 100%;
  padding: 12px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-button i {
  margin-right: 8px;
}

.auth-button:hover {
  background-color: var(--accent-hover);
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 25px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
}

.auth-divider span {
  position: relative;
  background-color: var(--bg-primary);
  padding: 0 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.social-auth {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.social-auth-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.social-auth-btn i {
  margin-right: 8px;
}

.social-auth-btn:hover {
  opacity: 0.9;
}

.google {
  background-color: #DB4437;
  color: white;
}

.github {
  background-color: #333;
  color: white;
}

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-error {
  color: var(--error-color);
  font-size: 0.9rem;
  margin-bottom: 15px;
  min-height: 20px;
}

.auth-success {
  color: #28a745;
  font-size: 0.9rem;
  margin-bottom: 15px;
  min-height: 20px;
}

.terms {
  display: flex;
  align-items: flex-start;
}

.terms input {
  margin-right: 10px;
  margin-top: 5px;
}

.terms label {
  font-size: 0.9rem;
}

.terms a {
  color: var(--accent-color);
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-header {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .logo h1 {
    font-size: 1.1rem;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    order: 3;
    margin-top: 0.5rem;
  }
  
  .model-selection {
    flex: 1;
    max-width: 60%;
    margin-right: 5%;
  }
  
  .status-indicator {
    position: absolute;
    right: 0;
    font-size: 0.65rem;
    white-space: nowrap;
    bottom: -1.2rem;
  }
  
  .user-controls {
    justify-content: flex-end;
  }
  
  .auth-card {
    padding: 20px;
  }
  
  .auth-header h2 {
    font-size: 1.5rem;
  }
  
  .social-auth {
    flex-direction: column;
  }

  .home-link {
    width: 32px;
    height: 32px;
    margin-left: 12px;
  }

  .chat-container {
    height: calc(100vh - 100px); /* More space for mobile header */
  }
  
  .chat-messages {
    padding: 10px 5px; /* Reduce side padding on mobile */
  }
  
  .message-container {
    padding: 8px 10px;
    margin-bottom: 8px;
    max-width: 100%;
  }
  
  .assistant .message-content,
  .user .message-content {
    font-size: 0.95rem; /* Slightly smaller text on mobile */
    padding: 0;
  }
  
  /* Fix avatar size on mobile */
  .message-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px; /* Prevent shrinking */
    margin-right: 8px;
  }
  
  /* Mobile-optimized input area */
  .chat-input-container {
    padding: 8px;
    position: sticky;
    bottom: 0;
  }
  
  .chat-input-form {
    position: relative;
  }
  
  #user-input {
    padding: 10px 40px 10px 12px; /* More space for the send button */
    min-height: 44px; /* Taller hit area for mobile */
    font-size: 16px; /* Prevent zoom on iOS */
    border-radius: 22px;
    margin: 0;
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
  }
  
  .chat-input-form button {
    position: absolute;
    right: 5px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
}

@media (max-width: 576px) {
  .app-header {
    padding: 0.5rem 0.8rem;
  }
  
  .logo h1 {
    font-size: 1rem;
  }
  
  .logo i {
    font-size: 1.2rem;
  }
  
  .model-status-banner p {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  .message-container {
    padding: 1rem 0.8rem;
  }
  
  .message-avatar {
    width: 28px;
    height: 28px;
    margin-right: 0.8rem;
  }
  
  .chat-input-container {
    padding: 0.8rem;
  }
  
  #user-input {
    padding: 0.8rem 2.8rem 0.8rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
  }
  
  .remember-forgot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .auth-header h2 {
    font-size: 1.3rem;
  }
  
  .shortcut-hint {
    display: none;
  }
}

@media (max-width: 400px) {
  .model-selection {
    max-width: 100%;
    margin-right: 0;
  }
  
  .user-controls {
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .header-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .message-content {
    font-size: 0.9rem;
  }
  
  .message-content pre {
    padding: 0.8rem;
  }
  
  .auth-card {
    padding: 15px;
  }
  
  .input-with-icon input {
    padding: 10px 15px 10px 40px;
  }
}

/* Authentication Modals */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  width: 90%;
  max-width: 400px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.auth-modal-header h3 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--accent-color);
  display: flex;
  align-items: center;
}

.auth-modal-header h3 i {
  margin-right: 10px;
}

.auth-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.auth-modal-body {
  padding: 20px;
}

.auth-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
}

/* Fix for Safari and iOS specific issues */
@supports (-webkit-touch-callout: none) {
  body, html {
    height: 100%;
  }
  
  .app-container {
    min-height: 100%;
  }
  
  #user-input {
    font-size: 16px; /* Prevents zooming on focus in iOS */
  }
  
  .message-content pre {
    white-space: pre-wrap;
    word-break: break-word;
  }
  
  .message-content code {
    word-break: break-word;
  }
  
  .model-o1-mini .message-content,
  .model-deepseek .message-content {
    white-space: pre-wrap;
    word-break: break-word;
  }
}

/* File Attachment Styles */
.file-attachment {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 100%;
}

.attachment-icon {
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.attachment-info {
  flex: 1;
  overflow: hidden;
}

.attachment-name {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.attachment-size {
  display: block;
  font-size: 0.8em;
  color: var(--text-secondary);
}

.attachment-download {
  margin-left: 10px;
  color: var(--primary-color);
  transition: color 0.2s;
}

.attachment-download:hover {
  color: var(--accent-color);
}

.image-attachment {
  flex-direction: column;
  align-items: flex-start;
}

.attachment-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* File Upload Modal Styles */
.file-input-container {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

.file-input-container:hover {
  border-color: var(--primary-color);
}

.file-input-container input[type="file"] {
  width: 100%;
  margin-bottom: 10px;
}

.file-input-info {
  font-size: 0.85em;
  color: var(--text-secondary);
}

.file-input-info p {
  margin: 5px 0;
}

.upload-preview {
  display: none;
  margin: 15px 0;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--bg-secondary);
}

.file-info {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.file-icon {
  margin-right: 15px;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 500;
  margin-bottom: 4px;
  word-break: break-all;
}

.file-meta {
  font-size: 0.8em;
  color: var(--text-secondary);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    padding: 10px;
  }
  
  .logo {
    margin-bottom: 10px;
  }
  
  .header-controls {
    width: 100%;
    flex-direction: column;
  }
  
  .model-selection {
    width: 100%;
    margin-bottom: 10px;
  }
  
  #model-selector {
    width: 100%;
  }
  
  .user-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .chat-input-container {
    padding: 10px;
  }
  
  .chat-input-form {
    flex-direction: column;
  }
  
  .chat-input-form textarea {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .chat-input-form button {
    align-self: flex-end;
  }
  
  .input-features {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .shortcut-hint {
    margin-bottom: 10px;
  }
  
  .feature-buttons {
    width: 100%;
    justify-content: space-between;
  }
  
  .auth-card {
    width: 90%;
    max-width: 400px;
  }
  
  .social-auth {
    flex-direction: column;
  }
  
  .social-auth-btn {
    width: 100%;
    margin: 5px 0;
  }
  
  .auth-modal-content {
    width: 90%;
    max-width: 400px;
  }
  
  .user-dropdown {
    right: 0;
    width: 250px;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.5rem;
  }
  
  .message {
    padding: 10px;
  }
  
  .message-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .message-avatar {
    margin-bottom: 5px;
  }
  
  .message-info {
    margin-left: 0;
  }
  
  .attachment-name {
    max-width: 150px;
  }
  
  .auth-form .input-with-icon {
    flex-direction: column;
  }
  
  .auth-form .input-with-icon i {
    margin-bottom: 5px;
  }
  
  .remember-forgot {
    flex-direction: column;
  }
  
  .forgot-password {
    margin-top: 10px;
  }
}

/* Fix for iOS Safari issues */
@supports (-webkit-touch-callout: none) {
  .chat-input-form textarea {
    font-size: 16px; /* Prevents zoom on focus in iOS */
  }
  
  .auth-form input {
    font-size: 16px; /* Prevents zoom on focus in iOS */
  }
  
  /* Fix for iOS Safari viewport height issues */
  .app-container {
    height: -webkit-fill-available;
  }
  
  .chat-container {
    height: calc(100vh - 120px);
    height: calc(-webkit-fill-available - 120px);
  }
}

/* File Generation Button Styles */
.generate-file-btn {
  display: inline-flex;
  align-items: center;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  margin: 5px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.2s;
}

.generate-file-btn:hover {
  background-color: var(--accent-color);
}

.generate-file-btn i {
  margin-right: 5px;
}

.file-generation-options {
  display: flex;
  flex-wrap: wrap;
  margin: 10px 0;
}

/* Responsive adjustments for file generation options */
@media (max-width: 480px) {
  .file-generation-options {
    justify-content: center;
  }
  
  .generate-file-btn {
    width: calc(50% - 10px);
    justify-content: center;
    margin: 5px;
  }
}

/* File Upload and Generation Enhancements */
.upload-info {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
}

.upload-info p {
  margin: 5px 0;
  font-size: 0.9em;
}

.upload-info i {
  color: var(--primary-color);
  margin-right: 5px;
}

.drag-drop-info {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 15px;
  text-align: center;
  font-style: italic;
}

.highlight-drop {
  border: 2px dashed var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

.file-input-container {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 15px;
  transition: border-color 0.3s, background-color 0.3s;
}

.file-input-container:hover {
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* Shortcut hint box */
.shortcut-hint-box {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 15px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.shortcut-hint-box p {
  margin: 5px 0;
  font-size: 0.9em;
}

.shortcut-hint-box i {
  color: var(--primary-color);
}

/* Command styles */
.command-prefix {
  color: var(--accent-color);
  font-weight: bold;
}

/* File generation buttons and options */
.file-generation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  justify-content: center;
}

.generate-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.generate-file-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.generate-file-btn:active {
  transform: translateY(0);
}

.generate-file-btn i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* File preview enhancements */
.upload-preview {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.upload-preview iframe {
  border: none;
  border-radius: 4px;
  width: 100%;
  height: 200px;
  background-color: white;
  margin-bottom: 10px;
}

/* Responsive file handling */
@media (max-width: 768px) {
  .file-generation-options {
    flex-direction: column;
    width: 100%;
  }
  
  .generate-file-btn {
    width: 100%;
  }
  
  .upload-preview iframe {
    height: 150px;
  }
}

/* Mobile/Desktop specific elements */
.mobile-device .desktop-only {
  display: none;
}

.desktop-device .mobile-only {
  display: none;
}

/* Enhanced shortcuts and hints */
.shortcut-hint {
  display: flex;
  flex-direction: column;
  font-size: 0.8em;
}

.shortcut-hint span {
  margin-bottom: 4px;
}

kbd {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  display: inline-block;
  font-size: 0.9em;
  font-family: monospace;
  line-height: 1;
  padding: 2px 4px;
  margin: 0 2px;
  vertical-align: middle;
}

/* File attachment styles with improvements */
.file-attachment {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease;
}

.file-attachment:hover {
  background-color: rgba(var(--accent-color-rgb), 0.05);
}

.attachment-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--accent-color-rgb), 0.1);
  border-radius: 6px;
  margin-right: 12px;
  color: var(--accent-color);
}

.attachment-info {
  flex: 1;
}

.attachment-name {
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
  word-break: break-all;
}

.attachment-size {
  font-size: 0.8rem;
  color: var (--text-secondary);
}

.file-preview {
  margin-top: 12px;
  max-height: 280px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.file-preview img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.attachment-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
}

/* Password strength indicator */
.password-strength {
  margin-top: 5px;
  font-size: 0.8em;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.password-strength.weak {
  background-color: #f8d7da;
  color: #721c24;
}

.password-strength.medium {
  background-color: #fff3cd;
  color: #856404;
}

.password-strength.strong {
  background-color: #d4edda;
  color: #155724;
}

/* Mobile Responsiveness Improvements */

/* Fix for mobile authentication forms */
@media (max-width: 768px) {
  .auth-card {
    width: 95%;
    max-width: 420px;
    margin: 20px auto;
    padding: 20px;
  }
  
  .auth-header h2 {
    font-size: 1.5rem;
  }
  
  .auth-form .form-group {
    margin-bottom: 15px;
  }
  
  .auth-form input {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
  
  .auth-button {
    padding: 10px 15px;
    font-size: 0.95rem;
  }
  
  .social-auth {
    flex-direction: column;
    gap: 10px;
  }
  
  .social-auth-btn {
    width: 100%;
  }
  
  .auth-modal-content {
    width: 90%;
    max-width: 360px;
    padding: 15px;
  }
  
  .auth-modal-header h3 {
    font-size: 1.2rem;
  }
  
  .remember-forgot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .forgot-password {
    align-self: flex-end;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .auth-card {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 20px 15px;
    min-height: calc(100vh - 40px);
  }
  
  .app-header {
    padding: 10px;
  }
  
  .logo h1 {
    font-size: 1.2rem;
  }
  
  .header-controls {
    gap: 5px;
  }
  
  .model-selection {
    max-width: 120px;
  }
  
  #model-selector {
    font-size: 0.8rem;
    padding: 6px 8px;
  }
  
  .status-indicator {
    font-size: 0.7rem;
  }
  
  .user-button, .theme-toggle {
    padding: 6px;
  }
  
  .chat-input-container {
    padding: 10px;
  }
  
  .chat-input-form {
    padding: 10px;
  }
  
  #user-input {
    padding: 8px;
    font-size: 0.95rem;
    min-height: 38px;
  }
  
  .chat-input-form button {
    width: 34px;
    height: 34px;
  }
  
  .message {
    padding: 10px;
  }
  
  .message-avatar {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
  
  .message-content {
    font-size: 0.95rem;
    padding-left: 5px;
  }
  
  .message-content pre {
    padding: 8px;
    margin: 10px 0;
    font-size: 0.8rem;
  }
  
  .shortcut-hint {
    display: none;
  }
  
  .input-features {
    justify-content: flex-end;
    padding: 5px 10px;
  }
  
  .feature-buttons {
    gap: 10px;
  }
  
  .feature-button {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  /* Hide desktop-only elements on mobile */
  .desktop-only {
    display: none !important;
  }
  
  /* Show mobile-only elements */
  .mobile-only {
    display: block !important;
  }
  
  /* File attachment adjustments */
  .file-attachment {
    flex-direction: column;
    padding: 10px;
  }
  
  .attachment-info {
    width: 100%;
    margin-top: 10px;
  }
  
  .attachment-name {
    max-width: 100%;
    font-size: 0.9rem;
  }
  
  .attachment-download {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  
  .file-generation-options {
    flex-direction: column;
    width: 100%;
  }
  
  .generate-file-btn {
    width: 100%;
    margin-bottom: 5px;
  }
  
  /* Improved file upload modal on mobile */
  .file-input-container {
    padding: 15px 10px;
  }
  
  .upload-preview {
    padding: 10px;
  }
  
  /* Fix auth modals on mobile */
  .auth-modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Improved navigation for notch devices */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-container {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  .app-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  
  .app-footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* Fix for keyboard opening on mobile causing layout issues */
@media (max-width: 768px) {
  body.keyboard-open .chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-primary);
  }
  
  body.keyboard-open .chat-messages {
    margin-bottom: 150px;
  }
}

/* Fix input zoom on mobile */
@media (max-width: 768px) {
  input[type="email"],
  input[type="password"],
  input[type="text"],
  textarea {
    font-size: 16px !important; /* Prevents zoom on focus in iOS */
  }
  
  .auth-form input {
    font-size: 16px !important;
  }
}

/* Improve hover states for touch devices */
@media (hover: none) {
  .auth-button:hover,
  .feature-button:hover,
  .social-auth-btn:hover,
  .generate-file-btn:hover {
    transform: none;
  }
  
  .auth-button:active,
  .feature-button:active,
  .social-auth-btn:active,
  .generate-file-btn:active {
    transform: scale(0.98);
  }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
  .auth-container {
    min-height: -webkit-fill-available;
  }
  
  .auth-card {
    max-height: -webkit-fill-available;
  }
  
  .app-container {
    min-height: -webkit-fill-available;
  }
}

/* Just add this - no need to modify existing styles */

/* Add elegant typing indicator for loading animation */
.typing-indicator {
  display: inline-flex;
  align-items: center;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 1px;
  background-color: #3b82f6;
  border-radius: 50%;
  display: block;
  opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
  animation: pulse 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation: pulse 1s infinite ease-in-out 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation: pulse 1s infinite ease-in-out 0.4s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* More elegant code blocks */
pre {
  background-color: #f8f9fa; 
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

/* Improve message spacing */
.message-container {
  margin-bottom: 16px;
}

.message-content {
  line-height: 1.6;
}

/* Fluid transitions */
.message-container {
  transition: opacity 0.3s ease;
}

.message-container.loading {
  opacity: 0.7;
}

/* Add loading animation styles */

/* Add these styles at the end of your CSS file */
.loading-dots {
  display: inline-flex;
  margin-left: 5px;
}

.loading-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  margin: 0 2px;
  display: inline-block;
  animation: dot-pulse 1.5s infinite ease-in-out;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.message-container.loading .message-content {
  opacity: 0.7;
}

/* Add a home link style */
.home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-color);
  transition: all 0.3s;
  text-decoration: none;
  margin-left: 20px;
}

.home-link:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Enhanced mobile optimization */
@media (max-width: 576px) {
  /* Fix header layout on small screens */
  .app-header {
    padding: 8px 10px;
  }
  
  .logo {
    margin-right: auto;
  }
  
  .home-link {
    width: 28px;
    height: 28px;
    margin-left: 8px;
    font-size: 0.8rem;
  }
  
  .header-controls {
    align-items: flex-start;
  }
  
  /* Improve chat container spacing */
  .chat-messages {
    max-height: calc(100vh - 130px);
    padding-bottom: 20px;
  }
  
  .message-container {
    padding: 10px;
    margin-bottom: 8px;
  }
  
  /* Make input more usable on mobile */
  .chat-input-container {
    padding: 10px;
  }
  
  #user-input {
    padding: 10px 36px 10px 10px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .chat-input-form button {
    right: 5px;
    bottom: 8px;
    width: 28px;
    height: 28px;
  }
  
  /* Better feature buttons layout */
  .feature-buttons {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 5px 0;
  }
  
  /* Fix file upload modal on small screens */
  .auth-modal-content {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Fix input zoom on mobile */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  font-size: 16px !important;
}

/* Fix Safari/iOS issues */
@supports (-webkit-touch-callout: none) {
  body, html {
    height: -webkit-fill-available;
  }
  
  .app-container {
    min-height: -webkit-fill-available;
  }
  
  /* Fix iPhone keyboard issues */
  .chat-input-container.keyboard-open {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    z-index: 1000;
  }
}

/* Add styles for the clickable logo */
.logo-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.logo-link:hover {
  transform: translateY(-2px);
}

/* Remove the now unused home-link styles or keep them for reference */
/* 
.home-link {
  display: none;
}
*/

/* Main container responsive adjustments */
.container {
  max-width: var(--chat-container-max-width);
  margin: 0 auto;
  padding: 0 var(--main-padding);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Chat area responsive layout */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px;
}

/* Input area responsive design */
.input-area {
  display: flex;
  flex-direction: column;
  padding: 10px;
  margin-top: 10px;
  position: relative;
}

.input-container {
  display: flex;
  width: 100%;
}

textarea {
  flex: 1;
  min-height: 40px;
  max-height: 200px;
  padding: 10px;
  border-radius: 8px 0 0 8px;
  resize: none;
  overflow-y: auto;
}

button {
  padding: 10px 15px;
}

/* Model selection responsive design */
.model-selector {
  margin-bottom: 15px;
  width: 100%;
}

select {
  width: 100%;
  padding: 8px;
}

/* File upload responsive design */
.file-upload {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.file-preview {
  max-width: 100%;
  overflow: hidden;
}

.file-preview img {
  max-width: 100%;
  max-height: 300px;
}

/* Code block responsive design */
pre code {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-width: 100%;
}

/* Media Queries for Responsive Design */
/* Mobile devices */
@media screen and (max-width: 480px) {
  :root {
    --main-padding: 10px;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .input-area {
    padding: 8px;
  }
  
  .message-container {
    padding: 8px;
    margin-bottom: 10px;
  }
  
  button {
    padding: 8px 12px;
  }
  
  .model-selector {
    margin-bottom: 10px;
  }
  
  textarea {
    min-height: 36px;
    padding: 8px;
  }
  
  /* Adjust message font size */
  .message p {
    font-size: 14px;
  }
  
  /* Adjust code blocks */
  pre code {
    padding: 8px;
    font-size: 12px;
  }
  
  /* Ensure images don't overflow */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Tablet devices */
@media screen and (min-width: 481px) and (max-width: 768px) {
  :root {
    --main-padding: 15px;
  }
  
  .container {
    padding: 0 15px;
  }
  
  /* Adjust message font size */
  .message p {
    font-size: 15px;
  }
  
  pre code {
    font-size: 13px;
  }
}

/* Larger screens */
@media screen and (min-width: 769px) {
  /* Desktop optimizations */
  .input-container {
    max-width: 900px;
    margin: 0 auto;
  }
  
  .model-selector {
    max-width: 300px;
  }
}

/* Dark mode adjustments for all screen sizes */
@media (prefers-color-scheme: dark) {
  /* Improve contrast in dark mode */
  .message-container {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
  }
  
  textarea {
    background-color: #333;
    color: #eee;
    border: 1px solid #444;
  }
  
  button {
    background-color: #444;
    color: #fff;
  }
  
  button:hover {
    background-color: #555;
  }
}

/* Accessibility improvements */
button, textarea, select {
  font-size: 16px; /* Prevent iOS zoom on focus */
}

/* Make active elements more visible on touch devices */
@media (hover: none) {
  button:active {
    transform: scale(0.98);
  }
}
