:root {
  --background: #ffffff;
  --foreground: #111111;
  --muted-foreground: #666666;
  --border: #eaeaea;
  --input-bg: #ffffff;
  --user-message-bg: #000000;
  --user-message-text: #ffffff;
  --model-message-bg: #f9f9f9;
  --model-message-border: #efefef;
  --button-bg: #4a4a4a;
  --button-text: #ffffff;
  --header-height: 56px;
  --footer-height: 120px;
  --sidebar-width: 220px;
  --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --error-color: #ff4d4d;
}

.dark {
  --background: #000000;
  --foreground: #ffffff;
  --muted-foreground: #999999;
  --border: #3a3a3a;
  --input-bg: #1a1a1a;
  --user-message-bg: #ffffff;
  --user-message-text: #000000;
  --model-message-bg: #1a1a1a;
  --model-message-border: #3a3a3a;
  --button-bg: #f0f0f0;
  --button-text: #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.view {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  transition: background-color 0.3s ease;
  background-color: var(--background);
}

/* Light mode view background */
.view:not(.dark) {
  background-color: #ffffff;
}

/* Dark mode view background */
.view.dark {
  background-color: #000000;
}

.hidden {
  display: none !important;
}

/* ========================================
   SIDEBAR STYLES (for logged-in views)
   ======================================== */

.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: #171717;
  border-right: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.view.dark .app-sidebar {
  background: #0a0a0a;
  border-right: 1px solid #2a2a2a;
}

.view:not(.dark) .app-sidebar {
  background: #fafafa;
  border-right: 1px solid #e5e5e5;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.view.dark .sidebar-header {
  border-bottom: 1px solid #2a2a2a;
}

.view:not(.dark) .sidebar-header {
  border-bottom: 1px solid #e5e5e5;
}

.sidebar-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.05em;
  flex: 1;
}

.view:not(.dark) .sidebar-logo {
  color: #000000;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: #999999;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.view:not(.dark) .sidebar-collapse-btn {
  color: #666666;
}

.view:not(.dark) .sidebar-collapse-btn:hover {
  background: #e5e5e5;
  color: #000000;
}

/* Collapsed sidebar state */
.app-sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.app-sidebar.collapsed .sidebar-logo,
.app-sidebar.collapsed .new-thread-btn span,
.app-sidebar.collapsed .sidebar-link,
.app-sidebar.collapsed .sidebar-section-header,
.app-sidebar.collapsed .sidebar-auth-btn {
  display: none;
}

.app-sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .new-thread-btn {
  width: 40px;
  padding: 0.75rem;
  justify-content: center;
}

.sidebar-toggle-mobile {
  display: none;
  background: none;
  border: none;
  color: #999999;
  cursor: pointer;
  padding: 0.25rem;
}

.view:not(.dark) .sidebar-toggle-mobile {
  color: #666666;
}

.new-thread-btn {
  margin: 1rem;
  padding: 0.75rem 1rem;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.view:not(.dark) .new-thread-btn {
  background: #e5e5e5;
  border: 1px solid #d0d0d0;
  color: #000000;
}

.view.dark .new-thread-btn:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

.view:not(.dark) .new-thread-btn:hover {
  background: #d0d0d0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.sidebar-section-header {
  padding: 1rem 1rem 0.5rem 1rem;
  color: #666666;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
}

.view:not(.dark) .sidebar-section-header {
  color: #999999;
}

.sidebar-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #999999;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.view:not(.dark) .sidebar-link {
  color: #666666;
}

.view.dark .sidebar-link:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.view:not(.dark) .sidebar-link:hover {
  background: #e5e5e5;
  color: #000000;
}

/* Disabled links */
.sidebar-link.disabled {
  color: #555555;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.view:not(.dark) .sidebar-link.disabled {
  color: #cccccc;
  opacity: 0.6;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #2a2a2a;
}

.view.dark .sidebar-footer {
  border-top: 1px solid #2a2a2a;
}

.view:not(.dark) .sidebar-footer {
  border-top: 1px solid #e5e5e5;
}

