/* ===== League Standings – Modern Black Theme ===== */
/* Version: 2.0 - Consolidated and Enhanced */

/* ===== CSS Variables ===== */
:root {
  --bg-true-black: #0b0c1f;
  --bg-elev-1: rgba(18, 20, 37, 0.9);
  --bg-elev-2: rgba(24, 28, 55, 0.9);
  --border-soft: rgba(255,255,255,0.06);
  --primary: #1FF8FA;
  --primary-gradient: linear-gradient(135deg, #00D4FF 0%, #0066FF 100%);
  --accent: #ef7a15;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #FFFFFF;
  --text-secondary: #B8BED8;
  --text-muted: #9ca3c4;
}

/* ===== Base Layout ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: var(--bg-true-black);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(31,248,250,0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(239,122,21,0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0b0c1f 0%, #10132b 100%);
  color: var(--text-secondary);
  min-height: 100vh;
}

.main-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1380px;
  margin: 0 auto;
  gap: 24px;
  padding: 24px;
  min-height: 100vh;
}

/* ===== Left Sidebar ===== */
.left-sidebar {
  background: linear-gradient(135deg, rgba(18,20,37,0.9) 0%, rgba(24,28,55,0.85) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  height: fit-content;
  position: relative;
}

.nav-section {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.nav-section:last-child {
  border-bottom: none;
}

.nav-section h3 {
  margin: 0 0 15px 0;
  font-size: 0.95rem;
  color: #e8e9f3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  opacity: 0.92;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  margin-bottom: 8px;
}

.nav-links a {
  color: #cfd3e3;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  display: block;
  transition: all 0.2s ease;
  font-size: 14px;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(31,248,250,0.08);
  color: #ffffff;
  border-color: rgba(31,248,250,0.18);
  transform: translateX(3px);
}

/* Popular Leagues Navigation */
.popular-leagues .league-nav-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #b0b3c7;
}

.popular-leagues .league-nav-link:hover {
  background: rgba(31, 248, 250, 0.1);
  color: var(--primary);
  transform: translateX(3px);
}

.league-nav-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-right: 10px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.popular-leagues .league-nav-link:hover .league-nav-logo {
  transform: scale(1.1);
}

/* ===== Main Content Area ===== */
.main-content {
  min-width: 0; /* Prevents grid overflow */
}

/* ===== League Header ===== */
.league-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(24,28,55,0.95) 0%, rgba(16,19,43,0.95) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 12px 50px rgba(0,0,0,0.45);
}

.league-header-content {
  flex: 1;
  padding-right: 180px; /* Space for selector */
}

.league-header h1 {
  margin: 0 0 10px 0;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary) 55%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.season-info-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
  opacity: 0.85;
}

.league-logo {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  object-fit: contain;
}

/* Season Selector */
.season-selector-container {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 10;
}

.season-selector-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8em;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.season-select {
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.season-select:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.5);
}

.season-select:focus {
  outline: none;
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.season-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px;
}

/* ===== Standings Section ===== */
.standings-section {
  margin-bottom: 40px;
  border: 1px solid rgba(31, 248, 250, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 26, 58, 0.6) 0%, rgba(37, 37, 80, 0.4) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.standings-header {
  background: linear-gradient(135deg, #1e1e42 0%, #2a2a55 100%);
  padding: 20px 25px;
  border-bottom: 1px solid rgba(31, 248, 250, 0.2);
}

.standings-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.6em;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.standings-header p {
  margin: 0;
  color: #9ca3c4;
  font-size: 0.9em;
}

/* Stats Toggle */
.stats-toggle-container {
  padding: 15px 20px;
  background: rgba(31, 248, 250, 0.05);
  border-bottom: 1px solid rgba(31, 248, 250, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.toggle-buttons {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.toggle-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #cfd3e3;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

.toggle-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.toggle-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 248, 250, 0.3);
}

/* Standings Table */
.standings-table-container {
  margin-top: 14px;
  overflow-x: auto;
  padding: 20px;
}

.standings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-feature-settings: "tnum" 1;
}

.standings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255,255,255,0.04);
  color: #e8e9f3;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 12px 10px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  font-weight: 700;
}

