/* =========================================================
   F1 Racing Hub - Premium 2026 Global Styles
   ========================================================= */

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

:root {
  --bg-color: #050505;
  --text-primary: #f5f5f5;
  --text-muted: #a1a1aa;
  --accent: #e10600;
  --accent-hover: #ff4500;

  --card-bg: rgba(20, 20, 24, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  --gradient-accent: linear-gradient(135deg, #e10600 0%, #ff6a00 100%);
  --glass-blur: blur(16px);
}

html {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  /* Restored your original background image */
  background: url("../images/background.png") no-repeat center center fixed;
  background-size: cover;
  background-color: #000;
  /* Fallback */
}

/* Optional: Add a very slight dark overlay so the glassmorphism cards pop perfectly against your image */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  /* Adjust this (0.1 to 0.9) to make the background image brighter or darker */
  z-index: -1;
}

/* ================== GLOBAL BUTTONS ================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(225, 6, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(225, 6, 0, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  backdrop-filter: blur(5px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* ================== BENTO DASHBOARD LAYOUT ================== */
.dashboard-main {
  max-width: 100%;
  /* Changed from 1400px to 100% to stretch edge-to-edge */
  margin: 40px auto;
  padding: 0 40px;
  /* Keeps a nice breathing gap on the left and right edges */
  min-height: calc(100vh - 150px);
  /* Ensures the grid stretches downward to the footer */
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  gap: 24px;
}

/* Base Bento Card Style */
.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.bento-content {
  padding: 32px;
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Box Headers */
.box-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.box-header h3,
.box-header span {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.flex-between {
  justify-content: space-between;
}

/* ================== SPECIFIC BENTO WIDGETS ================== */

/* Hero Widget */
.bento-hero {
  grid-column: span 2;
  grid-row: span 2;
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.8) 0%, rgba(15, 15, 18, 0.9) 100%);
  justify-content: center;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(225, 6, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.era-badge {
  display: inline-block;
  background: rgba(225, 6, 0, 0.15);
  color: #ff4500;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  border: 1px solid rgba(225, 6, 0, 0.3);
}

.bento-hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bento-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 90%;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

/* =========================================================
   HERO FEATURE NOTICE (ANALYTICS PILL)
   ========================================================= */
.hero-feature-notice {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(216, 150, 255, 0.08);
  border: 1px solid rgba(216, 150, 255, 0.2);
  padding: 6px 18px 6px 6px;
  border-radius: 50px;
  text-decoration: none;
  margin: 12px 0 20px 0;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: fit-content;
}

.hero-feature-notice:hover {
  background: rgba(216, 150, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(216, 150, 255, 0.15);
  border-color: rgba(216, 150, 255, 0.4);
}

.hero-feature-notice:active {
  transform: translateY(1px);
}

.feature-badge {
  background: #d896ff;
  color: #000;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-text {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.feature-arrow {
  color: #d896ff;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

/* Make the arrow slide right on hover */
.hero-feature-notice:hover .feature-arrow {
  transform: translateX(4px);
}

/* Next Race Countdown Widget */
.bento-countdown-box {
  grid-column: span 2;
}

.live-dot {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.race-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.race-details {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.race-details p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: auto;
}

.time-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
}

.time-box span {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  font-family: 'Courier New', Courier, monospace;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}

.time-box small {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Champions Widget */
.bento-champions {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.05) 0%, rgba(20, 20, 20, 0.8) 100%);
}

.champs-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  gap: 20px;
}

.champ-driver,
.champ-team {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1;
}

.champ-driver img,
.champ-team img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 140, 0, 0.5);
}

.champ-team img {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  object-fit: contain;
}

.champs-content small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.champs-content strong {
  font-size: 1.2rem;
  color: #fff;
}

/* Race Reminder Widget */
.bento-reminder {
  grid-column: span 4;
  /* CHANGED: Now stretches across the entire screen! */
  display: flex;
  flex-direction: column;
}

.bento-reminder .bento-content {
  flex: 1;
}

.race-reminder-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fix race reminder styles to match glassmorphism natively */
.race-reminder-container .reminder-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 12px !important;
}

.race-reminder-container h3,
.race-reminder-container h4 {
  color: #fff !important;
}

