/* ─────────────────────────────────────────────────────────────
   Theme variants for portal.zeloric.io.
   The default (Cream) lives in :root of portal.css / admin.css.
   These blocks override the same tokens for White and Dark.
   Every rule in the app reads var(--…), so the whole UI re-skins.
   ───────────────────────────────────────────────────────────── */

:root[data-theme="white"] {
  --bg:             #F6F7F9;
  --bg2:            #ECEEF1;
  --surface:        #FFFFFF;
  --cream:          #FFFFFF;
  --sidebar-bg:     #FFFFFF;
  --sidebar-border: #E8EAED;
  --txt:            #1A1C2E;
  --txt2:           #565A6E;
  --txt3:           #9296A5;
  --border:         #ECEEF1;
  --border2:        #DDE0E6;
  --shadow-sm:      0 1px 3px rgba(15,23,42,.05), 0 1px 2px rgba(15,23,42,.03);
  --shadow:         0 6px 16px -4px rgba(15,23,42,.08), 0 2px 6px -2px rgba(15,23,42,.05);
  --shadow-lg:      0 18px 40px -12px rgba(15,23,42,.14), 0 6px 14px -6px rgba(15,23,42,.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:             #0E1017;
  --bg2:            #14161F;
  --surface:        #1A1D27;
  --cream:          #1A1D27;
  --sidebar-bg:     #14161F;
  --sidebar-border: rgba(255,255,255,.08);
  --blue-l:         rgba(244,166,43,.16);
  --txt:            #E6E8EE;
  --txt2:           #A2A6B4;
  --txt3:           #6D7180;
  --border:         rgba(255,255,255,.08);
  --border2:        rgba(255,255,255,.14);
  /* Status badges: light-bg/dark-text pairs → dark-tint/light-text for readability */
  --green-l:        rgba(5,150,105,.18);
  --green-txt:      #6EE7B7;
  --amber-l:        rgba(217,119,6,.20);
  --amber-txt:      #FCD34D;
  --red-l:          rgba(220,38,38,.18);
  --red-txt:        #FCA5A5;
  --cyan-l:         rgba(2,132,199,.22);
  --purple-l:       rgba(244,166,43,.16);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.40);
  --shadow:         0 6px 16px -4px rgba(0,0,0,.45);
  --shadow-lg:      0 18px 40px -12px rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ─────────────────────────────────────────────────────────────
   BLUE — default theme, derived from the Zeloric logo brand blue.
   Self-contained: overrides tokens only; the Cream/White/Dark
   blocks above are untouched. Blue is the default.
   ───────────────────────────────────────────────────────────── */
:root[data-theme="blue"] {
  --bg:             #FFFFFF;   /* page */
  --bg2:            #EEF4FD;   /* subtle light-blue fill */
  --surface:        #FFFFFF;   /* cards */
  --cream:          #EEF4FD;   /* light-blue content surface */
  --sidebar-bg:     #FFFFFF;
  --sidebar-border: #E6EDF5;
  /* Brand accent (var name --blue kept as the accent alias) → from the logo mark;
     primary action stays white-safe (contrast 5.98:1). */
  --blue:           #0A5FCB;
  --blue-dark:      #0847A0;
  --blue-l:         #E8F1FD;   /* light-blue tint — cards, active nav/tabs, chips */
  --blue-mid:       #3E86E0;
  --txt:            #14233D;
  --txt2:           #52607A;
  --txt3:           #8792A8;
  --border:         #E6EDF5;
  --border2:        #D5E0EF;
  --grad:           linear-gradient(135deg, #0A5FCB, #3E86E0);
  --shadow-sm:      0 1px 2px rgba(10,40,110,.04);
  --shadow:         0 1px 2px rgba(10,40,110,.04), 0 6px 16px -8px rgba(10,40,110,.10);
  --shadow-lg:      0 12px 30px -12px rgba(10,40,110,.16);
  color-scheme: light;
  /* Semantic (green/red/amber/cyan) inherit from :root — status stays meaningful. */
}

/* Blue-theme component polish — scoped to [data-theme="blue"] so the
   Cream/White/Dark themes are untouched. Overrides the base warm/peach accents. */
:root[data-theme="blue"] body {
  background:
    radial-gradient(1100px 560px at 100% -8%, #DDE9FB 0%, transparent 55%),
    radial-gradient(900px 520px at -8% 108%, #E6EFFC 0%, transparent 52%),
    var(--bg);
}
:root[data-theme="blue"] .welcome-card {
  background: linear-gradient(135deg, #E9F1FD 0%, #D5E4F9 100%) !important;
}
:root[data-theme="blue"] .btn-primary {
  color: #fff;
  box-shadow: 0 2px 8px rgba(10,95,203,0.28);
}
:root[data-theme="blue"] .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(10,95,203,0.34);
}

/* ── Floating theme-cycle button (bottom-right, all pages) ── */
#theme-cycle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface);
  color: var(--txt);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color .18s ease, transform .18s ease;
}
#theme-cycle:hover { border-color: var(--blue); transform: translateY(-1px); }
#theme-cycle .dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--border2);
  background: conic-gradient(var(--txt) 0 50%, var(--surface) 50% 100%);
}
