/* ===========================================================================
   Pati by OVPRIDE — shared web design system.
   ASPIRE/expo.dev design language, lifted from Stride's own token system
   (archive/src/styles/tokens.css): light-default neutral canvas, flat panels
   drawn with hairline borders (no drop shadows outside things that truly
   float), compact controls, tight type, a restrained green accent (JHCSC
   green standing in for Stride's own — they're the same brand color).
   Toggle themes by setting data-theme="dark|light" on <html> (light default).

   This is a STATIC COPY of src/styles/theme.css for pages outside the Vite
   bundle (the deep-link landing page, the public legal pages) — keep the two
   in sync whenever the palette changes.
   =========================================================================== */

:root {
  /* ---- brand green (ported verbatim from the OVPRIDE landing page) ---- */
  --primary: #1B7A3D;
  --primary-dark: #13602F;
  --primary-light: #2E9E55;
  --accent: #2E9E55;

  /* ---- light palette ---- */
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --surface: #F8F9FA;
  /* Flat like Stride: the app canvas is the SAME white as the cards on it —
     hairline borders carry the separation, not a gray backdrop. */
  --canvas: #FFFFFF;

  --text: #11181C;
  --text-secondary: #687076;
  --text-muted: #889096;
  --on-primary: #FFFFFF;

  --border: #E6E8EB;
  --divider: #E6E8EB;
  --input-bg: #F8F9FA;

  --danger: #CD2B31;
  --online: #2B9A66;
  --warning: #946800;
  --info: #006ADC;

  /* expo.dev flatness: panels are bordered, not lifted. Shadows only for
     things that truly float (modals, drawers, popovers, toasts). */
  --shadow-sm: 0 0 #0000;
  --shadow-md: 0 0 0 1px var(--border), 0 8px 24px rgba(17, 24, 28, .12);
  --shadow-lg: 0 0 0 1px var(--border), 0 24px 64px rgba(17, 24, 28, .2);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 250px;
  --topbar-h: 56px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- ASPIRE-named aliases (same values, Stride's own variable names) ---- */
  --bg-subtle: var(--surface);
  --surface-hover: #F4F6F7;
  --surface-active: #E9EDEF;
  --nav-hover: #DDE3E6;
  --overlay: rgba(17, 24, 28, .45);

  --border-strong: #D7DBDF;
  --input-border: #A3ACB2;
  --border-hover: #8B959B;

  --text-2: var(--text-secondary);
  --text-3: var(--text-muted);

  --green: var(--primary);
  --green-bright: #46C98A;
  --green-deep: #1C7A40;
  --green-hover: var(--primary-dark);
  --green-text: #1C7A40;
  --green-bg: rgba(43, 154, 102, .12);
  --green-border: rgba(43, 154, 102, .4);
  --green-ring: rgba(43, 154, 102, .22);

  --blue: #006ADC;
  --blue-bg: rgba(0, 106, 220, .09);
  --blue-border: rgba(0, 106, 220, .32);

  --yellow: #946800;
  --yellow-bg: rgba(255, 178, 36, .16);
  --yellow-border: rgba(148, 104, 0, .35);

  --red: #CD2B31;
  --red-bg: rgba(205, 43, 49, .09);
  --red-border: rgba(205, 43, 49, .32);

  --purple: #793AAF;
  --purple-bg: rgba(121, 58, 175, .09);
  --purple-border: rgba(121, 58, 175, .3);

  --gray-bg: rgba(104, 112, 118, .1);
  --gray-border: rgba(104, 112, 118, .28);

  --shadow-pop: var(--shadow-md);
  --shadow-modal: var(--shadow-lg);
}

html[data-theme="dark"] {
  /* ---- dark palette (Stride's own dark values) ---- */
  --bg: #0B0D0E;
  --card: #131618;
  --surface: #0E1112;
  --canvas: #0B0D0E;

  --text: #EDEEF0;
  --text-secondary: #9BA1A6;
  --text-muted: #6C7478;
  --on-primary: #FFFFFF;

  --border: #22272A;
  --divider: #22272A;
  --input-bg: #0E1112;

  --danger: #F2555A;
  --online: #2B9A66;
  --warning: #FFB224;
  --info: #52A9FF;

  --shadow-sm: 0 0 #0000;
  --shadow-md: 0 0 0 1px var(--border), 0 12px 32px rgba(0, 0, 0, .55);
  --shadow-lg: 0 0 0 1px var(--border), 0 24px 64px rgba(0, 0, 0, .65);

  /* Green stays the SAME saturation in dark mode (Stride keeps its accent
     constant across themes); only the hover/text tints brighten to read
     against the near-black surface. */
  --green-hover: #46C98A;
  --green-text: #46C98A;
  --green-bg: rgba(43, 154, 102, .16);
  --green-border: rgba(43, 154, 102, .4);
  --green-ring: rgba(43, 154, 102, .32);
  --primary-dark: var(--green-hover);
  --primary-light: var(--green-bright);

  --surface-hover: #181C1E;
  --surface-active: #1D2224;
  --nav-hover: #23292C;
  --overlay: rgba(6, 8, 9, .72);

  --border-strong: #2E3437;
  --input-border: #363D41;
  --border-hover: #475055;

  --blue: #52A9FF;
  --blue-bg: rgba(82, 169, 255, .13);
  --blue-border: rgba(82, 169, 255, .35);

  --yellow: #FFB224;
  --yellow-bg: rgba(255, 178, 36, .12);
  --yellow-border: rgba(255, 178, 36, .32);

  --red: #F2555A;
  --red-bg: rgba(242, 85, 90, .13);
  --red-border: rgba(242, 85, 90, .35);

  --purple: #BF7AF0;
  --purple-bg: rgba(191, 122, 240, .13);
  --purple-border: rgba(191, 122, 240, .35);

  --gray-bg: rgba(155, 161, 166, .12);
  --gray-border: rgba(155, 161, 166, .3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always win, even over display rules. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .5rem .95rem;
  font: inherit;
  font-weight: 500;
  font-size: .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--input-bg); border-color: var(--divider); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); border-color: var(--danger); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ---------- form controls ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .4rem; }
