/* ============================================================
   PlayCaller Design System — Gridiron Gold v2
   Premium dark sports aesthetic — black + warm gold
   ============================================================ */

/* ─── CSS Variable Tokens ─────────────────────────────── */
:root {
  /* === SURFACE SYSTEM (4-tier depth) === */
  --surface-0:     #050505;     /* page background — deepest layer */
  --surface-1:     #0E0E0E;     /* card / panel backgrounds */
  --surface-2:     #161614;     /* panel headers, elevated (warm charcoal + olive undertone) */
  --surface-3:     #1E1D1A;     /* hover states, active nav, highest elevation */
  --surface-hover: #161614;     /* alias for hover states — same as surface-2 */

  /* === GOLD SYSTEM === */
  --gold:       #C9A84C;     /* primary accent, CTAs, active states */
  --gold-dim:   #8B7A3D;     /* secondary gold for subtle accents */
  --gold-glow:  rgba(201, 168, 76, 0.08); /* hover backgrounds, glows */
  --gold-faint: rgba(201, 168, 76, 0.12); /* very subtle background for active nav items */

  /* === TEXT HIERARCHY === */
  --text-primary:   #E8E2D6; /* warm off-white — NOT pure white */
  --text-secondary: #9A917F; /* muted warm tone */
  --text-muted:     #5C5647; /* tertiary / disabled */

  /* === STATUS COLORS === */
  --status-green: #4CAF50;   /* positive trends, winning */
  --status-red:   #F44336;   /* negative trends, losing, injuries */
  --status-amber: #FF9800;   /* warnings, questionable status */

  /* === TYPOGRAPHY (Google Fonts) === */
  --font-primary: 'Barlow', sans-serif;          /* body, labels, nav */
  --font-display: 'Bebas Neue', sans-serif;      /* headlines, metric values, large numbers */
  --font-serif:   'Cormorant Garamond', serif;   /* editorial subtitles, accent — italic */
  --font-mono:    'DM Mono', monospace;          /* stats, projections, small data */

  /* === SPACING & RADIUS === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* === BORDER STANDARD === */
  --border-card:   1px solid rgba(201, 168, 76, 0.06);
  --border-accent: 1px solid rgba(201, 168, 76, 0.25);

  /* === BACKWARD-COMPAT ALIASES (old token names → new values) === */
  /* Ensures existing components work without HTML changes */
  --gold-primary:     #C9A84C;
  --gold-deep:        #8B7A3D;
  --gold-muted:       #8B7A3D;
  --gold-highlight:   #D4A853;
  --bg-black:         #050505;
  --bg-navy:          #050505;
  --bg-surface:       #0E0E0E;
  --bg-elevated:      #161614;
  --border-gold:      rgba(201, 168, 76, 0.06);
  --border-gold-full: #C9A84C;
  --border-subtle:    rgba(201, 168, 76, 0.06);
  --success:          #4CAF50;
  --warning:          #FF9800;
  --error:            #F44336;
  --white:            #E8E2D6; /* warm off-white replaces pure white for text */
}

/* ─── Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ─── Default Transition ──────────────────────────────── */
a, button, .btn, .nav-link, .card, input, select, textarea {
  transition: all 0.2s ease;
}

/* ─── Noise Texture Overlay ───────────────────────────── */
/* Subtle grain — 4% opacity, adds depth without visible pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── Base Typography ─────────────────────────────────── */
body {
  font-family: var(--font-primary);
  font-weight: 400;
  background: var(--surface-0);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Display / Hero Headlines: Bebas Neue */
h1, .hero-title, .display-text, .metric-headline {
  font-family: var(--font-display);
  font-weight: 400; /* Bebas Neue is inherently bold */
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

/* UI / Interface: Barlow */
h2, h3, h4, h5, h6,
.card-title, .page-title, .section-label, .section-name,
.plan-name, .btn, .nav-link, .logo {
  font-family: var(--font-primary);
}

/* Serif accent: Cormorant Garamond — editorial italic */
.text-editorial, .subtitle-serif, blockquote {
  font-family: var(--font-serif);
  font-style: italic;
}

/* Monospace / Data: DM Mono */
.stat-number, .score-cell .number, .price-amount, .price-cents,
.metric-value, .founder-stat-val, .config-input, .data-mono,
code, pre {
  font-family: var(--font-mono);
}

/* ─── Animations ──────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* Shimmer: gold-tinted highlight sweeps left → right */
/* Apply via class="shimmer" on skeleton/loader/premium elements */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 168, 76, 0.12) 40%,
    rgba(201, 168, 76, 0.25) 50%,
    rgba(201, 168, 76, 0.12) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ─── Field Texture Background (legacy class) ────────── */
.field-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 120px,
      rgba(201, 168, 76, 0.015) 120px,
      rgba(201, 168, 76, 0.015) 121px
    ),
    linear-gradient(180deg, var(--surface-0) 0%, var(--surface-0) 100%);
}

