/* ============================================================
   S.K. Wellala — Ocean Blue theme (drop-in override)
   ------------------------------------------------------------
   Loads AFTER motion.css when possible:
     <link rel="stylesheet" href="motion.css">
     <link rel="stylesheet" href="theme.css">

   But it also wins if the load order is reversed, because every
   critical rule uses specificity boosters (`:root:root`,
   `html[data-theme]`) and/or `!important`. You don't have to
   touch the HTML to make this file work.

   WHAT THIS FILE COVERS:
     • All brand colours (buttons, tabs, links, logo, focus)
     • All backgrounds (page, cards, hero, modals)
     • Hero / signup / portal-banner / teacher-card gradients
     • Dark mode variants
     • Chart line colours — see note at the bottom, they need
       a 2-line edit in <script> to fully go blue.

   WHAT IT CANNOT COVER (needs small HTML/JS edits):
     • Chart.js dataset border/point colours (2 lines in <script>)
     • PWA <meta name="theme-color"> status-bar colour
   ============================================================ */


/* ---------- 1. LIGHT THEME VARIABLES ---------- */
/* :root:root = specificity (0,2,0) — beats base :root (0,1,0) */
:root:root {
  --bg:          #f0f6fb;
  --card:        #ffffff;
  --ink:         #0f2033;
  --muted:       #5a7189;
  --line:        #dae7f2;

  --brand:       #0369a1;
  --brand2:      #06b6d4;
  --brand-soft:  #e0f2fe;
  --brand-bg:    #e0f2fe;

  --shadow:      0 8px 28px rgba(3, 7, 30, .10);
}
/* --good, --bad, --warn and their -bg variants are NOT
   overridden — they are semantic (green = A grade / success,
   red = error, amber = warning). Green stays green there. */


/* ---------- 2. DARK THEME VARIABLES ---------- */
:root[data-theme="dark"] {
  --bg:          #0a1420;
  --card:        #122130;
  --ink:         #e6eef2;
  --muted:       #8fa9bd;
  --line:        #1e3a52;

  --brand:       #38bdf8;
  --brand2:      #67e8f9;
  --brand-soft:  #082f49;
  --brand-bg:    #082f49;

  --shadow:      0 8px 28px rgba(0, 0, 0, .50);
}

/* ---------- 3. HARDCODED GRADIENT OVERRIDES ---------- */
/* Base stylesheet has green hex values in these rules.
   !important ensures we win regardless of load order. */

/* Landing hero — desktop (also overrides the later
   "softer overlay" rule that has the same class name). */
