/* FlashNote AI - Theme Design Tokens (v5.4) */
:root, [data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #111827;
  --bg-elevated: #1e293b;
  --bg-input: #0b1120;
  --border-subtle: #1e293b;
  --border-medium: #334155;
  --border-focus: #6366f1;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --badge-bg: rgba(59, 130, 246, 0.12);
  --badge-text: #60a5fa;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --scrollbar-track: #090d16;
  --scrollbar-thumb: #1e293b;
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-input: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #2563eb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-purple: #7c3aed;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --badge-bg: rgba(37, 99, 235, 0.08);
  --badge-text: #2563eb;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
}

[data-theme="warm"] {
  --bg-app: #fcf9f2;
  --bg-surface: #f7f2e7;
  --bg-card: #ffffff;
  --bg-elevated: #efe7d7;
  --bg-input: #faf6ee;
  --border-subtle: #e5dbc9;
  --border-medium: #d4c6af;
  --border-focus: #d97706;
  --text-primary: #292524;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --text-inverse: #ffffff;
  --accent-primary: #d97706;
  --accent-hover: #b45309;
  --accent-purple: #9333ea;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --badge-bg: rgba(217, 119, 6, 0.1);
  --badge-text: #b45309;
  --card-shadow: 0 4px 20px -2px rgba(41, 37, 36, 0.05);
  --scrollbar-track: #f7f2e7;
  --scrollbar-thumb: #d4c6af;
}

/* Base HTML & Body Styles */
html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Global scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* Dynamic Theme Adaptations for existing Tailwind utility classes */
[data-theme="light"] .bg-slate-950 { background-color: var(--bg-app) !important; }
[data-theme="light"] .bg-slate-900 { background-color: var(--bg-surface) !important; }
[data-theme="light"] .bg-slate-900\/80 { background-color: rgba(255, 255, 255, 0.92) !important; }
[data-theme="light"] .bg-slate-800 { background-color: var(--bg-elevated) !important; }
[data-theme="light"] .bg-slate-800\/90 { background-color: var(--bg-elevated) !important; }
[data-theme="light"] .border-slate-800, [data-theme="light"] .border-slate-700 { border-color: var(--border-subtle) !important; }
[data-theme="light"] .text-slate-100, [data-theme="light"] .text-white { color: var(--text-primary) !important; }
[data-theme="light"] .text-slate-200, [data-theme="light"] .text-slate-300 { color: var(--text-secondary) !important; }
[data-theme="light"] .text-slate-400, [data-theme="light"] .text-slate-500 { color: var(--text-muted) !important; }
[data-theme="light"] .bg-slate-950\/60,
[data-theme="light"] .bg-slate-950\/50,
[data-theme="light"] .bg-slate-950\/80,
[data-theme="light"] .bg-slate-950\/40,
[data-theme="light"] .bg-slate-900\/90,
[data-theme="light"] .bg-slate-900\/60 {
  background-color: var(--bg-card) !important;
}
[data-theme="light"] .shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06) !important; }

[data-theme="warm"] .bg-slate-950 { background-color: var(--bg-app) !important; }
[data-theme="warm"] .bg-slate-900 { background-color: var(--bg-surface) !important; }
[data-theme="warm"] .bg-slate-900\/80 { background-color: rgba(247, 242, 231, 0.92) !important; }
[data-theme="warm"] .bg-slate-800 { background-color: var(--bg-elevated) !important; }
[data-theme="warm"] .bg-slate-800\/90 { background-color: var(--bg-elevated) !important; }
[data-theme="warm"] .bg-slate-950\/60,
[data-theme="warm"] .bg-slate-950\/50,
[data-theme="warm"] .bg-slate-950\/80,
[data-theme="warm"] .bg-slate-950\/40,
[data-theme="warm"] .bg-slate-900\/90,
[data-theme="warm"] .bg-slate-900\/60 {
  background-color: var(--bg-card) !important;
}
[data-theme="warm"] .border-slate-800, [data-theme="warm"] .border-slate-700 { border-color: var(--border-subtle) !important; }
[data-theme="warm"] .text-slate-100, [data-theme="warm"] .text-white { color: var(--text-primary) !important; }
[data-theme="warm"] .text-slate-200, [data-theme="warm"] .text-slate-300 { color: var(--text-secondary) !important; }
[data-theme="warm"] .text-slate-400, [data-theme="warm"] .text-slate-500 { color: var(--text-muted) !important; }
[data-theme="warm"] .shadow-sm { box-shadow: 0 1px 3px 0 rgba(41, 37, 36, 0.06), 0 1px 2px -1px rgba(41, 37, 36, 0.06) !important; }

/* Mobile Workspace Tab Display Isolation */
@media (max-width: 1023px) {
  .workspace-mobile-card:not(.active-mobile-card) {
    display: none !important;
  }
  .workspace-mobile-card.active-mobile-card {
    display: flex !important;
    flex-direction: column !important;
  }
}
@media (min-width: 1024px) {
  .workspace-mobile-card {
    display: flex !important;
  }
  #dropzone-card.workspace-mobile-card {
    display: block !important;
  }
}

/* Interactive Mind Map Styling & Dark Mode Adaptations */
#markmap-svg, #markmap-fullscreen-svg {
  --markmap-text-color: var(--text-primary, #f8fafc);
  --markmap-circle-open-bg: var(--bg-surface, #0f172a);
  --markmap-code-bg: var(--bg-elevated, #1e293b);
  --markmap-code-color: var(--accent-primary, #38bdf8);
  width: 100%;
  height: 100%;
}
.markmap text {
  fill: var(--text-primary, #f8fafc) !important;
  font-size: 13px !important;
}
.markmap .markmap-foreign {
  color: var(--text-primary, #f8fafc) !important;
}
.markmap .markmap-foreign * {
  color: var(--text-primary, #f8fafc) !important;
}
.markmap-link {
  stroke-opacity: 0.85 !important;
}