.sidebar-auth-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #999999;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view:not(.dark) .sidebar-auth-btn {
  border: 1px solid #d0d0d0;
  color: #666666;
}

.view.dark .sidebar-auth-btn:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.view:not(.dark) .sidebar-auth-btn:hover {
  background: #e5e5e5;
  color: #000000;
}

/* ========================================
   MAIN CONTENT AREA (for logged-in views)
   ======================================== */

.app-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  background-color: var(--background);
}

/* Light mode main content background */
.view:not(.dark) .app-main-content {
  background-color: #ffffff;
}

/* Dark mode main content background */
.view.dark .app-main-content {
  background-color: #000000;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
  background-color: var(--background);
}

/* Light mode header */
.view:not(.dark) .app-header {
  background-color: #ffffff;
  border-bottom-color: #eaeaea;
}

/* Dark mode header */
.view.dark .app-header {
  background-color: #000000;
  border-bottom-color: #3a3a3a;
}

.sidebar-toggle-header {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.5rem;
  display: none;
}

.header-spacer {
  flex: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-info,
#user-info-chat {
  color: #60A5FA;
  font-weight: 500;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--input-bg);
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
.view.dark .theme-toggle .sun-icon { display: block; }
.view.dark .theme-toggle .moon-icon { display: none; }

/* ========================================
   AUTH CONTAINER (login/signup) - shadcn style
   ======================================== */

#auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

#auth-container:not(.dark) {
  background: #ffffff;
}

/* Auth Header */
.auth-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.auth-branding {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  font-family: 'Montserrat', sans-serif;
}

#auth-container:not(.dark) .auth-branding {
  color: #000000;
}

/* Auth Content */
.auth-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
}

.auth-card {
  position: relative;
  background: #0a0a0a;
  border: 1px solid #262626;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
}

#auth-container:not(.dark) .auth-card {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Auth Logo */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-logo img {
  width: 60px;
  height: auto;
}

.auth-card h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

#auth-container:not(.dark) .auth-card h2 {
  color: #000000;
}

.auth-card p {
  color: #999999;
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 2rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
}

#auth-container:not(.dark) .auth-card p {
  color: #666666;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#auth-form > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

#auth-form label {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
}

#auth-container:not(.dark) #auth-form label {
  color: #000000;
}

#auth-form input {
  padding: 0.75rem 1rem;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  font-family: 'Montserrat', sans-serif;
}

#auth-container:not(.dark) #auth-form input {
  background: #ffffff;
  color: #000000;
  border: 2px solid #e5e5e5;
}

#auth-form input:focus {
  outline: none;
  border-color: #ffffff;
}

#auth-container:not(.dark) #auth-form input:focus {
  border-color: #000000;
}

#auth-form input::placeholder {
  color: #666666;
}

#auth-container:not(.dark) #auth-form input::placeholder {
  color: #999999;
}

#auth-submit {
  padding: 0.75rem 1rem;
  border: none;
  background: #ffffff;
  color: #000000;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  font-family: 'Montserrat', sans-serif;
  margin-top: 0.5rem;
  width: 100%;
}

#auth-container:not(.dark) #auth-submit {
  background: #000000;
  color: #ffffff;
}

#auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#auth-submit:active {
  transform: translateY(0);
}

/* Auth Links */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #262626;
}

#auth-container:not(.dark) .auth-links {
  border-top: 1px solid #e5e5e5;
}

.auth-link {
  background: none;
  border: none;
  color: #999999;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: 'Montserrat', sans-serif;
  padding: 0;
}

#auth-container:not(.dark) .auth-link {
  color: #666666;
}

.auth-link:hover {
  color: #ffffff;
}

#auth-container:not(.dark) .auth-link:hover {
  color: #000000;
}

.auth-divider {
  color: #666666;
  font-size: 0.875rem;
}

#auth-container:not(.dark) .auth-divider {
  color: #999999;
}

.auth-theme-toggle {
  background: #1a1a1a;
  border: 1px solid #262626;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.15s ease;
}

