/* ═══════════════════════════════════════════════════════════════
   AI JYOTISH CHATBOT — COSMIC DARK GLASSMORPHISM THEME
   Base: #0a0a1a | Accent: cyan-purple-magenta gradient
   Typography: Inter (body), Space Grotesk (headings)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  --ai-bg-deep: #0a0a1a;
  --ai-bg-glass: rgba(15, 15, 35, 0.75);
  --ai-bg-glass-dense: rgba(15, 15, 35, 0.88);
  --ai-bg-card: rgba(20, 20, 50, 0.6);
  --ai-bg-elevated: rgba(30, 30, 65, 0.5);
  --ai-border-glass: rgba(255, 255, 255, 0.08);
  --ai-border-glow: rgba(14, 165, 233, 0.2);
  --ai-accent-cyan: #0EA5E9;
  --ai-accent-purple: #6366F1;
  --ai-accent-magenta: #F43F5E;
  --ai-gradient-accent: linear-gradient(135deg, #0EA5E9, #6366F1, #F43F5E);
  --ai-gradient-accent-h: linear-gradient(90deg, #0EA5E9, #6366F1, #F43F5E);
  --ai-gradient-subtle: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(123,45,255,0.12), rgba(255,45,123,0.12));
  --ai-text-primary: #e8e4f0;
  --ai-text-secondary: #9896b0;
  --ai-text-muted: #6b6880;
  --ai-radius-card: 16px;
  --ai-radius-btn: 12px;
  --ai-radius-pill: 20px;
  --ai-blur: blur(20px);
  --ai-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ai-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ai-font-heading: 'Space Grotesk', 'Inter', sans-serif;
  --ai-shadow-glow-cyan: 0 0 20px rgba(14, 165, 233, 0.25);
  --ai-shadow-glow-purple: 0 0 20px rgba(99, 102, 241, 0.25);
  --ai-shadow-glow-magenta: 0 0 20px rgba(244, 63, 94, 0.2);
  --ai-shadow-panel: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(99, 102, 241, 0.08);
}

/* ─── FAB (Floating Action Button) ──────────────────────────── */
#ai-chat-fab,
#ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--ai-gradient-accent);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 28px;
  box-shadow:
    0 4px 24px rgba(14, 165, 233, 0.3),
    0 0 40px rgba(99, 102, 241, 0.2);
  transition: transform var(--ai-transition), box-shadow var(--ai-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: aiFabPulse 3s ease-in-out infinite;
  font-family: var(--ai-font-body);
}

#ai-chat-fab:hover,
#ai-fab:hover {
  transform: scale(1.12);
  box-shadow:
    0 6px 32px rgba(14, 165, 233, 0.45),
    0 0 60px rgba(99, 102, 241, 0.3),
    0 0 80px rgba(244, 63, 94, 0.15);
}

@keyframes aiFabPulse {
  0%, 100% {
    box-shadow:
      0 4px 24px rgba(14, 165, 233, 0.3),
      0 0 40px rgba(99, 102, 241, 0.2);
  }
  50% {
    box-shadow:
      0 4px 30px rgba(14, 165, 233, 0.45),
      0 0 60px rgba(99, 102, 241, 0.3),
      0 0 20px rgba(244, 63, 94, 0.15);
  }
}

.fab-icon {
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.fab-badge,
#ai-queue-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--ai-accent-magenta);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: aiBadgePulse 1.5s infinite;
  border: 2px solid var(--ai-bg-deep);
  font-family: var(--ai-font-body);
}

@keyframes aiBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ─── Panel Container ───────────────────────────────────────── */
.ai-chat-panel,
#ai-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  width: 430px;
  height: 640px;
  background: var(--ai-bg-glass-dense);
  backdrop-filter: var(--ai-blur);
  -webkit-backdrop-filter: var(--ai-blur);
  border-radius: var(--ai-radius-card);
  border: 1px solid var(--ai-border-glass);
  display: flex;
  flex-direction: column;
  box-shadow: var(--ai-shadow-panel);
  transition: all var(--ai-transition);
  overflow: hidden;
  font-family: var(--ai-font-body);
  animation: aiPanelSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aiPanelSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-chat-panel.hidden {
  display: none !important;
}