.standings-table thead th:first-child,
.standings-table thead th:nth-child(2) {
  text-align: left;
}

.standings-table .team-row {
  background: linear-gradient(135deg, rgba(18,20,37,0.9) 0%, rgba(24,28,55,0.85) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.standings-table .team-row > td {
  padding: 12px 10px;
  font-size: 0.95rem;
  color: #e8e9f3;
  text-align: center;
  font-weight: 500;
  position: relative;
}

.standings-table .team-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  background: linear-gradient(90deg, rgba(31, 248, 250, 0.12) 0%, rgba(31, 248, 250, 0.08) 100%);
}

/* Table Cell Styles */
.position {
  font-weight: 700;
  color: #9cc7ff;
  width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.team-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-crest {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
  transition: transform 0.2s ease;
}

.team-row:hover .team-crest {
  transform: scale(1.1);
}

.team-link {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.team-link:hover {
  color: var(--primary);
  text-shadow: 0 0 8px rgba(31, 248, 250, 0.3);
}

.points {
  font-weight: 800;
  font-size: 1.1em;
  text-align: center;
  width: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, #026BDA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

.games {
  font-weight: 600;
  color: #9ca3c4;
  text-align: center;
  width: 70px;
  font-size: 0.95em;
  font-variant-numeric: tabular-nums;
}

/* Stat Values with Tiers */
.stat-value {
  font-weight: 700;
  text-align: center;
  width: 85px;
  font-size: 0.9em;
  padding: 8px 6px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

/* Tier 1: Top performers (Top 10%) */
.stat-value.tier-1 {
  background: linear-gradient(135deg, rgba(0, 255, 127, 0.25) 0%, rgba(34, 197, 94, 0.2) 100%);
  color: #00ff7f;
  border: 2px solid rgba(0, 255, 127, 0.4);
  box-shadow: 0 0 15px rgba(0, 255, 127, 0.3);
  font-weight: 800;
}

/* Tier 2: Excellent (Top 10-25%) */
.stat-value.tier-2 {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
  color: #22c55e;
  border: 2px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

/* Tier 3: Good (Top 25-40%) */
.stat-value.tier-3 {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.18) 0%, rgba(101, 163, 13, 0.12) 100%);
  color: #84cc16;
  border: 2px solid rgba(132, 204, 22, 0.3);
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.2);
}

/* Tier 4: Above Average (40-55%) */
.stat-value.tier-4 {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.18) 0%, rgba(202, 138, 4, 0.12) 100%);
  color: #eab308;
  border: 2px solid rgba(234, 179, 8, 0.3);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.2);
}

/* Tier 5: Average (55-70%) */
.stat-value.tier-5 {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0%, rgba(234, 88, 12, 0.12) 100%);
  color: #f97316;
  border: 2px solid rgba(249, 115, 22, 0.3);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.2);
}

/* Tier 6: Below Average (70-85%) */
.stat-value.tier-6 {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
  color: #ef4444;
  border: 2px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* Tier 7: Poor (Bottom 15%) */
.stat-value.tier-7 {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25) 0%, rgba(185, 28, 28, 0.2) 100%);
  color: #dc2626;
  border: 2px solid rgba(220, 38, 38, 0.4);
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
  font-weight: 800;
}

/* Stat Value Hover Effects */
.stat-value.tier-1:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 255, 127, 0.5);
  border-color: #00ff7f;
}

.stat-value.tier-2:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.4);
  border-color: #22c55e;
}

.stat-value.tier-3:hover,
.stat-value.tier-4:hover,
.stat-value.tier-5:hover,
.stat-value.tier-6:hover {
  transform: translateY(-2px) scale(1.03);
}