/* Drivers Carousel Widget */
.bento-drivers {
  grid-column: span 4;
}

.view-all {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.view-all:hover {
  color: #fff;
}

.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
}

.drivers-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  /* Enables manual horizontal scroll */
  scroll-snap-type: x mandatory;
  /* Snaps cards perfectly into view */
  scrollbar-width: none;
  /* Hides scrollbar in Firefox */
  -ms-overflow-style: none;
  /* Hides scrollbar in IE/Edge */
  /* transition: transform 0.4s ease-out; <-- REMOVED */
}

/* Hides scrollbar in Chrome/Safari/Opera */
.drivers-grid::-webkit-scrollbar {
  display: none;
}

.driver-portrait {
  flex-shrink: 0;
  width: calc(25% - 15px);
  /* Show 4 at a time */
  scroll-snap-align: start;
  /* Ensures scrolling snaps to the start of the card */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.driver-portrait:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.driver-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}

.driver-portrait:hover img {
  transform: scale(1.05);
}

.portrait-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.d-num {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 900;
  color: #ffffff;
  font-size: 1.2rem;
  display: block;
  margin-bottom: 4px;
}

.portrait-info h4 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.d-team {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
  /* allows dots to wrap on mobile if needed */
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

/* Results & Constructors Mini Widgets */
.bento-results {
  grid-column: span 2;
}

.bento-results .bento-content {
  flex-direction: row;
  align-items: center;
  gap: 32px;
}

.results-visual {
  width: 100px;
  height: 100px;
  background: rgba(225, 6, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(225, 6, 0, 0.3);
  flex-shrink: 0;
}

.podium-icon {
  font-size: 3rem;
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.results-text h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #fff;
}

.results-text p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.bento-constructors {
  grid-column: span 2;
}

.bento-constructors h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.bento-constructors p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Team Colors for Mini Grid */
.mini-team.mclaren {
  background: #ff8000;
}

.mini-team.ferrari {
  background: #e10600;
}

.mini-team.redbull {
  background: #0600ef;
}

.mini-team.mercedes {
  background: #00d2be;
}

.mini-team.astonmartin {
  background: #006f62;
}

.mini-team.williams {
  background: #00539f;
}

.mini-team.haas {
  background: #ffffff;
}

.mini-team.rb {
  background: #1432d1;
}

.mini-team.alpine {
  background: #0090ff;
}

.mini-team.sauber {
  background: #00e701;
}

.mini-team.cadillac {
  background: #222222;
  border: 1px solid #fff;
}

.mt-3 {
  margin-top: auto;
  align-self: flex-start;
}

/* =========================================================
   CONSTRUCTORS LOGO GRID (BENTO BOX)
   ========================================================= */
.constructor-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
  line-height: 1.4;
}

.constructor-logos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.c-logo-box {
  width: calc(33.333% - 7px);
  /* 3 logos per row on mobile */
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

@media (min-width: 640px) {
  .c-logo-box {
    width: calc(25% - 8px);
  }

  /* 4 logos per row on larger screens */
}

/* Make Cadillac stand out as the special 11th team spanning the remaining space */
.c-logo-box.cadillac-box {
  border-color: rgba(162, 162, 162, 0.3);
  background: rgba(162, 162, 162, 0.05);
  flex-grow: 1;
  max-width: 60%;
}

.c-logo-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--team-color);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  filter: blur(12px);
}

.c-logo-box:hover {
  transform: translateY(-3px);
  border-color: var(--team-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.c-logo-box:hover::before {
  opacity: 0.25;
  /* Subtle glowing background of the team's color */
}

.c-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}

.c-logo-box:hover img {
  transform: scale(1.12);
  /* Pop the logo out slightly on hover */
}



/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 1100px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-hero {
    grid-column: span 2;
    grid-row: span 1;
  }

  .bento-countdown-box {
    grid-column: span 2;
  }

  .bento-champions {
    grid-column: span 2;
  }

  .bento-reminder {
    grid-column: span 2;
  }

  .bento-drivers {
    grid-column: span 2;
  }

  .bento-results {
    grid-column: span 2;
  }

  .bento-constructors {
    grid-column: span 2;
  }

  .driver-portrait {
    width: calc(50% - 10px);
  }

  /* Show 2 on tablet */
}

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

  .bento-hero,
  .bento-countdown-box,
  .bento-champions,
  .bento-reminder,
  .bento-drivers,
  .bento-results,
  .bento-constructors {
    grid-column: span 1;
  }

  .bento-hero h1 {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .champs-content {
    flex-direction: column;
    align-items: stretch;
  }

  .bento-results .bento-content {
    flex-direction: column;
    text-align: center;
  }

  .driver-portrait {
    width: 100%;
  }

  /* Show 1 on mobile */
}