.ai-chat-panel.ai-fullscreen,
.ai-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  bottom: 0 !important;
  right: 0 !important;
  border-radius: 0;
  max-width: 100vw;
  max-height: 100vh;
}

/* ─── Header ────────────────────────────────────────────────── */
.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg,
    rgba(14, 165, 233, 0.15),
    rgba(99, 102, 241, 0.15),
    rgba(244, 63, 94, 0.1));
  border-bottom: 1px solid var(--ai-border-glass);
  flex-shrink: 0;
  position: relative;
}

.ai-chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ai-gradient-accent-h);
  opacity: 0.4;
}

.ai-chat-title {
  color: var(--ai-text-primary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ai-font-heading);
  letter-spacing: 0.3px;
}

.ai-chat-actions {
  display: flex;
  gap: 2px;
}

.ai-chat-actions button {
  background: none;
  border: none;
  color: var(--ai-text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 5px 8px;
  border-radius: 8px;
  transition: all var(--ai-transition);
}

.ai-chat-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ai-text-primary);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
}

/* ─── Connection Badge ──────────────────────────────────────── */
.ai-badge,
#ai-connection-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--ai-radius-pill);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--ai-font-body);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ai-badge.connected {
  background: rgba(14, 165, 233, 0.2);
  color: var(--ai-accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.15);
}

.ai-badge.disconnected {
  background: rgba(244, 63, 94, 0.2);
  color: var(--ai-accent-magenta);
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

/* ─── Toolbar ───────────────────────────────────────────────── */
.ai-toolbar {
  border-bottom: 1px solid var(--ai-border-glass);
  flex-shrink: 0;
  background: rgba(10, 10, 26, 0.5);
}

.ai-toolbar-tabs {
  display: flex;
  background: rgba(10, 10, 26, 0.6);
}

.ai-toolbar-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--ai-text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 2px solid transparent;
  transition: all var(--ai-transition);
  font-family: var(--ai-font-body);
}

.ai-toolbar-tab[data-aitab] {
  /* Preserve data-aitab selector for JS */
}

.ai-toolbar-tab:hover {
  color: var(--ai-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.ai-toolbar-tab.active {
  color: var(--ai-accent-cyan);
  border-bottom-color: var(--ai-accent-cyan);
  text-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.ai-toolbar-content {
  display: none;
  padding: 10px;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 140px;
  overflow-y: auto;
}

.ai-toolbar-content.active {
  display: flex;
}

/* Quick-ask / report / highlight buttons — neon outline style */
.ai-quick-btn,
.ai-report-btn,
.ai-highlight-btn {
  padding: 6px 12px;
  border-radius: var(--ai-radius-btn);
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.05);
  color: var(--ai-text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all var(--ai-transition);
  white-space: nowrap;
  font-family: var(--ai-font-body);
}

.ai-quick-btn:hover,
.ai-report-btn:hover,
.ai-highlight-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--ai-accent-cyan);
  color: var(--ai-accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ai-q-icon {
  margin-right: 4px;
}

/* ─── Focus Bar ─────────────────────────────────────────────── */
.ai-focus-bar {
  padding: 8px 14px;
  border-bottom: 1px solid var(--ai-border-glass);
  flex-shrink: 0;
  background: rgba(10, 10, 26, 0.4);
}

.ai-focus-bar select,
.ai-focus-bar select#ai-focus-select,
#ai-focus-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ai-text-primary);
  border: 1px solid var(--ai-border-glass);
  font-size: 12px;
  font-family: var(--ai-font-body);
  cursor: pointer;
  transition: all var(--ai-transition);
  appearance: none;
  -webkit-appearance: none;
}

.ai-focus-bar select:focus,
#ai-focus-select:focus {
  border-color: var(--ai-accent-cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), var(--ai-shadow-glow-cyan);
}

.ai-focus-bar select option {
  background: var(--ai-bg-deep);
  color: var(--ai-text-primary);
}

/* ─── Language & Voice Control Bar ──────────────────────────── */
@keyframes ai-lv-pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 0 rgba(14, 165, 233, 0.1), 0 0 0 0 rgba(99, 102, 241, 0.15);
  }
  50% {
    box-shadow: inset 0 0 20px 0 rgba(14, 165, 233, 0.05), 0 0 16px 3px rgba(99, 102, 241, 0.1);
  }
}

