* {
  box-sizing: border-box;
}


/* Why did the CSS developer quit their job?
They couldn't handle the cascading effects of too much specificity! */

html, body {
  margin: 0; 
  padding: 0;
}
/* ============================================================
   COLOR VARIABLES (Light Mode Default + Dark Mode Toggle)
   ============================================================ */
:root {
  /* CSS Variables are a best practice for managing themes! */
  --bg: #f2f5f7;
  --text: #111111;
  --accent: #0077cc;
  --header-footer-bg: #e6e6e6;
  --card-bg: #ffffff;
}

/* The JavaScript adds the 'dark-mode' class to the <body>, which triggers ALL these color changes automatically. */

body.dark-mode {
  --bg: #0e111b;
  --text: #d4d8e3;
  --accent: #c9b037;  /* A gold/yellow accent in dark mode */
  --header-footer-bg: #111522;
  --card-bg: #1b1f2c;
}

body.dark-mode .intro-card {
  /* An even darker shade for key cards to make them stand out slightly against the main background. */
    background: #0d0d0f; 
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
}

/* ============================================================
   GLOBAL STYLES (UPDATED FOR MODERN TYPOGRAPHY)
   ============================================================ */
html {
    height: 100%;
    scroll-behavior: smooth; 
}

/* ============================================================
   GLOBAL VISITED LINK STYLE
   ============================================================ */
a:visited {
    color: #999999; 
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em; 
}

h4, h5, h6, p, li, span, a, button {
  color: var(--text);
  transition: color 0.3s ease;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.header-container h1,
.header-container a,
.header-container button {
  color: var(--text);
}

.footer p,
.footer a {
  color: var(--text);
}

.footer .social-links a {
  color: var(--accent);
}

.footer {
  background: var(--header-footer-bg);
  color: var(--text);
  text-align: center;
  padding: 10px;
  width: 100%;
  font-size: 0.9rem;
  transition: background 0.4s ease, color 0.4s ease;
  margin-top: 0; 
}

/* ============================================================
   HEADER (Flexbox)
   ============================================================ */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-footer-bg);
  color: var(--text);
  padding: 10px 40px;
  flex-wrap: wrap;
  transition: background 0.4s ease, color 0.4s ease;
}

.header-item:nth-of-type(1) { text-align: left; }
.header-item:nth-of-type(2) { text-align: right; }

.brand-logo {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 50%;
  border-color: black;
  border-width: 2px;
  border-style: solid;
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
#theme-button, #motion-button {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 20px;
  font-size: 1rem;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#theme-button:hover,
#theme-button:focus,
#motion-button:hover,
#motion-button:focus {
  background: var(--accent);
  color: var(--bg);
  text-decoration: underline dotted;
  box-shadow: 0 0 6px var(--accent);
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; 
    align-items: center;
}

.navbar ul li {
  margin: 0 10px;
}

.navbar ul li a, #theme-button, #motion-button {
    font-family: 'Oswald', sans-serif; 
    font-weight: 500; 
    text-transform: uppercase;
    font-size: 1rem;
    padding: 10px 15px; 
    border-radius: 20px;
}

/* Commented out for now. Not 100% sold on it! */
/* .navbar ul li a:hover {
  background: var(--accent);
  color: #000 !important;
} */

.navbar ul li a:visited {
  color: var(--text) !important;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  text-align: center;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   HERO DIVIDER IMAGE
   ============================================================ */
.hero-divider-image {
    width: 100%; 
    display: block;
    margin: 0 auto;
    height: 16px; 
    object-fit: cover;
    transform: translateY(-1px); 
    z-index: 10;
}

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

/* ============================================================
   HERO OVERLAY + FLIP CLOCK STYLES
   ============================================================ */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  align-items: center;     
  padding-top: 50px; 
}

.hero-overlay h2,
.hero-overlay p {
  color: #ffffff;
  z-index: 10;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8); 
}

.hero-countdown-display {
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    display: flex;
    gap: 15px;
    align-items: flex-end; 
}

