/* ================================================================
   SPDIGEST — Global Design System
   Dark theme, glassmorphism, premium sports aesthetic
   ================================================================ */

:root {
  /* Color Palette */
  --bg-void:       #080c14;
  --bg-base:       #0d1117;
  --bg-surface:    #131920;
  --bg-elevated:   #1a2230;
  --bg-hover:      #1e2940;

  --accent:        #f59e0b;       /* Amber — energy */
  --accent-dark:   #b45309;
  --accent-glow:   rgba(245, 158, 11, 0.15);
  --accent-glow2:  rgba(245, 158, 11, 0.35);

  --cyan:          #06b6d4;
  --cyan-glow:     rgba(6, 182, 212, 0.15);

  --red:           #ef4444;
  --red-glow:      rgba(239, 68, 68, 0.15);

  --green:         #10b981;
  --green-glow:    rgba(16, 185, 129, 0.15);

  --text-primary:  #f0f4f8;
  --text-secondary:#8b97a8;
  --text-muted:    #4b5563;

  --border:        rgba(255,255,255,0.06);
  --border-accent: rgba(245, 158, 11, 0.3);

  --glass-bg:      rgba(19, 25, 32, 0.8);
  --glass-border:  rgba(255,255,255,0.08);

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --font-sans:     'Inter', system-ui, sans-serif;
  --font-display:  'Space Grotesk', sans-serif;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.7);
  --shadow-accent: 0 0 30px rgba(245, 158, 11, 0.2);

  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h3 { font-size: 1.1rem; }

p { line-height: 1.6; color: var(--text-secondary); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #fbbf24;
  box-shadow: 0 0 20px rgba(245,158,11,0.4);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: var(--red-glow);
  border-color: var(--red);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; font-weight: 600; }

.btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.card:hover { border-color: var(--glass-border); }

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ── Form Elements ─────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 8px 12px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-green  { background: var(--green-glow);  color: var(--green); }
.badge-red    { background: var(--red-glow);    color: var(--red);  }
.badge-amber  { background: var(--accent-glow); color: var(--accent);}
.badge-cyan   { background: var(--cyan-glow);   color: var(--cyan); }

/* ── Toast Notification ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red);   }
.toast.info    { border-left: 3px solid var(--cyan);  }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ───────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.gap-6        { gap: 24px; }
.w-full       { width: 100%; }
.mt-1         { margin-top: 4px; }
.mt-2         { margin-top: 8px; }
.mt-4         { margin-top: 16px; }
.text-muted   { color: var(--text-secondary); }
.text-xs      { font-size: 0.75rem; }
.text-sm      { font-size: 0.875rem; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden       { display: none !important; }

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
