/* 
  Mevzuat AI | ChatGPT Clone Theme
  Premium Vanilla CSS - Highly Aesthetic Dark Mode Design
*/

/* 1. Global Variables & Base Resets */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  /* Auth Background Radiants */
  --bg-radial-start: #1f1f1f;
  --bg-radial-end: #0d0d0d;
  
  /* ChatGPT Premium Dark Palette */
  --bg-primary: #212121;      /* Main chat background */
  --bg-secondary: #171717;    /* Textarea & alternate panels */
  --bg-sidebar: #0d0d0d;      /* Deep dark sidebar */
  --bg-header: #212121;
  --bg-card: #2f2f2f;         /* Cards and input active */
  --bg-hover: #212121;        /* Sidebar hover items */
  --border-color: rgba(255, 255, 255, 0.08);
  
  /* Vibrant Accents */
  --accent-green: #10a37f;    /* ChatGPT signature green */
  --accent-green-hover: #1a7f64;
  --accent-purple: #ab68ff;   /* Multi-model premium accent */
  --accent-glow: rgba(16, 163, 127, 0.15);
  
  /* Text Colors */
  --text-primary: #ececec;
  --text-secondary: #b4b4b4;
  --text-muted: #666666;
  --text-link: #54b2ff;
  
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --header-height: 60px;
  
  /* Animations & Speed */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 8px 30px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 2. Main Layout Framework */
.app-container {
  display: flex;
  height: calc(100vh - 60px);
  width: 100vw;
  position: relative;
}

/* 3. Sidebar (Left Panel) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  transform: translateX(-100%);
  border-right: none;
  opacity: 0;
  visibility: hidden;
}

.sidebar-header {
  padding: 16px 12px 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.new-chat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  text-align: left;
}

.new-chat-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.new-chat-btn i {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
}

.toggle-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.toggle-sidebar-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.toggle-sidebar-btn i {
  width: 18px;
  height: 18px;
}

/* Chat History List & Skeleton Loader */
.chat-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 8px 4px 8px;
  letter-spacing: 0.5px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast);
  text-decoration: none;
  color: var(--text-primary);
}

.chat-item:hover {
  background-color: var(--bg-hover);
}

.chat-item.active {
  background-color: var(--bg-hover);
}

.chat-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chat-item i.chat-icon {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chat-item-title {
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  color: var(--text-primary);
}

.chat-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  opacity: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.chat-item:hover .chat-delete-btn {
  opacity: 1;
}

.chat-delete-btn:hover {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

.chat-delete-btn i {
  width: 14px;
  height: 14px;
}

/* Skeleton Loading Sidebar */
.chat-list-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px;
}

.skeleton-item {
  height: 36px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-green));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tier {
  font-size: 11px;
  color: var(--text-secondary);
}

.user-credits {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.settings-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-btn i {
  width: 18px;
  height: 18px;
}

/* 4. Main Panel Framework */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background-color: var(--bg-primary);
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-header);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Show sidebar button (only displays when sidebar is hidden) */
.show-sidebar-btn {
  display: none;
}

.sidebar.collapsed ~ .main-content .show-sidebar-btn {
  display: flex;
}

/* Model Selector Dropdown & Button */
.model-selector-wrapper {
  position: relative;
  z-index: 50;
}

.model-selector-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.model-selector-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.model-icon {
  display: flex;
  align-items: center;
  color: var(--accent-green);
}

.model-icon i {
  width: 16px;
  height: 16px;
}

.chevron {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background-color: rgba(23, 23, 23, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  gap: 4px;
}

.model-dropdown.show {
  display: flex;
  animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-item.active {
  background-color: rgba(255, 255, 255, 0.03);
}

.dropdown-item .item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.dropdown-item .item-title i {
  width: 14px;
  height: 14px;
  color: var(--accent-green);
}

.dropdown-item[data-model="mevzuat-flash"] .item-title i {
  color: var(--accent-purple);
}

.dropdown-item .item-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.header-right .icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.header-right .icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.header-right .icon-btn i {
  width: 18px;
  height: 18px;
}

/* 5. Chat Window / Container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Welcome Screen (Empty Chat Dashboard) */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 24px;
  gap: 40px;
  animation: welcome-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes welcome-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-premium);
  transition: transform var(--transition-normal);
}