.hero-countdown-segment {
    background-color: #2e2d2d; 
    padding: 10px 15px; 
    border-radius: 6px;
    border: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-countdown-value {
    font-size: 3rem; 
    font-weight: 550;
    line-height: 1;
    color: #dedddd;
}

.hero-countdown-label {
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 5px;
    color: #cccccc;
}

@media (max-width: 600px) {
    .hero-countdown-segment {
        padding: 10px 15px;
        gap: 0;
    }
    .hero-countdown-value {
        font-size: 2.5rem; 
    }
    .hero-countdown-label {
        font-size: 0.65rem;
    }
}

.hero-overlay h2,
.hero-overlay p {
  color: #ffffff;
}

/* ============================================================
   INTRO CARD (Modern Floating Block)
   ============================================================ */
   
.intro-card {
  background: var(--card-bg);
  padding: 30px 40px;
  border-radius: 0; 
  text-align: center;
  
  position: relative;
  z-index: 50;
  
  margin-top: 30px;
  margin-bottom: 30px;
  
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
}

.intro-card h2 {
    font-size: 1.8rem;
    margin-top: 0; 
}

/* ============================================================
   CARDS + GRID ELEMENTS
   ============================================================ */
.container { 
  max-width: 1000px; 
  margin: 30px auto;
  padding: 0 20px; 
}

.event-grid, .schedule-grid { 
  display: flex; 
  gap: 20px; 
  flex-wrap: wrap; 
}

.card, .schedule-card {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 0;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease; 
}

.card:hover, .schedule-card:hover {
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

body.dark-mode .card,
body.dark-mode .schedule-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card img, .schedule-card img {
  width: 100%;
  border-radius: 0;
  margin-bottom: 10px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.ghost-btn:hover { 
  background: var(--accent); 
  color: #000; 
}

/* ============================================================
   CARD CONTENT FIXES (Global, Fan Chat, Schedule)
   ============================================================ */
.card ul {
    list-style-position: inside;
    margin: 5px 0 10px 0; 
}

.schedule-card h3 {
  min-height: 3em; /* Ensures all h3s take up the same vertical space */
}

/* ============================================================
   FAN CHAT CARD (Left Card) FIXES
   ============================================================ */
.event-grid .card:first-child {
    padding: 0; 
}

.event-grid .card:first-child img {
    border-radius: 0; 
    margin-bottom: 0; 
}

.event-grid .card:first-child h3,
.event-grid .card:first-child ul {
    padding: 0 15px; 
}
.event-grid .card:first-child h3 {
    padding-top: 20px;
    padding-bottom: 18px; 
}
.event-grid .card:first-child ul {
    padding-bottom: 15px; 
}

.event-grid .card:first-child li {
    list-style: none;
    position: relative;
    padding: 8px 15px 8px 30px;
    margin-bottom: 8px;
    background: var(--header-footer-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    
    transition: all 0.2s ease;
}

.event-grid .card:first-child li:hover {
    border-color: var(--accent);
}

.event-grid .card:first-child li::before {
    content: "🏁";
    position: absolute;
    left: 8px;
    font-size: 1.1rem;
    color: var(--accent);
}

/* ============================================================
  I am not the fastest, but I finish.
  I am not the loudest, but I'm heard.
  I am not the flashiest, but I endure.
  What am I?
   ============================================================ */

/* TOP FAN PREDICTIONS STYLES */
.prediction-top-img {
    width: 100%;
    border-radius: 0; 
    margin-bottom: 10px;
}

.prediction-item-card {
    display: flex; 
    align-items: center;
    gap: 15px;
    background: var(--header-footer-bg); 
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 0; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 6px solid transparent; 
    transition: all 0.2s ease;
}

.prediction-driver-img {
    width: 60px; 
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; 
    border: 2px solid var(--card-bg); 
}

.prediction-result {
    margin: 2px 0 0 0;
    font-size: 1.1rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
}

.prediction-team {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.prediction-item-card.winner { 
    border-color: #0000FF;
    background: rgba(0, 0, 255, 0.05); 
}
.prediction-item-card.cadillac-high { 
    border-color: #E60026;
    background: rgba(230, 0, 38, 0.05); 
}
.prediction-item-card.underdog { 
    border-color: #FF8700;
    background: rgba(255, 135, 0, 0.05); 
}

/* ============================================================
   CALENDAR CARD: Image & Clickable Content
   ============================================================ */
.calendar-link-wrapper {
    text-decoration: none; 
    color: inherit; 
    display: block;
    transition: all 0.2s ease;
}

.calendar-card {
    padding: 0; 
}

.calendar-card img {
    border-radius: 0; 
    margin-bottom: 0;
}

.calendar-details {
    padding: 15px 20px 20px 20px; 
}

.action-prompt {
    font-size: 0.9rem;
    color: var(--accent); 
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
}

.event-details-list {
    margin: 10px 0;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.event-details-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.detail-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    color: var(--accent); 
}

.event-details-list p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ============================================================
   UPDATED CSS: EVENT SECTION (WITH NEW STRUCTURE)
   ============================================================ */

.three-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* ============================================================
   CARD HEIGHT FIX FOR EVENT SECTION
   ============================================================ */

.three-column-grid > .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fan-chat-card,
.predictions-podium-card,
.calendar-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.calendar-link-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.calendar-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ============================================================
   UNIFIED CARD CONTENT STYLING (ALL THREE CARDS)
   ============================================================ */

/* All three cards get same padding structure */
.fan-chat-card,
.predictions-podium-card,
.calendar-card {
  padding: 0;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* All card images same height and flush with edges */
.fan-chat-card img,
.predictions-podium-card img,
.calendar-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  margin-bottom: 0;
}

/* Uniform H3 styling across all cards */
.fan-chat-card h3,
.predictions-podium-card h3,
.calendar-card h3 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0;
  padding: 20px 20px 15px 20px;
  text-align: center;
}

/* Unified content list container */
.card-content-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 15px 20px;
  margin: 0;
  flex-grow: 1;
}

/* Unified content items - same as Quick Links style */
.card-content-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--header-footer-bg);
  padding: 8px 12px;
  border-left: 6px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  height: 54px;
  box-sizing: border-box;
}

/* Hover effect like Quick Links */
.card-content-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Color-coded borders */
.card-content-item[data-color="red-bull"] { border-color: #0000FF; }
.card-content-item[data-color="cadillac"] { border-color: #E60026; }
.card-content-item[data-color="mclaren"] { border-color: #FF8700; }

/* Icon styling */
.card-content-item .content-icon {
  font-size: 1.2rem;
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
}

/* Text container */
.card-content-item .content-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  padding-top: 4px;
}

/* Label styling */
.card-content-item .content-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 2px;
  margin-top: 4px;
  line-height: 1.1;
}

/* Name/value styling */
.card-content-item .content-name {
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--text);
}

/* Driver name links - clickable */
.driver-link {
  text-decoration: none;
  color: var(--text) !important;
  transition: color 0.2s ease;
  cursor: pointer;
}

.driver-link:hover {
  color: var(--accent) !important;
  text-decoration: underline;
}

.driver-link .team {
  color: var(--accent);
  font-size: 0.85rem;
}

/* Stats text (predictions card only) */
.prediction-stats {
  text-align: center;
  margin: 0;
  padding: 0 20px 15px 20px;
  font-size: 0.85rem;
  color: #888;
}

/* Bottom link styling - replaces button */
.card-bottom-link {
  display: block;
  text-align: center;
  padding: 0 20px 20px 20px;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.card-bottom-link:hover {
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .three-column-grid {
    grid-template-columns: 1fr;
  }
  .fan-chat-card ul {
    padding: 0 10px;
  }
}

/* ============================================================
   PREDICTIONS GRID (Driver | Driver / Car layout)
   ============================================================ */

.driver-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; 
  justify-content: center;
}

.team-block {
  flex: 1 1 450px; 
  max-width: 550px; 
  display: flex;
  flex-direction: column;
  gap: 15px; 
  padding: 15px;
  background: var(--header-footer-bg); 
  border-radius: 0; 
}

.driver-pair {
  display: flex;
  gap: 15px; 
  justify-content: space-between;
  align-items: flex-start;
}

.driver-card {
  flex: 1 1 48%; 
  background: var(--card-bg);
  border-radius: 0;
  padding: 10px; 
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, background 0.3s ease;
}

/* Forty-two. The ultimate answer to the ultimate question... of layout.
   Built by Shawn Blackman · 
   https://www.linkedin.com/in/shawn-blackman-gis?
*/

.driver-card img {
  width: 100%;
  aspect-ratio: 4 / 5; 
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
}

.driver-card:hover { 
  transform: scale(1.03); 
}

.car-row {
  width: 100%;
}

.car-card {
  background: var(--card-bg);
  border-radius: 0; 
  padding: 0; 
  text-align: center;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s, background 0.3s ease;
}

.car-card img {
  width: 100%;
  aspect-ratio: 3 / 1; 
  object-fit: cover; 
  border-radius: 0; 
}

.car-card h4 {
  padding: 10px 0; 
  margin: 0; 
}

.car-card:hover { 
  transform: scale(1.03); 
}

.select-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: 0.05em;
  transition: background 0.3s ease;
}

