/* ==========================================================================
   🏀 BASKETBALL HUB — High-End Athletic Design System
   Architecture: Obsidian Dark + Athletic Flame Accent
   Typography: Oswald (Display / Scores) + Inter (Interface / Data)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

:root {
  /* Color Architecture */
  --bg-base: #080a0f;
  --bg-surface: #0e121a;
  --bg-surface-elevated: #151b26;
  --bg-surface-hover: #1c2433;
  --bg-input: #0b0e14;
  
  --accent-primary: #ff5722;
  --accent-hover: #ff7043;
  --accent-subtle: rgba(255, 87, 34, 0.12);
  --accent-glow: rgba(255, 87, 34, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-disabled: #475569;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(255, 87, 34, 0.4);
  
  --status-live: #ef4444;
  --status-scheduled: #38bdf8;
  --status-finished: #10b981;
  --status-canceled: #64748b;
  
  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-card-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-medium);
  --shadow-accent: 0 8px 24px -4px var(--accent-glow);
  
  /* Typography */
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 87, 34, 0.08), transparent 70%),
    linear-gradient(180deg, var(--bg-base) 0%, #06070a 100%);
  background-attachment: fixed;
  padding-bottom: 60px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: 64px;
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.brand-text span {
  color: var(--accent-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Pill & Status */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

.user-role-badge {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid rgba(255, 87, 34, 0.3);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-normal);
  line-height: 1;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* ==========================================================================
   Hero Stage (High Impact Editorial Layout)
   ========================================================================== */
.hero-stage {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-stage::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 100% 0%, rgba(255, 87, 34, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-editorial {
  position: relative;
  z-index: 2;
}

.hero-editorial h1 {
  margin-top: 12px;
  margin-bottom: 16px;
}

.hero-editorial p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-cta-group {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

/* Marquee Featured Card */
.marquee-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  box-shadow: 0 16px 36px rgba(0,0,0,0.4);
  transition: var(--transition-normal);
}

.marquee-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 20px 45px rgba(0,0,0,0.5), var(--shadow-accent);
}

.marquee-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.marquee-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 24px 0;
  text-align: center;
}

.team-pill-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.team-emblem-large {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.scoreboard-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.live-score-digits {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  color: #fff;
}

.vs-tag {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* KPI Matrix Bar */
.kpi-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Match Grid (Game Center)
   ========================================================================== */
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-tab-bar {
  display: flex;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.filter-chip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-chip:hover {
  color: #fff;
}

.filter-chip.active {
  background: var(--bg-surface-elevated);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
}

.game-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.game-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-code-tag {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: #fff;
  width: 38px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
}

.team-full-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.team-points {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Status Indicators */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.live {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ef4444;
  animation: pulse-dot 1.4s infinite;
}

.status-pill.scheduled {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.status-pill.finished {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.canceled {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   Table & Data Views
   ========================================================================== */
.card-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 3px solid #10b981; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent-primary); }

@keyframes toastSlide {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 980px) {
  .hero-stage {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }
  .kpi-matrix {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 12px 0;
  }
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  .matches-grid {
    grid-template-columns: 1fr;
  }
}