.lp-hero-bg {
  background:
    linear-gradient(105deg, rgba(3,7,30,.80) 0%, rgba(3,7,30,.68) 62%, rgba(3,7,30,.02) 100%),
    radial-gradient(circle at 78% 28%, rgba(6,182,212,.30), transparent 55%),
    url('hero-photo.jpg') center/cover no-repeat,
    linear-gradient(135deg, #082f49, #075985 55%, #06b6d4) !important;
}

/* Landing hero — mobile (different crop focal point). */
@media (max-width: 760px) {
  .lp-hero-bg {
    background:
      linear-gradient(180deg, rgba(3,7,30,.40) 0%, rgba(3,7,30,.62) 55%, rgba(3,7,30,.82) 100%),
      url('hero-photo.jpg') 80% 22% / cover no-repeat,
      linear-gradient(135deg, #082f49, #075985 55%, #06b6d4) !important;
  }
}

/* Signup page — left photo panel. */
.side {
  background:
    linear-gradient(rgba(3,7,30,var(--tint-a)), rgba(3,7,30,var(--tint-b))),
    url('signup-photo.jpg') center/cover no-repeat,
    linear-gradient(135deg, #082f49, #06b6d4) !important;
}

/* Photo-hero variant (used by some route renderers). */
.hero.photo {
  background:
    linear-gradient(rgba(3,7,30,var(--tint-a)), rgba(3,7,30,var(--tint-b))),
    url('hero-photo.jpg') center/cover no-repeat,
    linear-gradient(135deg, #082f49, #06b6d4) !important;
}

/* Portal banner on landing page. */
.lp .portal-banner {
  background:
    linear-gradient(115deg, rgba(3,7,30,.62), rgba(3,7,30,.82)),
    linear-gradient(135deg, #082f49, #075985 55%, #06b6d4) !important;
}

/* Teacher photo card on landing page. */
.lp .teacher-photo {
  background:
    url('teacher-photo.jpg') center/cover no-repeat,
    linear-gradient(150deg, #082f49, #075985 60%, #06b6d4) !important;
}

/* Primary-solid button — the gradient auto-updates via
   var(--brand), but its green shadow was hardcoded. */
.lp .btn-primary-solid {
  box-shadow: 0 6px 18px rgba(3,105,161,.28) !important;
}

/* Portal mock progress bar — was gold→green,
   becomes gold→cyan to match the blue theme. */
.lp .mock-bar i {
  background: linear-gradient(90deg, #fde68a, #67e8f9) !important;
}


/* ---------- 4. SMALL POLISH ---------- */
::selection {
  background: rgba(201,162,74,.38);
}
/* ============================================================
   Lucide icons — sizing & alignment
   ============================================================ */
[data-lucide],
svg.lucide {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  vertical-align: -0.15em;
  display: inline-block;
  flex-shrink: 0;
}

/* Slightly smaller in tight button rows */
.btn-sm [data-lucide],
.btn-sm svg.lucide {
  width: 1em;
  height: 1em;
}

/* Coloured icons inherit colour from their text context */
.side-item [data-lucide],
.side-item svg.lucide {
  color: inherit;
}

/* Nav pill links */
.nav-link [data-lucide],
.nav-link svg.lucide {
  color: inherit;
}

/* Icon tiles — landing page feature icons, contact icons */
.lp .feat .fic svg.lucide,
.lp .c-item .ic svg.lucide,
.lp .tg-card .ic svg.lucide,
.lp .c-item svg.lucide {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand);
}
/* ============================================================
   Teacher dashboard — sidebar layout
   ============================================================ */

.dash-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 8px;
}

.sidebar {
  position: sticky;
  top: 80px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.side-group {
  margin-bottom: 10px;
}
.side-group:last-child { margin-bottom: 0; }

.side-label {
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  padding: 8px 12px 6px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 8px);
  padding: 9px 12px;
  margin: 1px 4px;
  border: none;
  border-left: 3px solid transparent;
  background: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.side-item:hover {
  background: var(--bg);
  color: var(--ink);
}
.side-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-left-color: var(--brand);
}

.side-item svg.lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

.side-item .side-badge {
  margin-left: auto;
  background: var(--bad);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}
/* ============================================================
   Teacher dashboard — desktop big / collapsible sidebar
   (PC only: nothing here applies at 900px and below)
   ============================================================ */
.side-top { display: none; }

@media (min-width: 901px) {

  /* ---------- layout: content shifts right of the fixed sidebar ---------- */
  body.has-side main#app {
    max-width: 1400px;
    margin-left: 264px;
    margin-right: auto;
    padding: 24px 28px 80px;
    transition: margin-left .25s ease;
  }
  body.has-side .site-foot { margin-left: 264px; transition: margin-left .25s ease; }
  body.has-side.side-collapsed main#app,
  body.has-side.side-collapsed .site-foot { margin-left: 84px; }

  /* header becomes a top bar beside the sidebar */
  body.has-side > header {
    padding-left: 284px !important;
    transition: padding-left .25s ease;
  }
  body.has-side.side-collapsed > header { padding-left: 104px !important; }
  body.has-side > header .logo { display: none; }
  body.has-side #loading { z-index: 200; }

  body.has-side .dash-layout { display: block; margin-top: 8px; }

  /* ---------- the sidebar itself ---------- */
  body.has-side .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 264px;
    height: 100vh;
    max-height: none;
    padding: 0 12px 20px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 120;
    transition: width .25s ease;
  }

  /* logo + collapse button row */
  body.has-side .side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 66px;
    padding: 0 6px;
    margin: 0 -12px 8px;
    padding-left: 18px; padding-right: 18px;
    position: sticky; top: 0; z-index: 2;
    background: var(--card);
  }
  body.has-side .side-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  body.has-side .side-logo {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
  }
  body.has-side .side-brand b { font-size: 1.1rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
  body.has-side .side-collapse {
    width: 36px; height: 36px; flex: none; padding: 0;
    display: grid; place-items: center;
    background: none; border: none; border-radius: 50%;
    color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
  }
  body.has-side .side-collapse:hover { background: var(--brand-soft); color: var(--brand); }
  body.has-side .side-collapse svg { width: 22px; height: 22px; }

  /* bigger nav */
  body.has-side .side-label {
    font-size: .72rem;
    padding: 16px 12px 8px;
    white-space: nowrap;
  }
  body.has-side .side-item {
    position: relative;
    width: 100%;
    margin: 2px 0;
    padding: 12px 14px;
    gap: 14px;
    font-size: .95rem;
    border-radius: 10px;
    white-space: nowrap;
  }
  body.has-side .side-item svg.lucide { width: 20px; height: 20px; }

  /* ---------- collapsed (icon-only) ---------- */
  body.has-side.side-collapsed .sidebar { width: 76px; }
  body.has-side.side-collapsed .side-top { justify-content: center; padding-left: 0; padding-right: 0; }
  body.has-side.side-collapsed .side-brand { display: none; }
  body.has-side.side-collapsed .side-label { font-size: 0; padding: 8px 0; border-top: 1px solid var(--line); margin: 6px 6px 0; }
  body.has-side.side-collapsed .side-group:first-of-type .side-label { border-top: none; }
  body.has-side.side-collapsed .side-item {
    font-size: 0;               /* hides the text, keeps the icon */
    justify-content: center;
    padding: 13px 0;
    gap: 0;
  }
  body.has-side.side-collapsed .side-item .side-badge {
    position: absolute; top: 4px; right: 8px; margin: 0; font-size: .62rem;
  }
}
/* clicks always hit the button, never the icon inside it */
button [data-lucide], button svg.lucide,
a [data-lucide], a svg.lucide,
.side-item *, .tabs button * { pointer-events: none; }
.lp-hero-bg::after, .lp-hero-bg::before { display: none; }
.dash-overlay { cursor: pointer; }
/* anything added AFTER the marks table (e.g. "See more") stays below it */
#mkArea > .tbl-wrap ~ * { order: 3; }