@keyframes ai-lv-entrance {
  from { opacity: 0; max-height: 0; padding: 0 12px; }
  to   { opacity: 1; max-height: 80px; padding: 8px 12px; }
}

.ai-lang-voice-bar {
  padding: 8px 12px;
  background: linear-gradient(135deg,
    rgba(14, 165, 233, 0.06) 0%,
    rgba(99, 102, 241, 0.06) 50%,
    rgba(244, 63, 94, 0.04) 100%);
  border-bottom: 1px solid var(--ai-border-glass);
  border-top: 1px solid var(--ai-border-glass);
  flex-shrink: 0;
  animation: ai-lv-entrance 0.4s ease-out, ai-lv-pulse 2.5s ease-in-out 0.5s 4;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.ai-lv-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-lv-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-lv-icon {
  font-size: 0.9rem;
  margin-right: 2px;
  opacity: 0.7;
}

/* Language & Voice buttons */
.ai-lang-btn,
.ai-voice-btn,
.ai-lang-btn[data-lang],
.ai-voice-btn[data-voice] {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--ai-radius-pill);
  background: rgba(99, 102, 241, 0.08);
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
  white-space: nowrap;
  font-family: var(--ai-font-body);
  letter-spacing: 0.3px;
}

.ai-lang-btn.active,
.ai-voice-btn.active {
  background: var(--ai-gradient-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 16px rgba(14, 165, 233, 0.3), 0 0 8px rgba(99, 102, 241, 0.3);
  transform: scale(1.06);
  font-weight: 700;
}

.ai-lang-btn:hover:not(.active),
.ai-voice-btn:hover:not(.active) {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--ai-accent-cyan);
  color: var(--ai-accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

/* ─── TTS Playing Animation ─────────────────────────────────── */
@keyframes ai-tts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
  50%      { box-shadow: 0 0 12px 4px rgba(14, 165, 233, 0.25); }
}

.ai-tts-playing {
  animation: ai-tts-pulse 1.2s ease-in-out infinite;
}

/* TTS Reading Highlight */
.ai-msg-bubble .tts-reading-active {
  background-color: rgba(14, 165, 233, 0.2) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15) !important;
  animation: ai-tts-highlight 1.5s ease-in-out infinite !important;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background-color 0.3s ease;
}

@keyframes ai-tts-highlight {
  0%   { background-color: rgba(14, 165, 233, 0.15); }
  50%  { background-color: rgba(14, 165, 233, 0.35); }
  100% { background-color: rgba(14, 165, 233, 0.15); }
}

.tts-sentence {
  transition: background-color 0.3s ease;
}

/* ─── Message Action Buttons (Listen / Copy) ────────────────── */
.ai-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding: 0;
  justify-content: flex-end;
}

.ai-tts-btn,
.ai-copy-btn {
  background: rgba(99, 102, 241, 0.1) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  border-radius: var(--ai-radius-pill) !important;
  padding: 4px 12px !important;
  font-size: 0.68rem !important;
  color: var(--ai-accent-cyan) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--ai-transition);
  font-weight: 600;
  font-family: var(--ai-font-body);
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.ai-tts-btn:hover,
.ai-copy-btn:hover {
  background: var(--ai-gradient-accent) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}

.ai-tts-icon {
  font-size: 0.75rem;
}

.ai-tts-label {
  font-size: 0.65rem;
}

/* ─── Messages Area ─────────────────────────────────────────── */
.ai-chat-messages,
#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: linear-gradient(180deg, rgba(10, 10, 26, 0.3) 0%, rgba(10, 10, 26, 0.6) 100%);
}

.ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.4);
}

/* ─── Message Rows ──────────────────────────────────────────── */
.ai-msg {
  display: flex;
}

.ai-msg-user {
  justify-content: flex-end;
}

.ai-msg-bot {
  justify-content: flex-start;
}

/* ─── Message Bubbles ───────────────────────────────────────── */
.ai-msg-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
  font-family: var(--ai-font-body);
}

/* User bubble — accent gradient */
.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, #0EA5E9, #6366F1);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow:
    0 4px 16px rgba(14, 165, 233, 0.2),
    0 0 20px rgba(99, 102, 241, 0.15);
}

