/* ═══════════════════════════════════════════════════════════════
   SolarMatch warm theme v2. Load AFTER style.css.
   1) Sunlight beam from the top-left corner to the bottom-right
   2) Directional light on cards (3D feel)
   3) Buttons: their normal shape and colour, the fill 85% opaque, no borders or effects
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sm-amber: 251, 133, 0;
  --bg-body: transparent;
}

/* Light-only rules are scoped to html:not([data-theme="dark"]); the dark theme is at the end of this file. */

/* ── 1. LIGHT BEAM: moving from the top-left corner to the bottom-right ── */
html:not([data-theme="dark"]) {
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(255,200,70,0.60) 0%, rgba(255,200,70,0) 70%),
    radial-gradient(ellipse 60% 55% at 100% 100%, rgba(255,214,110,0.50) 0%, rgba(255,214,110,0) 70%),
    linear-gradient(135deg, #FFEFB8 0%, #FFF7D9 45%, #FFF3CC 75%, #FFE9AE 100%) fixed !important;
  min-height: 100%;
}
body { background: transparent !important; }
html { min-height: 100%; }

/* soft beams of light that travel diagonally, deep orange fading to pale yellow */
body::before, body::after { content: ""; position: fixed; z-index: -2; pointer-events: none; }
html:not([data-theme="dark"]) body::before {
  content: "";
  position: fixed;
  top: -100vh; left: -100vw;
  width: 300vw; height: 300vh;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(255,255,255,0) 38%,
    rgba(255,138,0,0.20) 42%,
    rgba(255,190,70,0.24) 45%,
    rgba(255,236,150,0.20) 48%,
    rgba(255,248,205,0.12) 51%,
    rgba(255,255,255,0) 55%,
    rgba(255,255,255,0) 58%,
    rgba(255,150,20,0.12) 61%,
    rgba(255,226,140,0.14) 64%,
    rgba(255,250,215,0.08) 67%,
    rgba(255,255,255,0) 70%);
  filter: blur(26px);
  animation: smBeamTravel 16s linear infinite;
}
/* the warm source glowing softly in the top-left corner */
html:not([data-theme="dark"]) body::after {
  content: "";
  position: fixed;
  top: -16vmax; left: -16vmax;
  width: 38vmax; height: 38vmax;
  z-index: -2;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,150,30,0.45) 0%, rgba(255,190,80,0.28) 30%, rgba(255,230,150,0.12) 52%, rgba(255,230,150,0) 70%);
  animation: smSun 7s ease-in-out infinite alternate;
}
@keyframes smBeamTravel {
  0%   { transform: translate(-33%, -33%); }
  100% { transform: translate(33%, 33%); }
}
@keyframes smSun { 0% { transform: scale(0.95); opacity: 0.8; } 100% { transform: scale(1.05); opacity: 1; } }

/* ── 2. DIRECTIONAL LIGHT ON CARDS ───────────────────────────── */
html:not([data-theme="dark"]) .card, html:not([data-theme="dark"]) .calc-section-card, html:not([data-theme="dark"]) .summary-card, html:not([data-theme="dark"]) .metric-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.82) 0%, rgba(255,250,240,0.62) 55%, rgba(255,240,215,0.55) 100%) !important;
  border: 1px solid rgba(255,255,255,0.85) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.95),          /* lit top-left edge */
    inset -1px -1px 0 rgba(var(--sm-amber), 0.10),   /* shaded bottom-right edge */
    14px 18px 40px -12px rgba(170, 90, 10, 0.22),     /* shadow falls away from the light */
    2px 3px 8px rgba(170, 90, 10, 0.06) !important;
}

/* particle dots and floating shapes sit ABOVE the light, so they stay clear */
#bg-particle-canvas { z-index: -1 !important; opacity: 1 !important; }
.floating-bg-elements { z-index: -1 !important; }