.input, .textarea, select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:hover:not(:focus):not(:read-only), .textarea:hover:not(:focus):not(:read-only) { border-color: var(--border-hover); }
.input:focus, .textarea:focus, select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--green-border);
  box-shadow: 0 0 0 3px var(--green-ring);
}
.textarea { resize: vertical; min-height: 90px; }
.help { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.25rem; }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.badge-admin { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); }
.badge-mod { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue); }
.badge-danger { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.badge-muted { background: var(--input-bg); color: var(--text-muted); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-hover); }

/* ---------- avatar ---------- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--input-bg);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary); font-size: .82rem;
  flex-shrink: 0;
}

/* ---------- toast ----------
   Bottom-left like Facebook: out of the way of the floating video player
   (bottom right), dialog buttons (center), and the feed itself. */
.toast-wrap { position: fixed; bottom: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.toast {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  padding: .65rem 1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); font-size: .87rem; font-weight: 500;
  animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.1);
}
.toast.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.toast.success { border-color: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- switch (settings toggles) ---------- */
.switch {
  position: relative; width: 46px; height: 26px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--input-bg); cursor: pointer; padding: 0;
  transition: background .18s ease, border-color .18s ease;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted);
  transition: left .18s cubic-bezier(.2, .9, .3, 1.2), background .18s ease;
}
.switch.on { background: var(--primary); border-color: var(--primary); }
.switch.on .knob { left: 22px; background: #fff; }

/* ---------- utility ---------- */
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; align-items: center; gap: .6rem; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: .25rem; }

/* ---------- scrollbars (slim, rounded, theme-aware) ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 40%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-muted) 65%, transparent); }
::-webkit-scrollbar-corner { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