.stat-value.tier-7:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
  border-color: #dc2626;
}

/* Form Badge */
.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-soft);
  font-weight: 800;
  transition: all 0.3s ease;
}

.form-badge:hover {
  transform: scale(1.15);
}

.form-up {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
  color: #22c55e;
}

.form-down {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.form-equal {
  background: rgba(108, 117, 125, 0.2);
  border-color: rgba(108, 117, 125, 0.35);
  color: #6c757d;
}

/* ===== Player Statistics Section ===== */

.stat-content-header{
  color: white;
}

.player-stats-section {
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(18,20,37,0.95) 0%, rgba(24,28,55,0.9) 100%);
  border: 1px solid rgba(31, 248, 250, 0.15);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  position: relative;
}

.player-stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0.8;
}

.player-stats-header {
  background: linear-gradient(135deg, rgba(30,35,65,0.95) 0%, rgba(20,25,50,0.95) 100%);
  padding: 28px 32px;
  border-bottom: 1px solid rgba(31, 248, 250, 0.15);
  position: relative;
  overflow: hidden;
}

.player-stats-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(31, 248, 250, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.player-stats-header h2 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.player-stats-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.player-stats-nav {
  padding: 20px 24px;
  background: rgba(15, 15, 30, 0.4);
  border-bottom: 1px solid rgba(31, 248, 250, 0.1);
  backdrop-filter: blur(10px);
}

.player-stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.player-stat-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255,255,255,0.02);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.player-stat-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(31, 248, 250, 0.3) 0%, transparent 70%);
  transition: width 0.4s, height 0.4s;
  transform: translate(-50%, -50%);
}

.player-stat-tab:hover {
  background: rgba(31, 248, 250, 0.08);
  border-color: rgba(31, 248, 250, 0.25);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 248, 250, 0.15);
}

.player-stat-tab:hover::before {
  width: 100%;
  height: 100%;
}

.player-stat-tab.active {
  background: linear-gradient(135deg, rgba(31, 248, 250, 0.2) 0%, rgba(0, 102, 255, 0.2) 100%);
  color: #fff;
  border-color: rgba(31, 248, 250, 0.4);
  box-shadow: 0 6px 20px rgba(31, 248, 250, 0.25);
}

.player-stat-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
}

/* Icon container for better alignment */
.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 18px;
}

.tab-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.player-stat-tab:hover .tab-icon svg {
  transform: scale(1.1);
}

.player-stat-tab.active .tab-icon svg {
  transform: scale(1.15);
}

.tab-text {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Mobile Navigation Styles */
.player-stats-mobile-nav {
  display: none;
  position: relative;
}

.player-stats-dropdown-toggle {
  width: 100%;
  background: linear-gradient(135deg, rgba(31, 248, 250, 0.15) 0%, rgba(0, 102, 255, 0.15) 100%);
  color: white;
  border: 1px solid rgba(31, 248, 250, 0.3);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(31, 248, 250, 0.2);
}

.player-stats-dropdown-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 248, 250, 0.3);
  border-color: rgba(31, 248, 250, 0.5);
}

.current-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.current-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.dropdown-arrow {
  font-size: 14px;
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.8);
}

.player-stats-dropdown-toggle.active .dropdown-arrow {
  transform: rotate(180deg);
}

.player-stats-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 15, 30, 0.98);
  border: 1px solid rgba(31, 248, 250, 0.2);
  border-radius: 12px;
  margin-top: 8px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.player-stats-dropdown.active {
  max-height: 400px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(31, 248, 250, 0.1);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(31, 248, 250, 0.1);
  color: #fff;
  padding-left: 24px;
}