/* Bot bubble — dark glass */
.ai-msg-bot .ai-msg-bubble {
  background: var(--ai-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ai-text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--ai-border-glass);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ai-msg-bot .ai-msg-bubble h2 {
  color: var(--ai-accent-cyan);
  margin: 10px 0 6px;
  font-size: 16px;
  font-family: var(--ai-font-heading);
  font-weight: 700;
}

.ai-msg-bot .ai-msg-bubble h3 {
  color: var(--ai-accent-purple);
  margin: 8px 0 4px;
  font-size: 14px;
  font-family: var(--ai-font-heading);
  font-weight: 600;
}

.ai-msg-bot .ai-msg-bubble h4 {
  color: var(--ai-accent-magenta);
  margin: 6px 0 3px;
  font-size: 13px;
  font-family: var(--ai-font-heading);
  font-weight: 600;
}

.ai-msg-bot .ai-msg-bubble strong {
  color: var(--ai-accent-cyan);
}

.ai-msg-bot .ai-msg-bubble em {
  color: #a78bfa;
}

.ai-msg-bot .ai-msg-bubble code {
  background: rgba(14, 165, 233, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Fira Code', 'Courier New', monospace;
  color: var(--ai-accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.ai-msg-bot .ai-msg-bubble li {
  margin-left: 16px;
  margin-bottom: 3px;
}

.ai-error {
  color: var(--ai-accent-magenta);
  font-weight: 600;
}

/* ─── Typing Indicator ──────────────────────────────────────── */
.ai-typing {
  display: flex;
  gap: 5px;
  padding: 6px 0;
  align-items: center;
}

.ai-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: aiBounce 1.2s infinite;
  opacity: 0.7;
}

.ai-typing span:nth-child(1) {
  background: var(--ai-accent-cyan);
}

.ai-typing span:nth-child(2) {
  background: var(--ai-accent-purple);
  animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
  background: var(--ai-accent-magenta);
  animation-delay: 0.4s;
}

@keyframes aiBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-10px); opacity: 1; }
}

/* ─── Input Area ────────────────────────────────────────────── */
.ai-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--ai-border-glass);
  flex-shrink: 0;
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(10px);
}

.ai-chat-input-area textarea,
#ai-chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--ai-radius-btn);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ai-text-primary);
  border: 1px solid var(--ai-border-glass);
  resize: none;
  font-size: 13px;
  font-family: var(--ai-font-body);
  max-height: 80px;
  transition: all var(--ai-transition);
}

.ai-chat-input-area textarea::placeholder {
  color: var(--ai-text-muted);
}

.ai-chat-input-area textarea:focus,
#ai-chat-input:focus {
  border-color: var(--ai-accent-cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 0 16px rgba(14, 165, 233, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

/* ─── Send Button — Glowing ─────────────────────────────────── */
#ai-send-btn {
  padding: 10px 20px;
  border-radius: var(--ai-radius-btn);
  border: none;
  background: var(--ai-gradient-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ai-transition);
  font-size: 13px;
  font-family: var(--ai-font-body);
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.25), 0 0 40px rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
}

#ai-send-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.15),
    transparent 50%);
  border-radius: inherit;
}

#ai-send-btn:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 30px rgba(14, 165, 233, 0.4),
    0 0 60px rgba(99, 102, 241, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

#ai-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Settings Panel ────────────────────────────────────────── */
.ai-settings {
  border-top: 1px solid var(--ai-border-glass);
  padding: 0 14px;
  color: var(--ai-text-secondary);
  font-size: 12px;
  flex-shrink: 0;
  background: rgba(10, 10, 26, 0.5);
  font-family: var(--ai-font-body);
}

.ai-settings summary {
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--ai-text-secondary);
  transition: color var(--ai-transition);
}

.ai-settings summary:hover {
  color: var(--ai-accent-cyan);
}

.ai-settings summary::-webkit-details-marker {
  display: none;
}