.welcome-logo:hover {
  transform: scale(1.05);
}

.welcome-logo i {
  width: 28px;
  height: 28px;
}

.welcome-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #b4b4b4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Prompts Suggestion Grid */
.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.suggestion-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.suggestion-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.suggestion-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.suggestion-icon i {
  width: 16px;
  height: 16px;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-content h3 {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.suggestion-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-arrow {
  align-self: center;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.suggestion-card:hover .suggestion-arrow {
  opacity: 1;
  color: var(--text-primary);
}

.suggestion-arrow i {
  width: 16px;
  height: 16px;
}

/* 6. Active Chat Message Stream List */
.message-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.message-item-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

/* User Message styling (No alternate bg, just padding and alignment) */
.message-item-wrapper.user {
  background-color: var(--bg-primary);
}

/* AI Message styling (Subtle dark alternate background) */
.message-item-wrapper.assistant {
  background-color: rgba(255, 255, 255, 0.015);
}

.message-item {
  max-width: 780px;
  width: 100%;
  padding: 24px 20px;
  display: flex;
  gap: 20px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 12.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user .message-avatar {
  background-color: #54b2ff;
  color: white;
}

.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent-green), #1a7f64);
  color: white;
}

.message-avatar i {
  width: 16px;
  height: 16px;
}

.message-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-sender {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Inline timeline (text + tool chip + text + tool chip …) */
.message-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.timeline-text {
  /* uses existing .message-content styles for markdown */
}

.timeline-text:empty {
  display: none;
}

/* Tool invocation chip — expandable card */
.tool-chip {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  max-width: 100%;
  width: fit-content;
  min-width: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.10));
  background: var(--surface-2, rgba(125, 125, 200, 0.06));
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tool-chip.running {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.30);
}

.tool-chip.done {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.28);
}

.tool-chip.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.30);
}

.tool-chip-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  user-select: none;
}

.tool-chip-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

.tool-chip.running .tool-chip-header { color: #4338ca; }
.tool-chip.done    .tool-chip-header { color: #047857; }
.tool-chip.error   .tool-chip-header { color: #b91c1c; }

.tool-chip-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-chip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tool-chip-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tool-chip-spin 0.7s linear infinite;
  flex-shrink: 0;
  opacity: 0.7;
}

@keyframes tool-chip-spin {
  to { transform: rotate(360deg); }
}

.tool-chip-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.tool-chip[data-expanded="true"] .tool-chip-chevron {
  transform: rotate(180deg);
}

.tool-chip-details {
  display: none;
  padding: 0 12px 12px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 0;
}

.tool-chip[data-expanded="true"] .tool-chip-details {
  display: block;
}

.tool-chip-section {
  margin-top: 10px;
}

.tool-chip-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 6px;
}

.tool-chip-kv {
  font-size: 12.5px;
  line-height: 1.5;
  padding: 2px 0;
  word-break: break-word;
}

.tool-chip-k {
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin-right: 4px;
}

.tool-chip-v {
  color: var(--text-primary, #111827);
}

.tool-chip-result {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.04);
  padding: 8px 10px;
  border-radius: 6px;
  max-height: 280px;
  overflow: auto;
  color: var(--text-primary, #111827);
  margin: 0;
}

.tool-chip-error-msg {
  color: #b91c1c;
}

/* Dark mode */
body.theme-dark .tool-chip,
body.dark .tool-chip {
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .tool-chip.running,
body.dark .tool-chip.running {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
}

body.theme-dark .tool-chip.done,
body.dark .tool-chip.done {
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.30);
}

body.theme-dark .tool-chip.error,
body.dark .tool-chip.error {
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.30);
}

body.theme-dark .tool-chip.running .tool-chip-header,
body.dark    .tool-chip.running .tool-chip-header { color: #c7d2fe; }
body.theme-dark .tool-chip.done .tool-chip-header,
body.dark    .tool-chip.done .tool-chip-header { color: #6ee7b7; }
body.theme-dark .tool-chip.error .tool-chip-header,
body.dark    .tool-chip.error .tool-chip-header { color: #fca5a5; }

body.theme-dark .tool-chip-details,
body.dark .tool-chip-details {
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .tool-chip-header:hover,
body.dark .tool-chip-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .tool-chip-result,
body.dark .tool-chip-result {
  background: rgba(0, 0, 0, 0.30);
  color: #e5e7eb;
}

/* Rich Markdown Content Formatting inside AI Responses */
.message-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.message-content p {
  margin-bottom: 12px;
}

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

.message-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.message-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 10px 0;
  color: var(--text-primary);
}

.message-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: var(--text-primary);
}

/* Lists */
.message-content ul, 
.message-content ol {
  margin: 8px 0 16px 20px;
}

.message-content li {
  margin-bottom: 6px;
}

/* Blockquotes */
.message-content blockquote {
  border-left: 3px solid var(--accent-green);
  background-color: rgba(16, 163, 127, 0.05);
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

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

/* Tables */
.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.message-content th,
.message-content td {
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  text-align: left;
}

.message-content th {
  background-color: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--text-primary);
}

.message-content tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Code Blocks Styling */
.message-content pre {
  margin: 16px 0;
  background-color: #0d0d0d !important;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.code-block-wrapper {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.code-block-header {
  background-color: #171717;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.code-lang {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.copy-code-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.copy-code-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.copy-code-btn i {
  width: 12px;
  height: 12px;
}

.code-block-wrapper pre {
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 16px !important;
}

.code-block-wrapper code {
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 13.5px !important;
}

/* Inline Code */
.message-content :not(pre) > code {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f28b8b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Courier New', Courier, monospace;
}

/* Action Buttons (Copy / Regenerate below response) */
.message-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.message-item:hover .message-actions {
  opacity: 1;
}

.action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.action-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.action-icon-btn i {
  width: 14px;
  height: 14px;
}

/* Typing / SSE Stream Flashing Cursor */
.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--text-primary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* 7. Bottom Input Area & Textarea */
.chat-input-area {
  padding: 0 20px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, rgba(33, 33, 33, 0) 0%, var(--bg-primary) 30%);
}

.input-wrapper {
  max-width: 780px;
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 26px;
  padding: 10px 14px 10px 18px;
  box-shadow: var(--shadow-premium);
  transition: border-color var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.18);
}

.input-wrapper form {
  display: flex;
  flex-direction: column;
}

#chatInput {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  width: 100%;
  padding: 6px 0;
}

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

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 4px;
}

