/* ── CoachCarter Learner Shared Styles ────────────────────────────────────── */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* CSS Variables */
:root {
  /* Brand colours (overridden by branding.js if school branding is set) */
  --brand-primary: #f97316;
  --brand-secondary: #1e3a5f;
  --brand-accent: #3b82f6;

  --primary:    #262626;
  --accent:     #f58321;
  --accent-dk:  #e07518;
  --accent-lt:  #fff4ec;
  --accent-mid: rgba(245,131,33,0.12);
  --accent-glow: rgba(245,131,33,0.25);
  --muted:      #797879;
  --border:     #e0e0e0;
  --bg:         #ffffff;
  --surface:    #f9f9f9;
  --white:      #ffffff;
  --green:      #22c55e;
  --green-lt:   #f0fdf4;
  --amber:      #f59e0b;
  --red:        #ef4444;
  --red-lt:     #fef2f2;
  --blue:       #3b82f6;
  --blue-lt:    #eff6ff;
  --font-head:  'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body:  'Lato', system-ui, -apple-system, sans-serif;
  --radius:     14px;
}

/* Base */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--primary);
  min-height: 100vh;
  overscroll-behavior: none;
}

/* Utility */
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Site Nav ──────────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(38, 38, 38, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-nav-logo img {
  width: 34px; height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  padding: 4px;
}
.site-nav-logo span {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.site-nav-logo span em { font-style: normal; color: var(--brand-primary, var(--accent)); }
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav-link {
  color: rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.83rem;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}
.site-nav-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
}
.site-nav-link.logout {
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.1);
}
.site-nav-link.logout:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
}
.site-nav-link.primary {
  background: var(--brand-primary, var(--accent));
  color: #fff;
  border-color: var(--brand-primary, var(--accent));
  font-weight: 600;
}
.site-nav-link.primary:hover {
  background: var(--accent-dk);
  border-color: var(--accent-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,131,33,0.35);
}
.nav-menu-toggle {
  background: none; border: none; cursor: pointer;
  color: #fff; padding: 8px; display: flex; align-items: center;
}
.nav-dropdown {
  display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: rgba(38,38,38,0.96); backdrop-filter: blur(20px);
  padding: 12px 24px 16px; flex-direction: column; gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  border-radius: 10px; color: #fff; text-decoration: none; font-size: 0.9rem;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: rgba(255,255,255,0.08); }
.nav-dropdown .divider { height: 1px; background: rgba(255,255,255,0.1); margin: 6px 0; }
@media (max-width: 600px) {
  .site-nav { padding: 0 16px; }
  .site-nav-name { display: none; }
  .site-nav-link:not(.primary):not(.back) { display: none; }
}

/* ── Dark Mode ────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --primary:    #e8e8e8;
    --accent:     #f58321;
    --accent-dk:  #e07518;
    --accent-lt:  #2e2014;
    --accent-mid: rgba(245,131,33,0.18);
    --accent-glow: rgba(245,131,33,0.30);
    --muted:      #9e9e9e;
    --border:     #3a3a3a;
    --bg:         #1a1a1a;
    --surface:    #242424;
    --white:      #2e2e2e;
    --green:      #4ade80;
    --green-lt:   #14261a;
    --amber:      #fbbf24;
    --red:        #f87171;
    --red-lt:     #2a1515;
    --blue:       #60a5fa;
    --blue-lt:    #1a2332;
    color-scheme: dark;
  }
}
:root.dark-mode {
  --primary:    #e8e8e8;
  --accent:     #f58321;
  --accent-dk:  #e07518;
  --accent-lt:  #2e2014;
  --accent-mid: rgba(245,131,33,0.18);
  --accent-glow: rgba(245,131,33,0.30);
  --muted:      #9e9e9e;
  --border:     #3a3a3a;
  --bg:         #1a1a1a;
  --surface:    #242424;
  --white:      #2e2e2e;
  --green:      #4ade80;
  --green-lt:   #14261a;
  --amber:      #fbbf24;
  --red:        #f87171;
  --red-lt:     #2a1515;
  --blue:       #60a5fa;
  --blue-lt:    #1a2332;
  color-scheme: dark;
}

/* Dark mode overrides for elements that use hardcoded colours */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .site-nav { background: rgba(26,26,26,0.95); }
  :root:not(.light-mode) img { opacity: 0.92; }
}
:root.dark-mode .site-nav { background: rgba(26,26,26,0.95); }
:root.dark-mode img { opacity: 0.92; }

/* ── Skeleton / Shimmer Loading States ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface, #f0f0f0) 25%, var(--border, #e8e8e8) 37%, var(--surface, #f0f0f0) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * { visibility: hidden; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-text { height: 1em; border-radius: 4px; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-full { width: 100%; }
.skeleton-card {
  height: 80px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.skeleton-stat {
  height: 72px;
  border-radius: 12px;
}
.skeleton-pill {
  height: 36px;
  width: 140px;
  border-radius: 100px;
  display: inline-block;
}
.skeleton-hero {
  height: 140px;
  border-radius: 16px;
}