.ai-settings-body {
  padding: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-settings-body label {
  color: var(--ai-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-settings-body input,
.ai-settings-body select,
#ai-key-input,
#ai-model-select {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ai-text-primary);
  border: 1px solid var(--ai-border-glass);
  font-size: 12px;
  font-family: var(--ai-font-body);
  transition: all var(--ai-transition);
}

.ai-settings-body input:focus,
.ai-settings-body select:focus,
#ai-key-input:focus,
#ai-model-select:focus {
  border-color: var(--ai-accent-cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ai-settings-body input::placeholder {
  color: var(--ai-text-muted);
}

.ai-settings-body select option {
  background: var(--ai-bg-deep);
  color: var(--ai-text-primary);
}

.ai-settings-body button {
  padding: 8px 16px;
  border-radius: var(--ai-radius-btn);
  border: none;
  background: var(--ai-gradient-accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--ai-font-body);
  margin-top: 4px;
  transition: all var(--ai-transition);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
}

.ai-settings-body button:hover {
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

#ai-settings-status {
  font-size: 11px;
  min-height: 16px;
  color: var(--ai-text-secondary);
}

/* ─── Export Modal ───────────────────────────────────────────── */
.ai-export-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.ai-export-content {
  background: var(--ai-bg-glass-dense);
  backdrop-filter: var(--ai-blur);
  -webkit-backdrop-filter: var(--ai-blur);
  border-radius: var(--ai-radius-card);
  padding: 22px;
  max-width: 480px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--ai-border-glass);
  color: var(--ai-text-primary);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
  font-family: var(--ai-font-body);
}

.ai-export-content h3 {
  color: var(--ai-accent-cyan);
  margin: 0 0 14px;
  font-family: var(--ai-font-heading);
  font-weight: 700;
}

.ai-export-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 10px 0;
}

.ai-export-list label {
  display: block;
  padding: 5px 0;
  font-size: 12px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  transition: color var(--ai-transition);
}

.ai-export-list label:hover {
  color: var(--ai-accent-cyan);
}

.ai-export-cb {
  accent-color: var(--ai-accent-cyan);
}

.ai-export-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-export-controls button {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--ai-border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ai-text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--ai-font-body);
  transition: all var(--ai-transition);
}

.ai-export-controls button:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--ai-accent-cyan);
  color: var(--ai-accent-cyan);
}

.ai-export-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.ai-export-actions button {
  flex: 1;
  padding: 10px;
  border-radius: var(--ai-radius-btn);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--ai-font-body);
  transition: all var(--ai-transition);
}

.ai-export-actions button:first-child {
  background: var(--ai-gradient-accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
}

.ai-export-actions button:first-child:hover {
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.ai-export-actions button:last-child {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ai-text-secondary);
  border: 1px solid var(--ai-border-glass);
}

.ai-export-actions button:last-child:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ai-text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ─── Hint Text ─────────────────────────────────────────────── */
.ai-hint {
  color: var(--ai-text-muted);
  font-size: 12px;
  padding: 8px;
  text-align: center;
  width: 100%;
  font-family: var(--ai-font-body);
}

/* ─── Mobile Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .ai-chat-panel,
  #ai-chat-panel {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    bottom: 80px !important;
    height: 75vh !important;
    border-radius: 14px;
  }

  #ai-chat-fab,
  #ai-fab {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
    font-size: 24px;
  }

  .ai-toolbar-content {
    max-height: 100px;
  }

  .ai-msg-bubble {
    max-width: 92%;
    font-size: 12px;
  }

  .ai-lang-btn,
  .ai-voice-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* ─── Scrollbar Styles for Sub-containers ───────────────────── */
.ai-toolbar-content::-webkit-scrollbar,
.ai-export-list::-webkit-scrollbar,
.ai-export-content::-webkit-scrollbar {
  width: 4px;
}

.ai-toolbar-content::-webkit-scrollbar-track,
.ai-export-list::-webkit-scrollbar-track,
.ai-export-content::-webkit-scrollbar-track {
  background: transparent;
}

.ai-toolbar-content::-webkit-scrollbar-thumb,
.ai-export-list::-webkit-scrollbar-thumb,
.ai-export-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 3px;
}

.ai-toolbar-content::-webkit-scrollbar-thumb:hover,
.ai-export-list::-webkit-scrollbar-thumb:hover,
.ai-export-content::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.35);
}

/* ─── Selection Color ───────────────────────────────────────── */
.ai-chat-panel ::selection {
  background: rgba(14, 165, 233, 0.3);
  color: #fff;
}