/* ─── Logo Wordmark ───────────────────────────────────── */
.logo {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-primary);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo span { color: var(--gold); }
.logo::before { display: none; }
.logo-img {
  width: 38px; height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ─── Navigation ──────────────────────────────────────── */
nav, header {
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border-card);
  background: rgba(5, 5, 5, 0.92);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.nav-links, .header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--gold-glow);
}
.nav-link.active {
  color: var(--gold);
  background: var(--surface-3);
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

/* Primary CTA */
.btn-primary {
  background: var(--gold);
  color: #050505;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--gold-highlight);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary-large {
  font-size: 16px;
  padding: 16px 36px;
  border-radius: var(--radius-md);
}

/* Secondary / Ghost */
.btn-ghost, .btn-secondary, .btn-outline {
  color: var(--gold);
  background: transparent;
  border: var(--border-accent);
}
.btn-ghost:hover, .btn-secondary:hover, .btn-outline:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold-highlight);
}

/* Destructive */
.btn-danger {
  background: rgba(244, 67, 54, 0.08);
  color: #EF5350;
  border: 1px solid rgba(244, 67, 54, 0.2);
}
.btn-danger:hover {
  background: rgba(244, 67, 54, 0.16);
}

.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ─── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--gold-glow), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.card-title {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.card-featured, .feature-card {
  border-top: 3px solid var(--gold);
}

/* ─── Section Labels ──────────────────────────────────── */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ─── Page Layout ─────────────────────────────────────── */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
}
.page-title {
  font-family: var(--font-primary);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.page-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 40px;
}

/* ─── Forms ───────────────────────────────────────────── */
input, select, textarea, .form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(201, 168, 76, 0.03);
  border: var(--border-card);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}
input::placeholder, textarea::placeholder, .form-input::placeholder {
  color: var(--text-muted);
}
input:focus, select:focus, textarea:focus,
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
select option { background: var(--surface-2); }

label, .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error {
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.2);
  color: #EF5350;
}
.alert-success {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.2);
  color: var(--status-green);
}

/* ─── Toggle Switches ─────────────────────────────────── */
.toggle {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.slider, .toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(201, 168, 76, 0.1);
  border-radius: 26px;
  transition: background 0.2s;
}
.slider:before, .toggle-slider:before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform 0.2s;
}
input:checked + .slider,
input:checked + .toggle-slider { background: var(--gold); }
input:checked + .slider:before,
input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: var(--surface-0);
}

/* ─── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-active    { background: rgba(76, 175, 80, 0.12);   color: var(--status-green); }
.badge-trial     { background: rgba(201, 168, 76, 0.12);  color: var(--gold); }
.badge-free      { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.badge-cancelled { background: rgba(244, 67, 54, 0.08);   color: var(--status-red); }
.badge-founder   { background: rgba(201, 168, 76, 0.12);  color: var(--gold); }
.badge-owner     { background: rgba(201, 168, 76, 0.15);  color: var(--gold); border: var(--border-accent); }

/* ─── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(201, 168, 76, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Empty States ────────────────────────────────────── */
.empty-state, .empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}
.empty-state strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ─── Footer ──────────────────────────────────────────── */
footer {
  padding: 32px 40px;
  text-align: center;
  border-top: var(--border-card);
}
footer p, footer a {
  font-size: 13px;
  color: var(--text-muted);
}
footer a { text-decoration: none; }
footer a:hover { color: var(--gold); }

/* ─── Loading ─────────────────────────────────────────── */
.loading { color: var(--text-secondary); font-size: 14px; padding: 20px 0; }

/* ─── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-0); }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ─── Selection ───────────────────────────────────────── */
::selection {
  background: rgba(201, 168, 76, 0.25);
  color: var(--text-primary);
}

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  nav, header { padding: 0 20px; }
  main { padding: 32px 20px; }
  .btn { font-size: 13px; padding: 8px 16px; }
  .btn-primary-large { font-size: 15px; padding: 14px 28px; }
  .logo { font-size: 18px; letter-spacing: 0.2em; }
  .logo-img { width: 30px; height: 30px; }
  footer { padding: 24px 20px; }
}