#auth-container:not(.dark) .auth-theme-toggle {
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  color: #000000;
}

.auth-theme-toggle:hover {
  background: #262626;
}

#auth-container:not(.dark) .auth-theme-toggle:hover {
  background: #e5e5e5;
}

#auth-container.dark .auth-theme-toggle .sun-icon {
  display: none;
}

#auth-container.dark .auth-theme-toggle .moon-icon {
  display: block;
}

#auth-container:not(.dark) .auth-theme-toggle .sun-icon {
  display: block;
}

#auth-container:not(.dark) .auth-theme-toggle .moon-icon {
  display: none;
}

#auth-error {
  padding: 0;
  color: #ff6b6b;
  font-size: 0.875rem;
  display: none;
  margin-bottom: 1rem;
}

#auth-error:not(:empty) {
  display: block;
  padding: 0.75rem;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
}

/* ========================================
   INITIAL VIEW (landing page)
   ======================================== */

.initial-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  background-color: var(--background);
}

/* Light mode initial content */
.view:not(.dark) .initial-content {
  background-color: #ffffff;
}

/* Dark mode initial content */
.view.dark .initial-content {
  background-color: #000000;
}

.initial-content-wrapper {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.brand-container {
  text-align: center;
  margin-bottom: 1rem;
}

.brand-name {
  font-size: 3.5rem;
  font-weight: 200;
  margin-bottom: 0.5rem;
  color: var(--foreground);
  font-family: 'Montserrat', sans-serif;
}

/* Light mode brand name */
.view:not(.dark) .brand-name {
  color: #111111;
}

/* Dark mode brand name */
.view.dark .brand-name {
  color: #ffffff;
}

.brand-tagline {
  font-size: 1rem;
  color: var(--muted-foreground);
  font-weight: 400;
  font-family: 'Montserrat', sans-serif;
}

/* Light mode brand tagline */
.view:not(.dark) .brand-tagline {
  color: #666666;
}

/* Dark mode brand tagline */
.view.dark .brand-tagline {
  color: #999999;
}

.initial-chat-form {
  width: 100%;
}

.textarea-wrapper {
  position: relative;
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease;
}

/* Light mode input styling */
.view:not(.dark) .textarea-wrapper {
  background: #ffffff;
  border-color: #e5e5e5;
}

/* Dark mode input styling */
.view.dark .textarea-wrapper {
  background: #1a1a1a;
  border-color: #3a3a3a;
}

.textarea-wrapper:focus-within {
  border-color: var(--foreground);
}

.textarea-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-family: var(--font-family);
  font-size: 1rem;
  resize: none;
  min-height: 48px;
  max-height: 200px;
  padding: 0.5rem 0;
}

/* Ensure textarea text is visible in both themes */
.view:not(.dark) .textarea-wrapper textarea {
  color: #111111;
}

.view.dark .textarea-wrapper textarea {
  color: #ffffff;
}

.textarea-wrapper textarea::placeholder {
  color: var(--muted-foreground);
}

.view:not(.dark) .textarea-wrapper textarea::placeholder {
  color: #999999;
}

.view.dark .textarea-wrapper textarea::placeholder {
  color: #666666;
}