/* ── 3. ROUND EVERYTHING ─────────────────────────────────────── */
.navbar {
  top: 12px !important;
  margin: 12px auto 0;
  width: calc(100% - 32px);
  max-width: 1320px;
  border-radius: 28px;
}
html:not([data-theme="dark"]) .navbar {
  border: 1px solid rgba(255,255,255,0.7) !important;
  background: rgba(255,250,240,0.55) !important;
  box-shadow: 0 10px 30px -12px rgba(200,110,10,0.30), inset 0 1px 0 rgba(255,255,255,0.9);
}
input, select, textarea, .form-control { border-radius: 16px !important; }
img { border-radius: 20px; }
.navbar img, .logo img { border-radius: 0; }
table { border-radius: 16px; overflow: hidden; }

/* ── 4. BUTTONS: their normal shape and colour, the fill 85% opaque (text stays solid) ───
   No borders, no glow, no movement. Text never wraps; a button never shrinks below its text.
   Theme toggle, Reset My Data and Sign out keep their old look (further down). */
.btn, .chat-input-area button#chat-send,
.nav-actions button:not(.theme-toggle):not(.profile-btn):not(.logout-btn):not(.profile-menu-item),
.nav-actions a:not(.reset-data-btn):not(.logout-btn) {
  border: none !important;
  border-radius: 999px !important;
  color: #2A1800 !important;
  background: rgba(255, 183, 3, 0.85) !important;
  box-shadow: 0 4px 12px -4px rgba(200, 110, 0, 0.30) !important;
}
.btn:hover, .chat-input-area button#chat-send:hover,
.nav-actions button:not(.theme-toggle):not(.profile-btn):not(.logout-btn):not(.profile-menu-item):hover,
.nav-actions a:not(.reset-data-btn):not(.logout-btn):hover {
  color: #2A1800 !important;
  background: rgba(251, 133, 0, 0.85) !important;
}
.btn-secondary, .btn-outline {
  background: rgba(255, 236, 170, 0.85) !important;
}
.btn-secondary:hover, .btn-outline:hover {
  background: rgba(255, 214, 102, 0.85) !important;
}
/* no movement or glow on hover or press */
.btn, .btn:hover, .btn:active, .chat-input-area button#chat-send:hover {
  transform: none !important;
}
/* one line, never squeezed below the text */
.btn, .nav-actions a, .nav-actions button, .logout-btn, .reset-data-btn {
  white-space: nowrap !important;
  min-width: max-content;   /* may shrink, but never below its own text */
}
.navbar .nav-actions > * { flex-shrink: 0; }
.btn { max-width: 100%; }

/* Theme toggle: old look (round, light glass) */
.theme-toggle {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--color-secondary) !important;
  border: var(--border-glass) !important;
  box-shadow: none !important;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.4) !important; }
[data-theme="dark"] .theme-toggle { background: rgba(0, 0, 0, 0.2) !important; color: var(--color-primary) !important; }

/* Reset My Data: old look, red */
.reset-data-btn, .btn.reset-data-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem !important;
  font-size: 0.85rem; font-weight: 800;
  border-radius: 12px !important;
  color: #DC2626 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border: 2px solid rgba(239, 68, 68, 0.3) !important;
  box-shadow: none !important;
}
.reset-data-btn:hover, .btn.reset-data-btn:hover {
  color: #B91C1C !important;
  background: rgba(239, 68, 68, 0.16) !important;
}

