/* ==========================================================================
   SITAS Cestoball Dashboard - Styles
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-input: #1f2937;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);
  
  /* Brand Accents (SITAS Red & Gold) */
  --sitas-red: #e11d48;
  --sitas-red-glow: rgba(225, 29, 72, 0.35);
  --sitas-red-light: #fda4af;
  
  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  
  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
  
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #f9fafb;
  --bg-input: #f3f4f6;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

#section-upcoming,
#section-tournaments,
#section-news,
.upcoming-section,
.tournaments-section,
.news-section {
  scroll-margin-top: 92px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ambient Glows */
.glow-bg {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.15;
}

.glow-1 {
  top: -200px;
  right: -100px;
  background: radial-gradient(circle, var(--sitas-red) 0%, transparent 70%);
}

.glow-2 {
  bottom: -200px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.header {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-crest-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.team-crest-sm {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.brand-badge {
  background: linear-gradient(135deg, var(--sitas-red), #be123c);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px var(--sitas-red-glow);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-text h1 span {
  color: var(--sitas-red);
}

.brand-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.season-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.picker-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.season-picker-wrapper select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-button:hover {
  background: var(--border-subtle);
  transform: translateY(-1px);
}

/* Layout */
.main-layout {
  padding-top: 2rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* KPI Cards */
.kpi-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.kpi-card.highlight-card {
  background: linear-gradient(145deg, rgba(225, 29, 72, 0.15), var(--bg-card));
  border-color: rgba(225, 29, 72, 0.4);
}

.kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(225, 29, 72, 0.15);
  color: var(--sitas-red);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.kpi-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.kpi-icon-wrap.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.kpi-icon-wrap.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.kpi-icon-wrap.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Scope Tabs (Metro vs Nacional) */
.scope-section {
  display: flex;
  justify-content: center;
}

.scope-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 700px;
}

.scope-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.scope-tab svg {
  width: 18px;
  height: 18px;
}

.scope-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.scope-tab.active {
  background: var(--sitas-red);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--sitas-red-glow);
}

/* Category & Filter Section */
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-scroll-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.pill svg {
  width: 16px;
  height: 16px;
}

.pill:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.pill.active {
  background: var(--sitas-red);
  color: #fff;
  border-color: var(--sitas-red);
  box-shadow: 0 4px 12px var(--sitas-red-glow);
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.25rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.edition-filters {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: .2s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--sitas-red);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Tournaments Sidebar */
.tournaments-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.counter-badge {
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.tournament-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.tournament-nav-item {
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tournament-nav-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateX(3px);
}

.tournament-nav-item.active {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.15), var(--bg-input));
  border-color: var(--sitas-red);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.2);
}

.t-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.t-item-category {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.t-item-edition {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.t-item-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
}

.status-dot.finished {
  background: var(--text-muted);
}

/* Tournament Dashboard */
.tournament-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon {
  width: 56px;
  height: 56px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 450px;
}

/* Tournament Banner */
.tournament-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .tournament-banner {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.9) 100%);
}

[data-theme="light"] .tournament-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.tag-season { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.tag-category { background: rgba(225, 29, 72, 0.15); color: var(--sitas-red-light); }
.tag-edition { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.tag-status-live { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.tag-status-finished { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

[data-theme="light"] .tag-season { background: #e0f2fe; color: #0369a1; }
[data-theme="light"] .tag-category { background: #ffe4e6; color: #be123c; }
[data-theme="light"] .tag-edition { background: #fef3c7; color: #b45309; }
[data-theme="light"] .tag-status-live { background: #dcfce7; color: #15803d; }
[data-theme="light"] .tag-status-finished { background: #e2e8f0; color: #475569; }

.tournament-banner h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.tournament-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sitas-pos-box {
  background: linear-gradient(135deg, var(--sitas-red), #9f1239);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  text-align: center;
  box-shadow: 0 6px 18px var(--sitas-red-glow);
}

.pos-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.pos-text {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* Phases Bar */
.phases-bar {
  overflow-x: auto;
  padding-bottom: 0.25rem;
  padding-top: 0.50rem;
}

.phases-tabs {
  display: flex;
  gap: 0.5rem;
}

.phase-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.phase-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.phase-tab.active {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--sitas-red);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
}

/* Phase Workspace */
.phase-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.view-mode-bar {
  display: flex;
  justify-content: flex-start;
}

.tabs-segmented {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  gap: 0.3rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn svg {
  width: 16px;
  height: 16px;
}

.tab-btn.active {
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Cards & Tables */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.phase-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.th-num, .td-num {
  text-align: center;
}

.th-pos, .td-pos {
  width: 50px;
  text-align: center;
  font-weight: 800;
  font-family: var(--font-heading);
}

.club-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.club-link {
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.club-link:hover {
  color: var(--sitas-red-light);
  text-decoration: underline;
}

/* Highlight SITAS row */
tr.sitas-row {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.2), rgba(225, 29, 72, 0.05));
  font-weight: 700;
}

tr.sitas-row td {
  border-color: rgba(225, 29, 72, 0.3);
}

tr.sitas-row .club-cell {
  color: var(--sitas-red-light);
}

.pos-pill {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-input);
  font-size: 0.85rem;
}

.sitas-row .pos-pill {
  background: var(--sitas-red);
  color: #fff;
  box-shadow: 0 2px 8px var(--sitas-red-glow);
}

/* Matches List */
.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.round-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.round-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.round-title:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.matches-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.match-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition);
}

.match-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.match-card.sitas-match {
  border-left: 4px solid var(--sitas-red);
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.08), var(--bg-input));
}

.match-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.match-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.match-status-tag {
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.match-status-tag.win { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.match-status-tag.loss { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.match-status-tag.pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }

.match-teams {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.team-row.winner {
  font-weight: 700;
}

.team-row.sitas-team {
  color: var(--sitas-red-light);
  font-weight: 700;
}

.team-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 28px;
  text-align: right;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-icon {
  color: var(--sitas-red);
  width: 26px;
  height: 26px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 0;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-crest-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.footer-badge {
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
}

.footer-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-contact-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-dev-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-dev-label strong {
  color: var(--text-primary);
}

.footer-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.footer-contact-pill i,
.footer-contact-pill svg {
  width: 16px;
  height: 16px;
  color: var(--sitas-red);
  transition: transform 0.2s ease;
  display: inline-block;
  vertical-align: middle;
}

.footer-contact-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--sitas-red);
  color: var(--sitas-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--sitas-red-glow);
}

.footer-contact-pill:hover i,
.footer-contact-pill:hover svg {
  transform: scale(1.18);
}

[data-theme="light"] .footer {
  background: #ffffff;
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .footer-contact-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .footer-contact-pill:hover {
  background: #fff1f2;
  border-color: var(--sitas-red);
  color: var(--sitas-red);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  margin-right: 0.4rem;
  box-shadow: 0 0 8px var(--accent-green);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .header-content { height: auto; padding: 1rem 0; flex-wrap: wrap; gap: 1rem; }
  .scope-tabs { flex-direction: column; }
  .scope-tab { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
  .hide-mobile { display: none; }
  .data-table th, .data-table td { padding: 0.6rem 0.5rem; }
  .filter-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
}

/* ==========================================
   HEADER NAVIGATION LINKS
   ========================================== */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.nav-link svg {
  width: 15px;
  height: 15px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.nav-link.active {
  color: #fff;
  background: var(--sitas-red);
}

.nav-link.admin-link {
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.nav-link.admin-link:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fff;
}

/* ==========================================
   SECTION HEADINGS
   ========================================== */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.heading-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.heading-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.upcoming-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-blue);
}

/* ==========================================
   UPCOMING MATCHES SECTION & CARDS
   ========================================== */
.upcoming-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.upcoming-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border-left: 4px solid var(--accent-gold);
}

.upcoming-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.upcoming-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upcoming-cat-badge {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(225, 29, 72, 0.2);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.4);
  letter-spacing: 0.03em;
}

.upcoming-datetime {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.upcoming-teams {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.2rem 0;
}

.upcoming-team-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upcoming-team-line.sitas {
  color: #fb7185;
  font-weight: 800;
}

.upcoming-venue-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.84rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upcoming-venue-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #f8fafc;
}

.upcoming-obs-badge {
  font-size: 0.76rem;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 0.2rem;
  font-weight: 600;
}

.upcoming-empty-card {
  grid-column: 1 / -1;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================
   LIGHT THEME CONTRAST OVERRIDES
   ========================================== */
[data-theme="light"] .upcoming-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .upcoming-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .upcoming-cat-badge {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
  font-weight: 800;
}

[data-theme="light"] .upcoming-datetime {
  color: #334155;
}

[data-theme="light"] .upcoming-team-line {
  color: #0f172a;
}

[data-theme="light"] .upcoming-team-line.sitas {
  color: #be123c;
  font-weight: 800;
}

[data-theme="light"] .upcoming-venue-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .upcoming-venue-line {
  color: #0f172a;
  font-weight: 700;
}

[data-theme="light"] .upcoming-obs-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 700;
}

[data-theme="light"] .tag-category {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
  font-weight: 700;
}

[data-theme="light"] .heading-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 800;
}

[data-theme="light"] .upcoming-meta-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}



/* ==========================================
   TOURNAMENTS MAIN SECTION WRAPPER
   ========================================== */
.tournaments-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* ==========================================
   NEWS AND BLOG SECTION & CARDS
   ========================================== */
.news-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3.5rem;
  box-shadow: var(--shadow-sm);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.news-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.news-card:hover .news-img {
  transform: scale(1.05);
}

.news-category-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.news-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.news-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.news-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.news-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-read-more {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================
   ARTICLE FULL READING MODAL
   ========================================== */
.article-modal-box {
  max-width: 720px;
}

.article-full-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.article-full-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.badge-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

/* ==========================================
   PLAYOFF BRACKET VIEWER (CUADRO ELIMINATORIO)
   ========================================== */
.bracket-card {
  padding: 1.5rem;
  overflow: hidden;
}

.bracket-viewer-scrollable {
  overflow-x: auto;
  padding: 1rem 0.5rem 1.5rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.bracket-viewer-scrollable::-webkit-scrollbar {
  height: 8px;
}

.bracket-viewer-scrollable::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.bracket-tree {
  display: flex;
  gap: 2.25rem;
  min-width: max-content;
  align-items: stretch;
}

.bracket-round-col {
  min-width: 270px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
}

.bracket-round-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
  padding: 0.6rem 0.75rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  text-align: center;
}

.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 1.5rem;
}

.bracket-match-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.bracket-match-node:hover {
  transform: translateY(-2px);
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

.bracket-match-node.sitas-match {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.bracket-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bracket-node-label {
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bracket-team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  transition: background 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}

.bracket-team-item:last-of-type {
  margin-bottom: 0;
}

.bracket-team-item.winner {
  background: rgba(16, 185, 129, 0.08);
  font-weight: 700;
}

.bracket-team-item.sitas-team {
  font-weight: 700;
  color: var(--accent-gold);
}

.bracket-team-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.bracket-team-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.bracket-team-name-text {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-score-badge {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.bracket-score-badge.winner {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.bracket-match-footer {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}