.dropdown-item.active {
  background: rgba(31, 248, 250, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.item-icon svg {
  width: 18px;
  height: 18px;
}

/* Mobile select - hidden by default on desktop */
.player-stats-mobile-select {
  display: none;
}

/* Player Stats Content */
.player-stats-content {
  padding: 24px;
}

.stat-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.stat-content.active {
  display: block;
}

/* Player Stats Table */
.stat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.stat-table thead th {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 10px;
  color: #e8e9f3;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.stat-row td {
  padding: 12px 10px;
  color: #e8e9f3;
}

.stat-row:hover {
  background: rgba(31, 248, 250, 0.08);
}

.team-crest-small {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.player-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.player-link:hover {
  color: var(--primary);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
  margin-bottom: 30px;
}

/* Generic Stat Section */
.stat-section {
  margin-bottom: 40px;
  border: 1px solid rgba(31, 248, 250, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 26, 58, 0.6) 0%, rgba(37, 37, 80, 0.4) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stat-header {
  background: linear-gradient(135deg, #1e1e42 0%, #2a2a55 100%);
  padding: 20px 25px;
  border-bottom: 1px solid rgba(31, 248, 250, 0.2);
}

.stat-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.6em;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-header p {
  margin: 0;
  color: #9ca3c4;
  font-size: 0.9em;
}

.stat-table-container {
  padding: 20px;
  overflow-x: auto;
}

/* ===== Team Form Section ===== */
.team-form-section {
  margin-bottom: 40px;
  border: 1px solid rgba(31, 248, 250, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 26, 58, 0.6) 0%, rgba(37, 37, 80, 0.4) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.team-form-header {
  background: linear-gradient(135deg, #1e1e42 0%, #2a2a55 100%);
  padding: 20px 25px;
  border-bottom: 1px solid rgba(31, 248, 250, 0.2);
}

.team-form-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.6em;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.team-form-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px;
}

.team-card {
  border: 1px solid rgba(31, 248, 250, 0.25);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(22, 22, 70, 0.8) 0%, rgba(30, 30, 80, 0.6) 100%);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 248, 250, 0.1);
  border-color: rgba(31, 248, 250, 0.4);
}

.team-card-header {
  background: linear-gradient(135deg, #1a1a3a 0%, #252550 100%);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(31, 248, 250, 0.2);
}

.team-card-body {
  padding: 18px;
}

.form-record {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.form-result {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  font-weight: 600;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.form-result:hover {
  transform: scale(1.1);
}

.form-result.W {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.form-result.D {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
  color: #333;
}

.form-result.L {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.view-squad-link {
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid rgba(31, 248, 250, 0.6);
  border-radius: 15px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.view-squad-link:hover {
  background-color: rgba(31, 248, 250, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(31, 248, 250, 0.2);
}

/* ===== Right Sidebar (Insights) ===== */
.right-sidebar {
  background: linear-gradient(135deg, rgba(26, 26, 58, 0.8) 0%, rgba(37, 37, 80, 0.6) 100%);
  border-radius: 12px;
  border: 1px solid rgba(31, 248, 250, 0.2);
  height: fit-content;
  position: relative;
}

.content-section {
  padding: 20px;
  border-bottom: 1px solid rgba(31, 248, 250, 0.1);
}

.content-section:last-child {
  border-bottom: none;
}

.content-section h3 {
  margin: 0 0 15px 0;
  font-size: 1.1em;
  color: var(--primary);
  font-weight: 600;
}

.content-section p {
  font-size: 13px;
  line-height: 1.5;
  color: #b0b3c7;
  margin-bottom: 15px;
}

.stat-highlight {
  background: rgba(31, 248, 250, 0.1);
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 3px solid var(--primary);
}

.stat-highlight .team-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.stat-highlight .stat-value {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.stat-highlight .stat-desc {
  color: #9ca3c4;
  font-size: 12px;
  margin-top: 5px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .left-sidebar {
    position: static;
    order: 2;
  }
  
  .main-content {
    order: 1;
  }
  
  .right-sidebar {
    display: none;
  }
  
  .team-form-content {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 991px) {
  .main-container {
    padding: 16px;
  }
  
  .league-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .league-header-content {
    padding-right: 0;
  }
  
  .season-selector-container {
    position: static;
    margin-top: 15px;
    align-self: flex-start;
  }
  
  .standings-table thead th {
    font-size: 0.7rem;
    padding: 10px 8px;
  }
  
  .standings-table .team-row > td {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
  
  .player-stats-tabs {
    gap: 8px;
  }
  
  .player-stat-tab {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .league-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  
  .league-logo {
    width: 60px;
    height: 60px;
  }
  
  .league-header h1 {
    font-size: 1.8em;
  }
  
  .season-selector-container {
    align-self: center;
  }
  
  .season-select {
    min-width: 140px;
    font-size: 0.85em;
    padding: 8px 12px;
  }
  
  /* Hide stats toggle on mobile */
  .stats-toggle-container {
    display: none;
  }
  
  /* League table mobile optimizations */
  .standings-table {
    font-size: 0.8rem;
  }
  
  .standings-table th,
  .standings-table td {
    padding: 8px 4px;
  }
  
  /* Optimize team names for mobile */
  .team-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .team-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Show abbreviated team names on mobile */
  .team-name-full {
    display: none;
  }
  
  .team-name-short {
    display: inline;
  }
  
  /* Reduce column widths on mobile */
  .standings-table th:nth-child(1),
  .standings-table td:nth-child(1) {
    width: 25px; /* Position */
  }
  
  .standings-table th:nth-child(2),
  .standings-table td:nth-child(2) {
    max-width: 120px; /* Team */
  }
  
  /* Hide less important columns on very small screens */
  @media (max-width: 480px) {
    .standings-table th:nth-child(n+7),
    .standings-table td:nth-child(n+7) {
      display: none; /* Hide columns after GD */
    }
  }
  
  /* Player stats section mobile optimizations */
  .stat-table {
    font-size: 0.85rem;
    width: 100%;
  }
  
  .stat-table th,
  .stat-table td {
    padding: 10px 6px;
  }
  
  /* Ensure stat column is always visible */
  .stat-col {
    min-width: 50px;
    text-align: center;
    font-weight: 700;
  }
  
  /* Optimize player names for mobile */
  .player-col {
    max-width: 140px;
    overflow: hidden;
  }
  
  .player-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  
  /* Ensure rank column is compact */
  .rank-col {
    width: 30px;
    padding-right: 8px;
  }
  
  /* Player stat tabs mobile */
  .player-stat-tabs {
    gap: 6px;
    padding: 15px 10px;
  }
  
  .player-stat-tab {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  
  .tab-icon {
    width: 18px;
    height: 18px;
  }
  
  .tab-text {
    display: none; /* Hide text on mobile, show only icons */
  }
  
  /* Show dropdown menu for tabs on very small screens */
  @media (max-width: 480px) {
    .player-stat-tabs {
      position: relative;
    }
    
    .player-stat-tab {
      padding: 8px;
    }
  }
  
 
  
  .team-form-content {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }
  
  /* Mobile Insights */
  .mobile-insights {
    display: block;
    background: linear-gradient(135deg, rgba(26, 26, 58, 0.8) 0%, rgba(37, 37, 80, 0.6) 100%);
    border-radius: 12px;
    border: 1px solid rgba(31, 248, 250, 0.2);
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .mobile-insights h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
  }
  
  .insight-card {
    background: rgba(31, 248, 250, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary);
  }
  
  .insight-card:last-child {
    margin-bottom: 0;
  }
  
  /* Mobile League Grid */
  .mobile-league-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
  }
  
  .mobile-league-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(31, 248, 250, 0.05);
    border: 1px solid rgba(31, 248, 250, 0.1);
    border-radius: 6px;
    text-decoration: none;
    color: #e8e9f3;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  .mobile-league-item:hover {
    background: rgba(31, 248, 250, 0.1);
    border-color: rgba(31, 248, 250, 0.3);
    color: var(--primary);
    transform: translateY(-1px);
  }
  
  .mobile-league-item img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  }
}



/* Mobile fixes */
@media (max-width: 768px) {
  /* Only hide stats in the standings table on mobile */
  .standings-table .stat-column,
  .standings-table .stat-value {
    display: none;
  }
  
  /* Hide desktop tabs on mobile */
  .player-stats-tabs {
    display: none !important;
  }
  
  /* Show mobile select on mobile */
  .player-stats-mobile-select {
    display: block !important;
  }

  /* Ensure player stats show on mobile */
  .player-stats-section .stat-col,
  .player-stats-section .stat-value {
    display: table-cell !important;
    min-width: 56px;
  }

  /* Tighter layout for player stats table */
  .player-stats-section .stat-table {
    table-layout: fixed;
  }

  /* Reduce name size and truncate long names */
  .player-stats-section .player-link {
    font-size: 0.9rem;
    display: inline-block;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Reduce padding in the container */
  .player-stats-section .stat-table-container {
    padding: 8px;
  }
}


@media (max-width: 575px) {
  .toggle-btn {
    padding: 7px 12px;
  }
  
  .stats-toggle-container .toggle-buttons {
    padding: 6px;
  }
  
  .team-crest {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 15px;
  }
  
  .season-selector-container {
    width: 100%;
    text-align: center;
  }
  
  .season-select {
    width: 100%;
    max-width: 200px;
  }
  
  .mobile-league-grid {
    grid-template-columns: 1fr;
  }
  
  .mobile-league-item {
    font-size: 11px;
    padding: 6px 8px;
  }
  
  .mobile-league-item img {
    width: 14px;
    height: 14px;
    margin-right: 6px;
  }
  
  .standings-table {
    min-width: 320px;
  }
  
  .position {
    width: 35px;
  }
  
  .points {
    width: 50px;
  }
  
  .games {
    width: 45px;
  }
  
  .team-crest {
    width: 18px;
    height: 18px;
  }
  
  .form-badge {
    width: 18px;
    height: 18px;
    font-size: 9px;
    line-height: 18px;
  }

  .player-stats-section .player-link {
    max-width: 120px;
    font-size: 0.85rem;
  }

}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* Hide mobile-only elements by default */
.mobile-insights {
  display: none;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(31, 248, 250, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 248, 250, 0.5);
}

/* Hide rank column in player stats on mobile and shift content left */
@media (max-width: 768px) {
  .player-stats-section .stat-table thead th.rank-col,
  .player-stats-section .stat-table tbody td.rank {
    display: none !important;
  }

  /* Consistent row sizing */
  .player-stats-section .stat-row {
    height: 48px;
  }
  .player-stats-section .stat-row td {
    padding: 8px 10px;
    vertical-align: middle;
  }

  /* Crest into vacated space and consistent size */
  .player-stats-section .team-crest-small {
    width: 24px;
    height: 24px;
    margin-right: 8px;
  }

  /* Fixed layout and column widths */
  .player-stats-section .stat-table {
    table-layout: fixed;
  }
  .player-stats-section .player-col { /* player name column */
    width: 100%;
  }
  .player-stats-section .stat-col {   /* value column */
    min-width: 56px;
    width: 72px;
    text-align: center;
  }

  /* Shorter names with ellipsis */
  .player-stats-section .player-link {
    display: inline-block;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
  }

  /* Tighter container padding */
  .player-stats-section .stat-table-container {
    padding: 8px;
  }

  /* Replace icon-based mobile toggle with select */
  .player-stats-mobile-nav { display: none !important; }
  .player-stats-mobile-select { display: block; padding: 12px 16px; }
  .player-stats-select {
    width: 100%;
    background: linear-gradient(135deg, rgba(31, 248, 250, 0.15) 0%, rgba(0, 102, 255, 0.15) 100%);
    color: #fff;
    border: 1px solid rgba(31, 248, 250, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  .player-stats-section .player-link {
    max-width: 120px;
    font-size: 0.85rem;
  }
}