.left-actions {
  display: flex;
  gap: 6px;
}

.left-actions .action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.left-actions .action-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.left-actions .action-btn i {
  width: 16px;
  height: 16px;
}

.action-btn.recording {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  margin-left: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 12px;
  max-width: 220px;
}

.attachment-chip i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.attachment-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  border-radius: 4px;
}

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

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
}

.send-btn:hover:not(:disabled) {
  background-color: var(--text-primary);
}

.send-btn:disabled {
  background-color: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
}

.send-btn i {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Active streaming send button (acts as a stop stream button) */
.send-btn.generating {
  background-color: var(--text-primary);
  color: #000;
  animation: pulse-stop 2s infinite;
}

@keyframes pulse-stop {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
  max-width: 600px;
}

/* 8. Glassmorphic Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  animation: modal-zoom-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-zoom-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: background-color var(--transition-fast);
}

.close-modal-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.close-modal-btn i {
  width: 20px;
  height: 20px;
}

.modal-body {
  display: flex;
  height: 480px;
}

.modal-tabs {
  width: 160px;
  border-right: 1px solid var(--border-color);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.tab-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.setting-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.badge {
  font-size: 11px;
  background-color: rgba(16, 163, 127, 0.15);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 600;
}

.custom-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.settings-link-btn {
  background-color: rgba(16, 163, 127, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.settings-link-btn:hover {
  background-color: rgba(16, 163, 127, 0.25);
  box-shadow: 0 0 10px rgba(16, 163, 127, 0.3);
}

/* 9. Mobile Responsiveness */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  /* Sidebar backdrop when open on mobile */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 90;
    display: none;
  }
  
  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
  
  .sidebar.collapsed ~ .main-content .show-sidebar-btn,
  .main-content .show-sidebar-btn {
    display: flex;
  }
  
  .suggestions-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .message-item {
    padding: 16px 12px;
    gap: 12px;
  }
  
  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  .welcome-header h1 {
    font-size: 20px;
  }
}