.select-btn:hover { 
  background: #e4c54a; 
}

/* ============================================================
   DRIVER + CAR CARD TYPOGRAPHY & LONG NAME FIX (FINAL)
   ============================================================ */
.driver-card h4,
.car-card h4 {
    color: var(--text); 
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 1.15rem; 
    text-transform: uppercase;
    letter-spacing: 0.05em; 
    margin: 8px 0; 
    text-align: center;
    width: 100%; 
    
    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;  
}

body.dark-mode .driver-card h4,
body.dark-mode .car-card h4 {
    text-shadow: 0 0 5px var(--accent), 
                 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ============================================================
   VIDEO WRAPPER (Responsive 16:9 Aspect Ratio)
   ============================================================ */

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; 
  height: 0;
  overflow: hidden;
  border-radius: 0;
  margin-top: 10px; 
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================
   FOOTER + SOCIAL LINKS
   ============================================================ */
.footer {
  background: var(--header-footer-bg);
  color: var(--text);
  text-align: center;
  padding: 10px;
  width: 100%;
  font-size: 0.9rem;
  transition: background 0.4s ease, color 0.4s ease;
  margin-top: 30px; 
}

.disclaimer {
    font-size: 0.75rem; 
    opacity: 0.7;      
    margin-bottom: 5px; 
}

.social-links {
  margin-top: 6px;
}

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

.social-links a:hover {
  color: #fff;
}

body.light-mode .social-links a:hover {
  color: #000;
}

/* ============================================================
   LINKS GRID (Two-Column Layout)
   ============================================================ */
.links-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; 
    margin-top: 20px;
}