/* 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);
}





/* =========================================================
   GLOBAL EDGE-TO-EDGE LAYOUT OVERRIDE
   Forces all pages to span the full width of the screen
   ========================================================= */

.dashboard-main,
.about-main,
.schedule-main,
.circuits-main,
.drivers-main,
.teams-main,
.results-main,
.container,
#schedule-container,
#circuits-container,
.schedule-stats,
.schedule-cta {
  max-width: 100% !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ensure the Schedule CTA box doesn't overflow horizontally */
.schedule-cta {
  width: calc(100% - 80px) !important;
  /* Accounts for the 40px left/right padding */
}

/* Smart Mobile Adjustments: Shrinks the side gaps on small screens */
@media (max-width: 768px) {

  .dashboard-main,
  .about-main,
  .schedule-main,
  .circuits-main,
  .drivers-main,
  .teams-main,
  .results-main,
  .container,
  #schedule-container,
  #circuits-container,
  .schedule-stats,
  .schedule-cta {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .schedule-cta {
    width: calc(100% - 40px) !important;
  }
}



/* =========================================================
   ULTRA-WIDE SCREEN POLISH (The Perfect Stretch Fix)
   ========================================================= */

/* Use 'auto-fit' and '1fr' to force cards to stretch and fill all empty space */
.teams-main .teams-grid,
.drivers-main .drivers-grid {
  display: grid !important;
  /* This is the magic line: it fits as many 320px cards as it can, then stretches them (1fr) to fill the row perfectly! */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
  gap: 30px;
  width: 100%;
}

/* Ensure individual cards are allowed to stretch fully */
.teams-main .team-card,
.drivers-main .driver-card {
  display: flex !important;
  flex-direction: column;
  max-width: none !important;
  /* Removes any old maximum width caps */
  width: 100% !important;
}

/* 2. Contain and beautify the Championship Table */
.championship-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.championship-table {
  width: 100%;
  max-width: 1000px !important;
  /* Keeps the table sleek and readable */
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}

/* 3. Center the Section Titles above the contained tables */
.championship-section .section-title,
.filter-intro {
  text-align: center;
  width: 100%;
}



/* =========================================================
   ADD TO CALENDAR BUTTON (Next Race Bento)
   ========================================================= */
.calendar-action {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.add-cal-btn {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.15), rgba(255, 69, 0, 0.08));
  border: 1px solid rgba(225, 6, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 15px rgba(225, 6, 0, 0.15);
}

.add-cal-btn .cal-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.add-cal-btn:hover {
  background: linear-gradient(135deg, var(--accent), #ff3300);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(225, 6, 0, 0.4);
}

.add-cal-btn:hover .cal-icon {
  transform: scale(1.1) rotate(-10deg);
}

.add-cal-btn:active {
  transform: translateY(-1px);
}

/* Ensure it stretches perfectly on mobile screens */
@media (max-width: 768px) {
  .add-cal-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 28px;
  }
}








/* =========================================================
   PREMIUM FAT FOOTER & UX FIXES
   ========================================================= */
.site-footer {
  position: relative;
  background: #050505;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 60px 0 20px;
  margin-top: 60px;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 20px var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h2 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.footer-brand h2 span {
  color: var(--accent);
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}



.footer-links h3,
.footer-cta h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateX(5px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #666;
  font-size: 0.85rem;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top {
  position: fixed !important;
  /* Makes it float beautifully over the page */
  bottom: 80px !important;
  /* Sits perfectly right above your floating Help button */
  right: 24px !important;
  z-index: 9990;
  /* Keeps it above everything else */
  background: rgba(20, 20, 25, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(225, 6, 0, 0.4);
  transform: translateY(-3px);
  /* Makes it pop up slightly when hovered */
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 24px !important;
    /* Drops to the very bottom corner since the Help button is hidden on phones! */
    right: 16px !important;
  }
}


/* =========================================================
   COMING SOON TEASER (Hero Bento)
   ========================================================= */
.predictor-teaser {
  margin-top: 32px;
  display: inline-block;
  animation: fadeIn 1s ease 0.5s both;
}

.teaser-glass {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(20, 20, 25, 0.8), rgba(10, 10, 12, 0.9));
  border: 1px dashed rgba(225, 6, 0, 0.4);
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: default;
  transition: all 0.3s ease;
}

.teaser-glass:hover {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(225, 6, 0, 0.2);
}

.teaser-icon {
  font-size: 1.4rem;
  animation: pulse 2s infinite;
}

.teaser-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.teaser-label {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 1px;
}

.teaser-title {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}


/* =========================================================
   TABBED STANDINGS BENTO CARD (INDEX.HTML)
   ========================================================= */
.bento-standings {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .bento-standings {
    grid-column: 1 / -1;
  }
}

.standings-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.standings-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mini-table-header {
  display: grid;
  grid-template-columns: 40px 1fr 60px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.mini-standings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-row {
  display: grid;
  grid-template-columns: 40px 1fr 60px;
  align-items: center;
  font-size: 0.95rem;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, transform 0.2s ease;
}

.mini-row:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.mini-pos {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.4);
}

.mini-name-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-color {
  width: 4px;
  height: 16px;
  border-radius: 2px;
}

.mini-name {
  font-weight: 600;
  color: var(--text-primary);
}

.mini-team-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 400;
}

.mini-pts {
  font-weight: 800;
  color: var(--text-primary);
  text-align: right;
  background: rgba(225, 6, 0, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.view-all-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}

.view-all-link:hover {
  color: var(--accent);
}

/* Mobile Responsiveness for Tables */
@media (max-width: 480px) {

  .mini-row,
  .mini-table-header {
    grid-template-columns: 30px 1fr 50px;
    font-size: 0.85rem;
    padding: 8px;
  }

  .mini-team-sub {
    display: none;
    /* Hide team name next to driver on small phones to prevent text squishing */
  }
}

/* =========================================================
   GLOBAL TOUR CIRCUITS CARD (INDEX.HTML)
   ========================================================= */
.bento-circuits {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.circuit-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.circuit-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 14, 0.95) 0%, rgba(10, 10, 14, 0.4) 50%, transparent 100%);
  z-index: 1;
}

.circuit-content {
  position: relative;
  z-index: 2;
}

.bento-circuits:hover .circuit-bg {
  transform: scale(1.1);
}

/* =========================================================
   INTERACTIVE DASHBOARD ADDITIONS
   ========================================================= */

/* Update the ambient glows so JS can translate them smoothly */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none; /* Let clicks pass through */
  z-index: -2;
  filter: blur(80px);
  will-change: transform; /* Hardware acceleration for JS animation */
  transition: opacity 0.5s ease;
}

.glow-1 {
  background: radial-gradient(circle, rgba(225, 6, 0, 0.15) 0%, transparent 70%);
}

.glow-2 {
  background: radial-gradient(circle, rgba(100, 100, 255, 0.08) 0%, transparent 70%);
}

/* 3D Tilt Transitions */
.bento-card {
  /* Override the default transform transition to prevent stuttering while JS takes control */
  transition: transform 0.1s linear, box-shadow 0.1s linear, border-color 0.4s ease;
  transform-style: preserve-3d;
}

/* Reset transition when mouse leaves to smoothly return to default */
.bento-card:not(:hover) {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.6s ease, border-color 0.4s ease;
}

/* Drag-to-Scroll Drivers Carousel */
.drivers-grid {
  cursor: grab;
}

.drivers-grid.active-drag {
  cursor: grabbing;
  scroll-snap-type: none; /* Disable snap while dragging for smoother movement */
}

/* Prevent text highlighting and image dragging while sliding */
.drivers-grid.active-drag .driver-portrait {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* Stops accidental link clicks mid-drag */
}

.drivers-grid.active-drag img {
  -webkit-user-drag: none;
}

