/* ============================================
   base.css — Resets, variables, typography,
   and color palettes
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

:root {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-sidebar: #1e2330;
  --text-primary: #1f2430;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --accent: #4f6ef7;
  --accent-hover: #3a57e0;
  --accent-soft: #eef1fe;

  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --dot-done: #22c55e;
  --dot-missed: #ef4444;
  --dot-rest: #d1d5db;
  --dot-future: #374151;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  --sidebar-width: 260px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --transition: 0.2s ease;
}

/* ---- Global Utilities ---- */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   COLOR PALETTES (data-palette & data-theme)
   ============================================ */

/* ---- Light (Default) ---- */
html[data-palette="light"],
html[data-theme="light"] {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-sidebar: #1e2330;
  --text-primary: #1f2430;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #4f6ef7;
  --accent-hover: #3a57e0;
  --accent-soft: #eef1fe;
}

/* ---- Dark ---- */
html[data-palette="dark"],
html[data-theme="dark"] {
  --bg-primary: #12141a;
  --bg-secondary: #1e222b;
  --bg-sidebar: #0c0e13;
  --text-primary: #e5e8ef;
  --text-muted: #9096a3;
  --text-inverse: #ffffff;
  --border: #2a2f3a;
  --border-strong: #3a4150;
  --accent: #4f8cff;
  --accent-hover: #2f6fe0;
  --accent-soft: #1d2638;
}

/* ---- Solar ---- */
html[data-palette="solar"],
html[data-theme="solar"] {
  --bg-primary: #faf6f0;
  --bg-secondary: #ffffff;
  --bg-sidebar: #3a2f2a;
  --text-primary: #33292a;
  --text-muted: #8a7d70;
  --text-inverse: #ffffff;
  --border: #e8ded2;
  --border-strong: #d3c4b4;
  --accent: #e8753a;
  --accent-hover: #cc5e2c;
  --accent-soft: #fbeadf;
}

/* ---- Sepia ---- */
html[data-palette="sepia"],
html[data-theme="sepia"] {
  --bg-primary: #f1e6d5;
  --bg-secondary: #faf3e6;
  --bg-sidebar: #3d3325;
  --text-primary: #3d3226;
  --text-muted: #8c7c66;
  --text-inverse: #ffffff;
  --border: #e0d2ba;
  --border-strong: #c9b89c;
  --accent: #a16207;
  --accent-hover: #854d0e;
  --accent-soft: #eadcc7;
}
/* ---- Vibrant Sport Theme ---- */
html[data-palette="sport"],
html[data-theme="sport"] {
  --bg-primary: #0a0c10;
  --bg-secondary: #141824;
  --bg-sidebar: #07090e;
  --text-primary: #ffffff;
  --text-muted: #8b94a0;
  --text-inverse: #0a0c10;
  --border: #212838;
  --border-strong: #313d54;
  --accent: #ccff00;       /* High-energy lime/yellow sport accent */
  --accent-hover: #b3e000;
  --accent-soft: rgba(204, 255, 0, 0.12);
  --success: #00ff66;
  --danger: #ff3366;
  --warning: #ffaa00;
  --info: #00ccff;
}

/* ---- Neon Cyber-Teal (High-Tech Dashboard) ---- */
html[data-palette="cyberteal"],
html[data-theme="cyberteal"] {
  --bg-primary: #07090f;
  --bg-secondary: #0d121c;
  --bg-sidebar: #05070a;
  --text-primary: #f0fdf4;
  --text-muted: #8a9bb0;
  --text-inverse: #07090f;
  --border: #162235;
  --border-strong: #22344f;
  --accent: #06b6d4;       /* Cyber Teal / Cyan */
  --accent-hover: #0891b2;
  --accent-soft: rgba(6, 182, 212, 0.15);
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --info: #38bdf8;
}

/* Precise element styling matching your actual dashboard components */
html[data-palette="cyberteal"] .stat-card,
html[data-palette="cyberteal"] .plan-day,
html[data-palette="cyberteal"] .plan-period {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* Top accent border for stat cards to match your app's style */
html[data-palette="cyberteal"] .stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

html[data-palette="cyberteal"] .stat-card {
  position: relative;
  overflow: hidden;
}

/* Hover glow effect for cards */
html[data-palette="cyberteal"] .stat-card:hover,
html[data-palette="cyberteal"] .plan-day:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

/* ---- Cyber Mint Green (Exact Match to 3D Image) ---- */
html[data-palette="cyber_mint"],
html[data-theme="cyber_mint"] {
  --bg-primary: #070a0e;
  --bg-secondary: #0e131b;
  --bg-sidebar: #05070a;
  --text-primary: #e6f7f0;
  --text-muted: #7a8c9e;
  --text-inverse: #05070a;
  --border: #141f2d;
  --border-strong: #1e2f42;
  --accent: #00ff88;       /* Vibrant Electric Mint Green */
  --accent-hover: #00cc6a;
  --accent-soft: rgba(0, 255, 136, 0.15);
  --success: #00ff88;
  --danger: #ff3b5c;
  --warning: #ffb800;
  --info: #00e5ff;
}

/* Card Glows & Top Accents matching the photo */
html[data-palette="cyber_mint"] .stat-card,
html[data-palette="cyber_mint"] .plan-day,
html[data-palette="cyber_mint"] .plan-period {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
}

html[data-palette="cyber_mint"] .stat-card {
  position: relative;
  overflow: hidden;
}

html[data-palette="cyber_mint"] .stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

html[data-palette="cyber_mint"] .stat-card:hover,
html[data-palette="cyber_mint"] .plan-day:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.2) !important;
}
/* ============================================
   GLOBAL 3D CARD LAYERED DEPTH & HOVER TILT
   ============================================ */

.stat-card,
.plan-day,
.plan-period,
.admin-create-card,
.log-entry-card {
  position: relative;
  overflow: hidden;
  /* Dynamically blends secondary and primary theme backgrounds */
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary)) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.3),
    0 8px 10px -6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08) !important;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.3s ease, 
              border-color 0.3s ease;
  will-change: transform;
}

/* 3D "Lift & Glow" effect on hover using the active theme's accent */
.stat-card:hover,
.plan-day:hover,
.plan-period:hover,
.admin-create-card:hover,
.log-entry-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--accent) !important;
  box-shadow: 
    0 20px 35px -10px var(--accent-soft),
    0 12px 15px -5px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 0 var(--accent),
    0 0 20px var(--accent-soft) !important;
}

/* Dynamic top-border accent line for primary structured cards */
.stat-card::before,
.admin-create-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 3px var(--accent);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}