/* 10. Authentication & User Profile Styling */
.footer-actions {
  display: flex;
  gap: 4px;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.logout-btn:hover {
  background-color: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
}

.logout-btn i {
  width: 18px;
  height: 18px;
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, var(--bg-radial-start, #1f1f1f) 0%, var(--bg-radial-end, #0d0d0d) 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-page {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh !important;
  background: radial-gradient(circle at 50% 50%, var(--bg-radial-start, #1f1f1f) 0%, var(--bg-radial-end, #0d0d0d) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-page-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: rgba(23, 23, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: auth-zoom-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-zoom-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(16, 163, 127, 0.25);
}

.auth-logo i {
  width: 22px;
  height: 22px;
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.auth-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

#loginForm, #registerForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper i {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.input-icon-wrapper input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 14px 14px 42px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.input-icon-wrapper input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
  background-color: rgba(255, 255, 255, 0.02);
}

.input-icon-wrapper:has(input:focus) i,
.input-icon-wrapper.has-focus i {
  color: var(--accent-green);
}

.auth-submit-btn {
  margin-top: 8px;
  background-color: var(--accent-green);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-submit-btn:hover {
  background-color: var(--accent-green-hover);
  box-shadow: 0 4px 18px rgba(16, 163, 127, 0.35);
  transform: translateY(-1px);
}

.auth-submit-btn i {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.auth-submit-btn:hover i {
  transform: translateX(3px);
}

.auth-link {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: opacity var(--transition-fast);
}

.auth-link:hover {
  opacity: 0.75;
}

.forgot-password-link {
  text-transform: none;
  font-weight: 400;
  font-size: 0.8rem;
}

.auth-footer {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-toggle-btn {
  background: transparent;
  border: none;
  color: var(--accent-green);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.auth-toggle-btn:hover {
  color: var(--accent-green-hover);
  text-decoration: underline;
}

.auth-error-msg {
  background-color: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  color: #ff6b6b;
  font-size: 13px;
  padding: 12px 16px;
  line-height: 1.4;
  text-align: left;
  animation: shake-error 0.3s ease-in-out;
}

@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mock-auth-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(171, 104, 255, 0.1);
  border: 1px solid rgba(171, 104, 255, 0.2);
  border-radius: 12px;
  color: var(--accent-purple);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
  justify-content: center;
  margin-top: 4px;
}

.mock-auth-badge i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Google Sign-in Divider and Button */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 6px 0;
  opacity: 0.7;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider:not(:empty)::before {
  margin-right: 12px;
}

.auth-divider:not(:empty)::after {
  margin-left: 12px;
}

.google-auth-btn {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 13px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.google-auth-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.google-icon {
  flex-shrink: 0;
}

/* 11. Light Theme Overrides */
body.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-sidebar: #f3f3f3;
  --bg-header: #ffffff;
  --bg-card: #e8e8e8;
  --bg-hover: #ececec;
  --border-color: rgba(0, 0, 0, 0.08);
  
  --text-primary: #171717;
  --text-secondary: #4d4d4d;
  --text-muted: #8c8c8c;
  --text-link: #0066cc;
  
  --shadow-premium: 0 8px 30px rgba(0, 0, 0, 0.06);

  /* Light Theme Auth Radiants */
  --bg-radial-start: #fcfcfc;
  --bg-radial-end: #f0f0f0;
}

/* Light Theme Component Tweaks */
body.light-theme .sidebar-header h2,
body.light-theme .chat-item-title,
body.light-theme .model-name,
body.light-theme .welcome-header h1,
body.light-theme .message-sender,
body.light-theme .message-content,
body.light-theme .modal-header h2,
body.light-theme .setting-info h3,
body.light-theme .auth-header h1 {
  color: #171717 !important;
}

body.light-theme .new-chat-btn {
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #171717 !important;
}

body.light-theme .new-chat-btn:hover {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .chat-item {
  color: #4d4d4d !important;
}

body.light-theme .chat-item:hover {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: #171717 !important;
}

body.light-theme .chat-item.active {
  background-color: rgba(0, 0, 0, 0.06) !important;
  color: #171717 !important;
}

body.light-theme .chat-delete-btn:hover {
  color: #ff4d4d !important;
  background-color: rgba(255, 77, 77, 0.08) !important;
}

body.light-theme .model-selector-btn {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: #171717 !important;
}

body.light-theme .model-selector-btn:hover {
  background-color: var(--bg-hover) !important;
}

body.light-theme .model-dropdown {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .dropdown-item {
  color: #4d4d4d !important;
}

body.light-theme .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.03) !important;
  color: #171717 !important;
}

body.light-theme .dropdown-item.active {
  background-color: rgba(16, 163, 127, 0.06) !important;
  color: var(--accent-green) !important;
}

body.light-theme .dropdown-item.active .item-title span {
  color: var(--accent-green) !important;
}

body.light-theme .suggestion-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .suggestion-card:hover {
  background-color: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .action-btn {
  color: #555555 !important;
}

body.light-theme .action-btn:hover {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: #171717 !important;
}

body.light-theme .send-btn {
  background-color: #171717 !important;
  color: #ffffff !important;
}

body.light-theme .send-btn:hover:not(:disabled) {
  background-color: #000000 !important;
}

body.light-theme .send-btn:disabled {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .modal-card {
  background-color: #ffffff !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .tab-btn:hover {
  background-color: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .tab-btn.active {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #171717 !important;
}

body.light-theme .custom-select {
  background-color: #ffffff !important;
  color: #171717 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .auth-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .auth-header p,
body.light-theme .input-group label,
body.light-theme .auth-footer span {
  color: #555555 !important;
}

body.light-theme .input-icon-wrapper input {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #171717 !important;
}

body.light-theme .input-icon-wrapper input:focus {
  border-color: var(--accent-green) !important;
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12) !important;
}

body.light-theme .google-auth-btn {
  color: #171717 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .google-auth-btn:hover {
  background-color: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

body.light-theme .google-icon {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
}

body.light-theme .welcome-header h1 {
  background: none !important;
  -webkit-text-fill-color: #171717 !important;
  color: #171717 !important;
}

body.light-theme .input-wrapper {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .input-wrapper:focus-within {
  border-color: rgba(0, 0, 0, 0.24) !important;
}

body.light-theme .suggestion-card {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .suggestion-card h3 {
  color: #171717 !important;
}

body.light-theme .suggestion-card p {
  color: #666666 !important;
}

body.light-theme .message-item-wrapper.user {
  background-color: #ffffff !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .message-item-wrapper.assistant {
  background-color: #f7f7f8 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .message-content pre {
  background-color: #f7f7f8 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .message-content :not(pre) > code {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: #171717 !important;
}

/* Inline script prevention classes for login flicker (F5 bug) */
html.user-logged-in .auth-overlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

html.user-logged-out .app-container {
  display: none !important;
}

/* Premium Glassmorphic Confirmation Modal */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal.show {
  opacity: 1;
  visibility: visible;
}

.confirm-card {
  background: rgba(23, 23, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal.show .confirm-card {
  transform: scale(1);
}

body.light-theme .confirm-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.confirm-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.confirm-icon i {
  width: 28px;
  height: 28px;
}

.confirm-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.confirm-card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirm-btn-cancel,
.confirm-btn-danger {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.confirm-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.confirm-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light-theme .confirm-btn-cancel {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .confirm-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.06);
}

.confirm-btn-danger {
  background: #ff4d4d;
  color: #ffffff;
}

.confirm-btn-danger:hover {
  background: #ff3333;
  box-shadow: 0 4px 12px rgba(255, 77, 77, 0.2);
}

/* Premium Profile Details Form CSS Styling */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.profile-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.profile-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

body.light-theme .profile-input {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #171717;
}

body.light-theme .profile-input:focus {
  background: rgba(255, 255, 255, 1);
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.profile-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent-green);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.profile-submit-btn:hover {
  background: var(--accent-green-hover);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.25);
}

.profile-submit-btn i {
  width: 16px;
  height: 16px;
}

.profile-save-status {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.profile-save-status.success {
  background: rgba(16, 163, 127, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 163, 127, 0.2);
}

.profile-save-status.error {
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.2);
}

/* 24. Navigation Bar (Shared across all pages) */
.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.nav-logo {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--accent-green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-normal);
}

.nav-link:hover {
  color: var(--accent-green);
}

.nav-link.active {
  color: var(--accent-green);
}

.logout-btn-nav {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-normal);
  font-family: var(--font-sans);
  font-size: 1em;
}

.logout-btn-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .nav-wrapper {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }

  .nav-links {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
}
