/* drivers.css — Modern F1 Drivers Page Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #070707;
  --card: rgba(20, 20, 20, 0.92);
  --muted: #bdbdbd;
  --accent: #e10600;
  --accent-2: #ff4500;
  --glass: rgba(255, 255, 255, 0.04);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --container: 1200px;
  --pad: 24px;
  --radius: 16px;
  --transition: 0.32s cubic-bezier(.2, .9, .2, 1);
  font-family: "Inter", "Segoe UI", system-ui, Arial, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url("../images/background.png") no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  background-color: #000;
  color: #fff;
}

* {
  box-sizing: border-box
}

html {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: #f7f7f7;
  line-height: 1.5
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad)
}

/* Subtle page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 30%, rgba(225, 6, 0, 0.06), transparent 18%),
    radial-gradient(circle at 85% 10%, rgba(30, 58, 138, 0.04), transparent 18%);
}

/* HERO */
.drivers-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px
}

.drivers-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.95), rgba(35, 35, 35, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.04);
  gap: 20px;
}

.hero-content h1 {
  font-size: 2.4rem;
  margin: 0 0 8px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--muted);
  max-width: 520px;
  margin: 0
}

.drivers-stats {
  display: flex;
  gap: 18px
}

/* Stat items */
.stat-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  min-width: 88px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent)
}

.stat-label {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase
}

/* FILTERS */
.filter-section {
  margin: 36px 0;
  padding: 28px 0 6px;
}

.filter-section .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.filter-intro {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.filter-intro h3 {
  font-size: 1.05rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.filter-intro .muted {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin: 0;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.03));
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  color: #fff;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 220ms cubic-bezier(.2, .9, .2, 1);
  transform-origin: center;
  outline: none;
}

.filter-btn svg {
  opacity: 0.85;
  display: block;
}

.filter-btn span {
  display: inline-block;
}

.filter-btn:hover,
.filter-btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(225, 6, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.12), rgba(255, 69, 0, 0.08));
  box-shadow: 0 8px 30px rgba(225, 6, 0, 0.18);
  color: #fff;
  border: 1px solid rgba(225, 6, 0, 0.28);
  transform: translateY(-2px) scale(1.02);
}

/* DRIVERS GRID */
.drivers-section {
  margin: 48px 0
}

.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  align-items: start;
}

/* DRIVER CARD */
.driver-card {
  cursor: pointer;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.driver-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.driver-card.hidden {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.driver-card.filtered-out {
  display: none !important;
}

/* Driver header */
.driver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  min-height: 70px;
}

.driver-number {
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.country-flag {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Driver image */
.driver-image {
  height: 300px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.driver-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s;
}

.driver-card:hover .driver-image img {
  transform: scale(1.08);
}

/* Driver details */
.driver-details {
  padding: 20px
}

.driver-details h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.team-name {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Points hint */
.points-line {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}

/* Standing badge */
.standing-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 700;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid rgba(255,255,255,0.03);
}

/* Driver stats */
.driver-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.stat {
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stat-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
}

.driver-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 12px 0 0;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease
}

.reveal.visible {
  opacity: 1;
  transform: none
}

/* No results */
.no-results {
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  text-align: center;
  font-weight: 700
}

/* Focus styles */
.filter-btn:focus,
.driver-card:focus {
  outline: 3px solid rgba(225, 6, 0, 0.18);
  outline-offset: 3px;
  border-radius: 8px
}

/* RESPONSIVE */
@media (max-width:1000px) {
  .driver-image {
    height: 250px
  }
  .hero-content h1 {
    font-size: 1.8rem
  }
}

@media (max-width:768px) {
  .drivers-hero {
    flex-direction: column;
    align-items: flex-start
  }
  .drivers-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr))
  }
  .driver-stats {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:680px) {
  .filter-controls {
    gap: 8px;
    padding: 8px;
  }
  .filter-btn {
    padding: 8px 10px;
    font-size: 0.85rem;
    gap: 8px;
  }
  .filter-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width:480px) {
  .drivers-grid {
    grid-template-columns: 1fr
  }
  .driver-stats {
    grid-template-columns: repeat(3, 1fr)
  }
}

/* Footer */
footer {
  margin-top: 80px;
  padding: 40px 24px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(15, 15, 15, 0.8));
  border-top: 3px solid var(--accent);
  color: var(--muted);
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.socials a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.3s ease;
}

.socials a:hover {
  color: var(--accent);
}

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

.loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

/* Add this to your existing drivers.css file - Career Stats Header Styling */

/* Stats header label */
.stats-header {
  margin: 12px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  opacity: 0.9;
}

/* Update existing stat descriptions for clarity */
.stat-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Season info badge - to clarify current season points */
.season-info {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(225, 6, 0, 0.08);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid rgba(225, 6, 0, 0.15);
}

.season-year {
  color: var(--accent);
  font-weight: 700;
}

/* Enhanced points line styling */
.points-line {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.points-line::before {
  content: "•";
  margin-right: 8px;
  color: var(--accent);
}

/* Modal stats - keep consistent */
.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.modal-stat {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Info tooltip for career stats */
.career-stats-tooltip {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  cursor: help;
}

.career-stats-tooltip::after {
  content: "ⓘ";
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.career-stats-tooltip:hover::after {
  opacity: 1;
  color: var(--accent);
}

/* --- Live Season Stats Modal Upgrades --- */
.modal-section-title {
  font-size: 1.1rem;
  color: #fff;
  margin: 25px 0 15px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.live-title {
  color: #ff2800; /* F1 Red */
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 10px;
}

.live-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.live-stat-box:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.ls-label {
  display: block;
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.ls-val {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.stat-loading, .no-data {
  text-align: center;
  padding: 20px;
  color: #aaa;
  font-style: italic;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}



/* =========================================================
   EDGE-TO-EDGE OVERRIDE FOR TEAMS & DRIVERS
   ========================================================= */

/* Override the old 1200px container variable */
:root {
  --container: 100% !important;
}

.teams-main, 
.drivers-main, 
.container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ensure grids expand to fill the newly available space */
.teams-grid,
.drivers-grid {
  width: 100%;
}

/* Shrink side padding on mobile screens */
@media (max-width: 768px) {
  .teams-main, 
  .drivers-main, 
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}


/* =========================================================
   CHAMPIONSHIP STANDINGS TABLE
   ========================================================= */
.championship-section {
  margin-top: 60px;
  margin-bottom: 60px;
}

.championship-section .section-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.championship-table {
  background: var(--card, rgba(20, 20, 24, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.table-header, .table-row {
  display: grid;
  /* Columns: Position (60px), Driver Name (flexible), Points (80px) */
  grid-template-columns: 60px 1fr 80px; 
  padding: 16px 24px;
  align-items: center;
}

.table-header {
  background: rgba(0, 0, 0, 0.5);
  font-weight: 700;
  color: var(--muted, #a1a1aa);
  text-transform: uppercase;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
  font-weight: 600;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.team-color {
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .table-header, .table-row {
    grid-template-columns: 50px 1fr 60px;
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}


/* ---------- FILTER ANIMATION (PREMIUM) ---------- */

/* Base state */
.driver-card {
  transition: 
    opacity 0.35s ease,
    transform 0.35s ease,
    filter 0.35s ease;
  will-change: opacity, transform;
}

/* Hidden state (animated) */
.driver-card.filtered-out {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  filter: blur(4px);
  pointer-events: none;
}

/* Final removal from layout AFTER animation */
.driver-card.filtered-out.is-gone {
  display: none !important;
}

/* Optional: stagger effect */
.driver-card {
  transition-delay: calc(var(--i, 0) * 20ms);
}