.links-grid .card {
    flex: 1 1 350px; 
    padding: 20px;
}

.video-card {
    text-align: center; 
}

/* ============================================================
   INNER LINK CARDS (Colorized Mini-Cards - The Verge Style)
   ============================================================ */
.link-list-card .link-item-container {
    display: flex;
    flex-direction: column;
    gap: 8px; 
    margin-top: 15px;
}

.link-item-card {
    background: var(--header-footer-bg); 
    padding: 13.5px 15px; 
    border-radius: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 6px solid transparent; 
}

.f1-color-1 { border-color: #E60026; background: rgba(230, 0, 38, 0.05); } 
.f1-color-2 { border-color: #00D2BE; background: rgba(0, 210, 190, 0.05); } 
.f1-color-3 { border-color: #2299FF; background: rgba(34, 153, 255, 0.05); } 
.f1-color-4 { border-color: #FF8700; background: rgba(255, 135, 0, 0.05); } 
.f1-color-5 { border-color: #777777; background: rgba(119, 119, 119, 0.05); }

.link-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    background: var(--header-footer-bg); 
}


.link-item-card a {
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text) !important; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-item-card a span {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 900;
}

.f1-color-1:hover a { color: #E60026 !important; }
.f1-color-2:hover a { color: #00D2BE !important; }
.f1-color-3:hover a { color: #2299FF !important; }
.f1-color-4:hover a { color: #FF8700 !important; }

.link-item-card:hover a {
    text-decoration: underline; 
    opacity: 1;
}

.link-item-card:hover a span {
    color: inherit; 
}

/* ============================================================
   VISITED LINK INDICATOR (for Quick Links Card)
   ============================================================ */

.link-item-card a:visited {
    color: #888888 !important; 
    font-weight: 500; 
}

.link-item-card a:visited:hover {
    color: var(--text) !important; 
    text-decoration: underline;
}

body.dark-mode .link-item-card a:visited {
    color: #666666 !important; 
}

/* ============================================================
   RSVP FORM (Card Styling & Consistency)
   ============================================================ */

.rsvp-main-card {
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-top: 15px; 
    border: 1px solid rgba(0, 0, 0, 0.05); 
}

body.dark-mode .rsvp-main-card {
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rsvp-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    padding-bottom: 30px; 
    border-bottom: 1px solid var(--header-footer-bg);
}

.rsvp-main-card {
    box-shadow: 
        0 0 10px rgba(0, 119, 204, 0.45), 
        0 0 30px rgba(128, 0, 128, 0.2); 
    border-radius: 0;
}

.rsvp-para {
    width: 55%;
    padding-right: 10px;
}

.rsvp-participants {
    width: 45%;
    padding: 15px; 
    border-radius: 0;
    background: var(--header-footer-bg); 
}

.rsvp-participants p {
    margin: 5px 0;
    font-size: 0.9rem; 
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    margin-top: 30px; 
}

/* This CSS Grid is used to align the form labels 
(150px fixed width) and input fields 
(1fr for the rest of the space). */

#rsvp-form {
    display: grid;
    grid-template-columns: 150px 1fr; 
    gap: 15px 20px;
    align-items: center;
}

#rsvp-form label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Oswald', sans-serif; 
    color: var(--text); 
}

#rsvp-form input {
    padding: 10px;
    border: 1px solid var(--text);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box; 
    font-family: 'Inter', Arial, Helvetica, sans-serif; 
}

#rsvp-form input:focus {
    border-color: var(--accent);
    outline: none;
}

/* The use of `!important` is often discouraged but necessary here. 
It ensures that the success/error styling **always** overrides 
the default input field styling and any other base styles applied to inputs. */

.success {
    border-style: solid !important;
    border-width: 3px !important; 
    border-color: #38b000 !important; 
    background: #e0ffe0 !important; 
    box-shadow: none !important;
    animation: none !important; 
}

.error {
    border-style: solid;
    border-width: 3px !important; 
    border-color: #e32636 !important; 
    background: #ffe5e5 !important; 
    color: #a30000 !important;
    animation: error-pulse 1s infinite alternate; 
}

@keyframes error-pulse {
    from {
        box-shadow: 0 0 5px rgba(227, 38, 54, 0.5);
    }
    to {
        box-shadow: 0 0 10px rgba(227, 38, 54, 0.8), 0 0 15px rgba(227, 38, 54, 0.4);
    }
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
   /* 'position: fixed' keeps the button in the same spot on the screen, 
   even as the user scrolls. 
   The `opacity: 0` and `visibility: hidden` 
   hide it until the JS adds the `.show` class. */
.back-to-top {
    position: fixed;
    bottom: 25px; 
    right: 25px; 
    z-index: 9999; 
    
    background: var(--accent);
    color: var(--header-footer-bg); 
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top:hover {
    background: #e4c54a; 
    color: #111111;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------------------
   RESPONSIVE ADJUSTMENT for RSVP
   ------------------------------------------------------------ */
@media (max-width: 700px) {
    .rsvp-container {
        flex-direction: column;
        padding-bottom: 20px;
    }
    
    .rsvp-para, .rsvp-participants {
        width: 100%;
        padding-right: 0;
    }
    
    .rsvp-main-card {
      padding: 20px;
    }
    
    #rsvp-form {
        grid-template-columns: 1fr; 
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .header-container { 
    flex-direction: column; 
    text-align: center; 
  }
  .navbar ul { 
    gap: 8px; 
  }
  .team-block {
      flex-direction: column;
      max-width: 100%;
  }
  .driver-pair {
      flex-direction: column;
      gap: 10px;
  }
  .driver-card, .car-card { 
    flex: 1 1 100%; 
  }
  .footer { 
    font-size: 0.8rem; 
  }
}

/* ============================================================
   DRIVER HIGHLIGHT ANIMATION (ADJUSTED VERSION)
   ============================================================ */
/* The animation keyframes for the driver highlight feature. 
It's a combination of glowing (box-shadow) 
and a more noticeable back-and-forth rotation (wiggle). 
Enhanced with smoother easing and stronger rotation for better visibility. */

@keyframes glow-wiggle {
  0% {
    box-shadow: 0 0 0px var(--accent);
    transform: scale(1) rotate(0deg);
  }
  25% {
    box-shadow: 0 0 15px var(--accent), 0 0 25px rgba(201, 176, 55, 0.3);
    transform: scale(1.03) rotate(-2.5deg);
  }
  50% {
    box-shadow: 0 0 25px var(--accent), 0 0 35px rgba(201, 176, 55, 0.5);
    transform: scale(1.05) rotate(2.5deg);
  }
  75% {
    box-shadow: 0 0 15px var(--accent), 0 0 25px rgba(201, 176, 55, 0.3);
    transform: scale(1.03) rotate(-2.5deg);
  }
  100% {
    box-shadow: 0 0 0px var(--accent);
    transform: scale(1) rotate(0deg);
  }
}

.driver-highlight {
  animation: glow-wiggle 1.2s ease-in-out;
  z-index: 10;
  position: relative;
}

/* ============================================================
   REDUCE MOTION: Disable animations when preference is set
   ============================================================ */
/* Only disable the animated/complex effects, keep basic transitions */
body.reduce-motion .driver-highlight {
  animation: none !important;
}

body.reduce-motion #modal-stage1-img {
  animation: none !important;
  /* Keep instant visibility instead of animated entrance */
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

body.reduce-motion #modal-stage2-img {
  transition: none !important;
  transform: scale(1) !important;
}

/* Also respect system preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .driver-highlight {
    animation: none !important;
  }
  
  #modal-stage1-img {
    animation: none !important;
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
  }
  
  #modal-stage2-img {
    transition: none !important;
    transform: scale(1) !important;
  }
}

/* ============================================================
   SUCCESS MODAL STYLES (Two-stage) - WITH SMOOTH TRANSITIONS
   ============================================================ */

/* This section controls the appearance and animations
   of the two-stage success modal. Stage 1 shows a GIF, Stage 2 shows
   a split-panel message. All transitions are smooth and polished. */

/* Base modal stage container (both stage1 and stage2 sit above page content) */
/* We start with opacity: 0 and display: none.
   When JavaScript adds the 'show' class, we fade in smoothly. */
.modal-stage {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  display: none; /* shown when active */
  align-items: center;
  justify-content: center;
  z-index: 99999;
  background: rgba(0,0,0,0);
  opacity: 0;
  transition: opacity 0.6s ease, background 0.6s ease;
}

/* Stage 1: full-screen GIF center */
.modal-stage.stage1 .stage1-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  outline: none;
}

/* The GIF starts slightly below and scaled down,
   then smoothly animates into position when the modal appears */
#modal-stage1-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  border-radius: 10px;
  transform-origin: center;
  /* Start with subtle offset and scale for smooth entrance */
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

/* When the parent modal gets the 'show' class,
   the image animates to full opacity and proper position */
.modal-stage.show #modal-stage1-img {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Stage 2: split panel (text-left / image-right)
   We'll do a 60/40 split for text emphasis (per your choice B)
*/
.modal-stage.stage2 {
  display: none;
}

.stage2-panel {
  width: min(880px, 94%);
  max-width: 94%;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(250,250,250,1));
  color: #111;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 0;
  align-items: center;
  padding: 26px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

body.dark-mode .stage2-panel {
  background: linear-gradient(180deg, #11141a, #0e1116);
  color: #f2f4f7;
}

.stage2-left {
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.modal-sub {
  margin: 0;
  font-size: 1rem;
  color: rgba(0,0,0,0.7);
}

body.dark-mode .modal-sub {
  color: rgba(255,255,255,0.75);
}

.stage2-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
}

/* The stage 2 image can pulse (scale up/down)
   via JavaScript for extra visual interest */
#modal-stage2-img {
  width: 90%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  transform-origin: center;
  transition: transform 320ms ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* small close button */
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: inherit;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

/* When JavaScript adds 'show' class,
   the modal background fades in and becomes visible */
/* show helpers */
.modal-stage.show {
  display: flex;
  opacity: 1;
  background: rgba(0,0,0,0.75);
}

/* Stage 2 panel starts slightly below and transparent,
   then smoothly slides up and fades in when shown */
/* fade and scale animation for stage2 panel */
.stage2-panel {
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.modal-stage.stage2.show .stage2-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ==========================
   Dark Mode Overrides
   ========================== */

/* Make modal background semi-transparent */
#success-modal-stage1,
#success-modal-stage2 {
  background-color: rgba(0,0,0,0.85); /* instead of solid black */
}

body.dark-mode #modal-close-btn {
  background-color: #333;
  color: #fff;
}

body.dark-mode .hero-countdown-segment {
  background-color: #1e1e1e;
  border-color: #444;
}

body.dark-mode #modal-stage2-img {
  filter: brightness(0.9);
}