.textarea-wrapper button {
  background: var(--foreground);
  color: var(--background);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

/* Light mode send button */
.view:not(.dark) .textarea-wrapper button {
  background: #000000;
  color: #ffffff;
}

/* Dark mode send button */
.view.dark .textarea-wrapper button {
  background: #ffffff;
  color: #000000;
}

.textarea-wrapper button:hover {
  transform: scale(1.05);
}

.textarea-wrapper button:active {
  transform: scale(0.95);
}

/* Document upload button */
.upload-btn {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.view:not(.dark) .upload-btn {
  color: #666666;
}

.view.dark .upload-btn {
  color: #999999;
}

.upload-btn:hover {
  background: var(--input-bg);
}

.view:not(.dark) .upload-btn:hover {
  background: #f5f5f5;
  color: #000000;
}

.view.dark .upload-btn:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.upload-btn svg {
  width: 20px;
  height: 20px;
}

input[type="file"] {
  display: none;
}

.launch-pricepilot-btn {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.launch-pricepilot-btn:hover {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.app-footer-text {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* ========================================
   CHAT VIEW
   ======================================== */

#chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: var(--background);
}

/* Light mode chat container */
.view:not(.dark) #chat-container {
  background-color: #ffffff;
}

/* Dark mode chat container */
.view.dark #chat-container {
  background-color: #000000;
}

.message {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  animation: slideIn 0.3s ease;
  align-items: flex-start;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar Styles */
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

/* User avatar - smaller light blue circle */
.user-message .message-avatar {
  width: 18px;
  height: 18px;
  background: #60A5FA;
  border: 2px solid #60A5FA;
}

.view.dark .user-message .message-avatar {
  background: #60A5FA;
  border: 2px solid #60A5FA;
}

/* Qualr avatar - "Q" with proper contrast */
.view:not(.dark) .model-message .message-avatar {
  background: #000000;
  color: #ffffff;
  border: 2px solid #000000;
}

.view.dark .model-message .message-avatar {
  background: #ffffff;
  color: #000000;
  border: 2px solid #ffffff;
}

.message-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  font-family: 'Montserrat', sans-serif;
}

/* Ensure message headers are always visible */
.view.dark .message-header {
  color: #ffffff;
}

.view:not(.dark) .message-header {
  color: #111111;
}

.message-content {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.user-message .message-content {
  background: var(--user-message-bg);
  color: var(--user-message-text);
  border: 2px solid var(--user-message-bg);
}

.model-message .message-content {
  background: var(--model-message-bg);
  color: var(--foreground);
  border: 2px solid var(--model-message-border);
}

/* Ensure proper text color in model messages for both themes */
.view.dark .model-message .message-content {
  color: #ffffff;
  background: #1a1a1a;
  border-color: #3a3a3a;
}

.view:not(.dark) .model-message .message-content {
  color: #111111;
  background: #f9f9f9;
  border-color: #efefef;
}

/* Ensure proper text color in user messages for both themes */
.view.dark .user-message .message-content {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

.view:not(.dark) .user-message .message-content {
  color: #ffffff;
  background: #000000;
  border-color: #000000;
}

.message-content pre {
  background: rgba(0, 0, 0, 0.1);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.view.dark .message-content pre {
  background: rgba(0, 0, 0, 0.4);
}

.message-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.message-content p {
  margin-bottom: 0.75rem;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Ensure links are visible in both themes */
.view:not(.dark) .message-content a {
  color: #3B82F6;
  text-decoration: underline;
}

.view.dark .message-content a {
  color: #60A5FA;
  text-decoration: underline;
}

/* Loading Indicator */
.loading .message-content {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
}

.loading .dot {
  width: 8px;
  height: 8px;
  background: var(--muted-foreground);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.loading .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--background);
  flex-shrink: 0;
}

/* Light mode chat footer */
.view:not(.dark) .chat-footer {
  background-color: #ffffff;
  border-top-color: #eaeaea;
}

/* Dark mode chat footer */
.view.dark .chat-footer {
  background-color: #000000;
  border-top-color: #3a3a3a;
}

.chat-footer form {
  margin-bottom: 1rem;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-action-btn:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

.footer-action-link {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-action-link:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  .app-sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle-mobile {
    display: flex;
  }

  .sidebar-toggle-header {
    display: flex;
  }

  .app-main-content {
    max-width: 100%;
  }

  .brand-name {
    font-size: 2.5rem;
  }

  .brand-tagline {
    font-size: 0.9rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-card h2 {
    font-size: 1.6rem;
  }

  #chat-container {
    padding: 1rem;
  }

  .footer-actions {
    justify-content: center;
  }
}

@media (min-width: 769px) {
  .sidebar-toggle-mobile {
    display: none;
  }

  .sidebar-toggle-header {
    display: none;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}