/* Sign out: old look (outlined, rounded corners) */
.logout-btn:not(.mobile-nav-item), .profile-menu .logout-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem !important;
  font-size: 0.85rem; font-weight: 800;
  border-radius: 12px !important;
  color: var(--color-secondary) !important;
  background: transparent !important;
  border: 2px solid var(--color-secondary) !important;
  box-shadow: none !important;
  cursor: pointer;
}
.logout-btn:not(.mobile-nav-item):hover { background: rgba(2, 48, 71, 0.06) !important; }
[data-theme="dark"] .logout-btn:not(.mobile-nav-item) { color: #F8FAFC !important; border-color: rgba(248, 250, 252, 0.8) !important; }
[data-theme="dark"] .logout-btn:not(.mobile-nav-item):hover { background: rgba(255, 255, 255, 0.08) !important; }

.btn:focus-visible { outline: 3px solid #FB8500; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   DARK THEME (html[data-theme="dark"]): warm brown/charcoal night,
   soft amber glows, cream text, amber buttons with dark text.
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  --bg-body: transparent;
  --bg-surface: rgba(42, 28, 12, 0.78);
  --bg-input: rgba(26, 18, 8, 0.85);
  --text-main: #FFF3D6;
  --text-muted: #D9C4A0;
  --color-secondary: #FFF3D6;
  --color-primary: #FFB703;
  --color-primary-dark: #FB8500;
  --border-glass: 1px solid rgba(255, 214, 140, 0.14);
  --border-light: 1px solid rgba(255, 214, 140, 0.10);
  --inner-glow: inset 0 0 0 1px rgba(255, 214, 140, 0.06);
  color-scheme: dark;
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(251,133,0,0.22) 0%, rgba(251,133,0,0) 70%),
    radial-gradient(ellipse 60% 55% at 100% 100%, rgba(255,183,3,0.14) 0%, rgba(255,183,3,0) 70%),
    linear-gradient(135deg, #1A1208 0%, #22170A 50%, #2A1C0C 100%) fixed !important;
}
html[data-theme="dark"] body { color: #FFF3D6; }
/* beams and sun stay, but dimmer */
html[data-theme="dark"] body::before {
  top: -100vh; left: -100vw; width: 300vw; height: 300vh;
  background: linear-gradient(135deg,
    rgba(0,0,0,0) 40%, rgba(251,133,0,0.07) 44%, rgba(255,183,3,0.08) 47%,
    rgba(0,0,0,0) 52%, rgba(255,150,20,0.05) 60%, rgba(0,0,0,0) 66%);
  filter: blur(30px);
  animation: smBeamTravel 16s linear infinite;
}
html[data-theme="dark"] body::after {
  top: -16vmax; left: -16vmax; width: 38vmax; height: 38vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(251,133,0,0.22) 0%, rgba(255,183,3,0.10) 35%, rgba(255,183,3,0) 70%);
  animation: smSun 7s ease-in-out infinite alternate;
}

/* text */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] label,
html[data-theme="dark"] .section-title, html[data-theme="dark"] .logo { color: #FFF3D6; }
html[data-theme="dark"] p, html[data-theme="dark"] li, html[data-theme="dark"] small,
html[data-theme="dark"] .section-subtitle, html[data-theme="dark"] .text-muted { color: #E8D6B4; }
html[data-theme="dark"] a:not(.btn) { color: #FFD27A; }
html[data-theme="dark"] .nav-links a { color: #E8D6B4; }
html[data-theme="dark"] .nav-links a:hover, html[data-theme="dark"] .nav-links a.active { color: #FFB703; }

/* navbar glass with a dark tint */
html[data-theme="dark"] .navbar {
  background: rgba(34, 23, 10, 0.72) !important;
  border: 1px solid rgba(255, 214, 140, 0.16) !important;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255, 214, 140, 0.08);
}

/* cards, panels and any white surface */
html[data-theme="dark"] .card, html[data-theme="dark"] .calc-section-card,
html[data-theme="dark"] .summary-card, html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .dashboard-panel, html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .showcase-card, html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .advisor-dashboard, html[data-theme="dark"] .qa-dashboard,
html[data-theme="dark"] .journey-ai-panel, html[data-theme="dark"] .journey-roadmap-panel {
  background: linear-gradient(145deg, rgba(48,32,14,0.88) 0%, rgba(36,24,10,0.85) 100%) !important;
  border: 1px solid rgba(255, 214, 140, 0.12) !important;
  box-shadow: inset 1px 1px 0 rgba(255,214,140,0.08), 14px 18px 40px -14px rgba(0,0,0,0.65) !important;
  color: #FFF3D6;
}
html[data-theme="dark"] .advisor-header, html[data-theme="dark"] .chat-input-area,
html[data-theme="dark"] .chat-messages {
  background: rgba(30, 20, 9, 0.7) !important;
  border-color: rgba(255, 214, 140, 0.10) !important;
}

/* inputs and tables */
html[data-theme="dark"] input, html[data-theme="dark"] select,
html[data-theme="dark"] textarea, html[data-theme="dark"] .form-control {
  background: #1A1208 !important;
  color: #FFF3D6 !important;
  border: 1px solid rgba(255, 214, 140, 0.25) !important;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #A8926E; }
html[data-theme="dark"] select option { background: #1A1208; color: #FFF3D6; }
html[data-theme="dark"] table { background: rgba(30, 20, 9, 0.8); color: #FFF3D6; }
html[data-theme="dark"] th { background: rgba(251, 133, 0, 0.16); color: #FFF3D6; }
html[data-theme="dark"] td { border-color: rgba(255, 214, 140, 0.10); }

/* chat bubbles */
html[data-theme="dark"] .message.bot .message-bubble {
  background: rgba(58, 40, 18, 0.95) !important; color: #FFF3D6 !important;
  border: 1px solid rgba(255, 214, 140, 0.12) !important;
}
html[data-theme="dark"] .message.user .message-bubble {
  background: rgba(255, 183, 3, 0.9) !important; color: #2A1800 !important;
}
html[data-theme="dark"] .message-bubble p, html[data-theme="dark"] .message-bubble li { color: inherit; }

/* buttons: amber with dark text (same as light) */
html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-outline { background: rgba(255, 214, 102, 0.85) !important; color: #2A1800 !important; }
html[data-theme="dark"] .reset-data-btn { color: #FCA5A5 !important; background: rgba(239, 68, 68, 0.14) !important; border-color: rgba(252, 165, 165, 0.45) !important; }
html[data-theme="dark"] .theme-toggle { background: rgba(255, 214, 140, 0.10) !important; color: #FFB703 !important; }

/* profile menu, mobile bar, roadmap */
html[data-theme="dark"] .profile-menu { background: #2A1C0C; box-shadow: 0 18px 40px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,214,140,0.12); }
html[data-theme="dark"] .profile-full, html[data-theme="dark"] .profile-btn { color: #FFF3D6; }
html[data-theme="dark"] .profile-email { color: #CDB68E; }
html[data-theme="dark"] .mobile-bottom-nav { background: rgba(30, 20, 9, 0.92) !important; border-top-color: rgba(255,214,140,0.14) !important; }
html[data-theme="dark"] .mobile-nav-item { color: #D9C4A0; }
html[data-theme="dark"] .mobile-nav-item.active { color: #FFB703; }
html[data-theme="dark"] .roadmap-step.active { background: rgba(255, 183, 3, 0.12); }
html[data-theme="dark"] .step-label, html[data-theme="dark"] .step-label strong { color: #FFF3D6; }

/* Leaflet map: darker tiles, readable controls */
html[data-theme="dark"] .leaflet-tile-pane { filter: brightness(0.75) saturate(0.85) sepia(0.15); }
html[data-theme="dark"] .leaflet-control-zoom a, html[data-theme="dark"] .leaflet-bar a { background: #2A1C0C; color: #FFF3D6; border-color: rgba(255,214,140,0.2); }
html[data-theme="dark"] .leaflet-control-attribution { background: rgba(26,18,8,0.8) !important; color: #CDB68E; }
html[data-theme="dark"] .leaflet-control-attribution a { color: #FFD27A; }
/* leftovers found by the dark-mode check */
html[data-theme="dark"] footer { background: #120C05 !important; color: #E8D6B4; border-top: 1px solid rgba(255,214,140,0.12); }
html[data-theme="dark"] [style*="FFFBEB"], html[data-theme="dark"] [style*="fffbeb"] { background: rgba(255, 183, 3, 0.10) !important; }
html[data-theme="dark"] .input-hint, html[data-theme="dark"] .tip-box, html[data-theme="dark"] .info-box { background: rgba(255, 214, 140, 0.06) !important; color: #E8D6B4 !important; }
html[data-theme="dark"] .leaflet-container { background: #1A1208 !important; }
