/* ==========================================================================
   MetaPicks v4.0 — Modern Daylight SaaS Theme & High-Legibility Typography
   Default: Crisp Daylight Pro Theme (html:not(.dark-theme))
   Optional: High-Contrast Dark Mode (html.dark-theme)
   ========================================================================== */

:root {
  --bg-page: #f4f7fb;
  --bg-card: #ffffff;
  --bg-inset: #f8fafc;
  --bg-pill: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-indigo: #4f46e5;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 6px 20px -4px rgba(15, 23, 42, 0.06);
}

html.dark-theme {
  --bg-page: #0b1120;
  --bg-card: #111827;
  --bg-inset: #0f172a;
  --bg-pill: #1e293b;
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

html {
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

html.dark-theme {
  color-scheme: dark;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page) !important;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.06), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(16, 185, 129, 0.06), transparent 40%) !important;
  color: var(--text-primary) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ==========================================================================
   Daylight Pro Theme Overrides (Default — High-Contrast & Easy to Read)
   ========================================================================== */
html:not(.dark-theme) header {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06) !important;
}

/* Elevated White Cards */
html:not(.dark-theme) .bg-slate-900,
html:not(.dark-theme) .bg-slate-900\/70,
html:not(.dark-theme) .bg-slate-900\/80,
html:not(.dark-theme) .bg-slate-900\/85,
html:not(.dark-theme) .bg-slate-900\/90,
html:not(.dark-theme) .bg-slate-900\/95 {
  background-color: #ffffff !important;
  border-color: #dbe3ee !important;
  box-shadow: var(--card-shadow) !important;
  color: #0f172a !important;
}

/* Inset Panels, Inputs & Table Headers */
html:not(.dark-theme) main .bg-slate-950,
html:not(.dark-theme) main .bg-slate-950\/60,
html:not(.dark-theme) main .bg-slate-950\/70,
html:not(.dark-theme) main .bg-slate-950\/80,
html:not(.dark-theme) main .bg-slate-950\/85,
html:not(.dark-theme) main .bg-slate-950\/95,
html:not(.dark-theme) #mpGoogleAuthModal .bg-slate-950,
html:not(.dark-theme) #mpAdminGateModal .bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html:not(.dark-theme) input,
html:not(.dark-theme) select,
html:not(.dark-theme) textarea {
  color: #0f172a !important;
}

html:not(.dark-theme) input.bg-slate-950,
html:not(.dark-theme) input.bg-slate-900,
html:not(.dark-theme) select.bg-slate-950,
html:not(.dark-theme) select.bg-slate-900,
html:not(.dark-theme) textarea.bg-slate-950 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

html:not(.dark-theme) input::placeholder {
  color: #64748b !important;
}

/* Secondary Buttons & Pills */
html:not(.dark-theme) .bg-slate-800,
html:not(.dark-theme) .bg-slate-800\/90 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html:not(.dark-theme) .hover\:bg-slate-700:hover,
html:not(.dark-theme) .hover\:bg-slate-800\/50:hover,
html:not(.dark-theme) .hover\:bg-slate-800\/70:hover {
  background-color: #e2e8f0 !important;
}

/* Borders & Dividers */
html:not(.dark-theme) .border-slate-800,
html:not(.dark-theme) .border-slate-800\/80,
html:not(.dark-theme) .border-slate-800\/90,
html:not(.dark-theme) .border-slate-700 {
  border-color: #cbd5e1 !important;
}

html:not(.dark-theme) .divide-slate-800\/50 > :not([hidden]) ~ :not([hidden]),
html:not(.dark-theme) .divide-slate-800\/60 > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

/* High-Contrast Readable Text Hierarchy */
html:not(.dark-theme) .text-white,
html:not(.dark-theme) .text-slate-100 {
  color: #0f172a !important;
}

/* Keep white text inside solid dark/colored badges & buttons */
html:not(.dark-theme) .bg-rose-500.text-white,
html:not(.dark-theme) .bg-indigo-600.text-white,
html:not(.dark-theme) .bg-emerald-600.text-white,
html:not(.dark-theme) .mp-btn-primary {
  color: #ffffff !important;
}

html:not(.dark-theme) .text-slate-200,
html:not(.dark-theme) .text-slate-300 {
  color: #1e293b !important;
}

html:not(.dark-theme) .text-slate-400 {
  color: #334155 !important;
}

html:not(.dark-theme) .text-slate-500 {
  color: #475569 !important;
}

/* High-Contrast Semantic Accent Colors on White Surfaces */
html:not(.dark-theme) .text-emerald-400,
html:not(.dark-theme) .text-emerald-300,
html:not(.dark-theme) .text-emerald-200 {
  color: #047857 !important;
}

html:not(.dark-theme) .text-teal-400,
html:not(.dark-theme) .text-teal-300,
html:not(.dark-theme) .text-teal-200 {
  color: #0f766e !important;
}

html:not(.dark-theme) .text-cyan-400,
html:not(.dark-theme) .text-cyan-300,
html:not(.dark-theme) .text-sky-400,
html:not(.dark-theme) .text-sky-300,
html:not(.dark-theme) .text-sky-200 {
  color: #0369a1 !important;
}

html:not(.dark-theme) .text-indigo-400 {
  color: #4338ca !important;
}

html:not(.dark-theme) .text-amber-400,
html:not(.dark-theme) .text-amber-300,
html:not(.dark-theme) .text-amber-200 {
  color: #b45309 !important;
}

html:not(.dark-theme) .text-rose-400,
html:not(.dark-theme) .text-rose-300 {
  color: #be123c !important;
}

/* Soft Tinted Callout Banners in Daylight Mode */
html:not(.dark-theme) .from-teal-950\/60,
html:not(.dark-theme) .from-indigo-950\/60,
html:not(.dark-theme) .from-amber-950\/40 {
  background-image: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 55%, #ecfeff 100%) !important;
  border-color: #a5b4fc !important;
}

html:not(.dark-theme) .bg-teal-950\/30,
html:not(.dark-theme) .bg-teal-950\/40 {
  background-color: #f0fdfa !important;
  border-color: #5eead4 !important;
}

html:not(.dark-theme) .bg-emerald-500\/10,
html:not(.dark-theme) .bg-emerald-500\/15,
html:not(.dark-theme) .bg-emerald-500\/20 {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
}

html:not(.dark-theme) .bg-teal-500\/15,
html:not(.dark-theme) .bg-teal-500\/20 {
  background-color: #f0fdfa !important;
  border-color: #5eead4 !important;
}

html:not(.dark-theme) .bg-cyan-500\/15,
html:not(.dark-theme) .bg-cyan-500\/20,
html:not(.dark-theme) .bg-sky-500\/10,
html:not(.dark-theme) .bg-sky-500\/15 {
  background-color: #f0f9ff !important;
  border-color: #7dd3fc !important;
}

html:not(.dark-theme) .bg-amber-500\/10,
html:not(.dark-theme) .bg-amber-500\/20 {
  background-color: #fffbeb !important;
  border-color: #fcd34d !important;
}

html:not(.dark-theme) .bg-rose-500\/10,
html:not(.dark-theme) .bg-rose-500\/15,
html:not(.dark-theme) .bg-rose-500\/20,
html:not(.dark-theme) .bg-rose-500\/25 {
  background-color: #fff1f2 !important;
  border-color: #fda4af !important;
}

/* Code Viewer & Terminal Output in Daylight Mode */
html:not(.dark-theme) pre#workerCodeBlock,
html:not(.dark-theme) pre#archSourceCodeViewer,
html:not(.dark-theme) pre#sessionJsonPreview {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #1e293b !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
