@font-face {
  font-family: "Formula1";
  src: url("Formula1-Regular_web_0.ttf") format("truetype");
  font-weight: normal;
}

@font-face {
  font-family: "Formula1";
  src: url("Formula1-Bold_web_0.ttf") format("truetype");
  font-weight: bold;
}

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

body {
  font-family: "Formula1", Arial, sans-serif;
  line-height: 1.6;
  color: white;
  background: linear-gradient(135deg, #000000 0%, oklch(0.55 0.21 264.36) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.navbar {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid oklch(0.55 0.21 264.36);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo h2 {
  color: oklch(0.55 0.21 264.36);
  font-weight: bold;
  font-size: 1.8rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 3rem;
  align-items: center;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  transition: all 0.3s;
  font-weight: bold;
  font-size: 1.1rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}

.nav-menu a:hover {
  color: oklch(0.55 0.21 264.36);
}

.nav-menu a.active {
  color: oklch(0.55 0.21 264.36);
  border-bottom: 2px solid oklch(0.55 0.21 264.36);
}

.register-btn {
  background: linear-gradient(135deg, oklch(0.55 0.21 264.36), oklch(0.45 0.21 264.36)) !important;
  color: white !important;
  padding: 0.5rem 1.5rem !important;
  border-radius: 25px !important;
  border: none !important;
  font-weight: bold !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  border-bottom: none !important;
  box-shadow: 0 0 10px rgba(0, 100, 200, 0.3) !important;
}

.register-btn:hover {
  background: linear-gradient(135deg, oklch(0.45 0.21 264.36), oklch(0.35 0.21 264.36)) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px rgba(0, 100, 200, 0.5) !important;
  color: white !important;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 2rem 2rem;
}

/* Championship Header */
.championship-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
  border: 2px solid oklch(0.55 0.21 264.36);
}

.season-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trophy-icon {
  font-size: 1.5rem;
}

.championship-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffd700;
}

/* Main Tabs */
.main-tabs-section {
  margin-bottom: 1.5rem;
  padding-top: 2rem;
}

/* Season Selector */
.season-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.season-selector label {
  color: white;
  font-weight: bold;
  font-size: 1rem;
  white-space: nowrap;
}

.season-selector select {
  padding: 0.75rem 1rem;
  border: 2px solid oklch(0.55 0.21 264.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: "Formula1", Arial, sans-serif;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 180px;
}

.season-selector select:focus {
  outline: none;
  border-color: oklch(0.45 0.21 264.36);
  box-shadow: 0 0 0 3px rgba(0, 100, 200, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.season-selector select:hover {
  background: rgba(255, 255, 255, 0.15);
}

.season-selector select option {
  background: #1e3a8a;
  color: white;
  padding: 0.5rem;
}

/* Tabs and Selector Container */
.tabs-and-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.main-tab-container {
  display: flex;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid oklch(0.55 0.21 264.36);
  max-width: 800px;
  flex: 1;
}

.main-tab-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #1e3a8a;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  font-family: "Formula1", Arial, sans-serif;
  font-size: 1rem;
}

.main-tab-button.active {
  background: oklch(0.55 0.21 264.36);
  color: white;
}

.main-tab-button:hover:not(.active) {
  background: rgba(255, 255, 255, 1);
}

.main-tab-content {
  display: none;
}

.main-tab-content.active {
  display: block;
}

/* Podium Section */
.podium-section {
  margin-bottom: 3rem;
  text-align: center;
}

.podium-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.podium-title h2 {
  font-size: 2rem;
  color: #ffd700;
}

.podium-subtitle {
  color: #ccc;
  margin-bottom: 2rem;
}

.podium-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.podium-driver {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  min-width: 200px;
  position: relative;
}

.podium-driver[data-position="1"] {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.3),
    rgba(255, 193, 7, 0.2)
  );
  border: 2px solid #ffd700;
  transform: scale(1.1);
}

.podium-driver[data-position="2"] {
  background: linear-gradient(
    135deg,
    rgba(192, 192, 192, 0.3),
    rgba(169, 169, 169, 0.2)
  );
  border: 2px solid #c0c0c0;
}

.podium-driver[data-position="3"] {
  background: linear-gradient(
    135deg,
    rgba(205, 127, 50, 0.3),
    rgba(184, 115, 51, 0.2)
  );
  border: 2px solid #cd7f32;
}

.flag-container {
  margin-bottom: 1rem;
}

.flag {
  width: 60px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.flag.spain {
  background: linear-gradient(
    to bottom,
    #aa151b 33%,
    #f1bf00 33%,
    #f1bf00 66%,
    #aa151b 66%
  );
}

.flag.finland {
  background: linear-gradient(
      to right,
      white 35%,
      #003580 35%,
      #003580 65%,
      white 65%
    ),
    linear-gradient(to bottom, white 35%, #003580 35%, #003580 65%, white 65%);
}

.flag.italy {
  background: linear-gradient(
    to right,
    #009246 33%,
    white 33%,
    white 66%,
    #ce2b37 66%
  );
}

.driver-info {
  text-align: center;
}

.driver-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.team-name {
  color: #ccc;
  font-size: 0.9rem;
}

/* Team leaderboard uses same styling as driver leaderboard */

/* Detailed Leaderboard */
.detailed-leaderboard {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
  border: 2px solid oklch(0.55 0.21 264.36);
}

.leaderboard-header {
  display: grid;
  grid-template-columns: 60px 250px 1fr 80px;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 100, 200, 0.2);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: bold;
  align-items: center;
  color: #1e3a8a;
}

.leaderboard-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 60px 250px 1fr 80px;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  align-items: center;
  transition: all 0.3s ease;
  border: 2px solid oklch(0.55 0.21 264.36);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateX(5px);
}

.position-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2rem;
}

.position-cell.p1 {
  background: #ffd700;
  color: #000;
}
.position-cell.p2 {
  background: #c0c0c0;
  color: #000;
}
.position-cell.p3 {
  background: #cd7f32;
  color: #000;
}
.position-cell.other {
  background: rgba(30, 58, 138, 0.8);
  color: #ffffff;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.driver-cell {
  display: flex;
  flex-direction: column;
}

.driver-name {
  font-weight: bold;
  font-size: 1.1rem;
  color: #1e3a8a;
}

.team-name {
  color: #1e3a8a;
  font-size: 0.9rem;
  opacity: 0.8;
}

.race-points {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.race-point {
  padding: 0.3rem;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.9rem;
}

.race-point.points {
  background: rgba(30, 58, 138, 0.2);
  color: #1e3a8a;
}
.race-point.no-points {
  background: rgba(255, 255, 255, 0.3);
  color: #999;
}

.total-points {
  font-weight: bold;
  font-size: 1.3rem;
  color: oklch(0.55 0.21 264.36);
  text-align: center;
}

/* Team drivers section */
.team-drivers {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem;
}

.driver-slots {
  font-size: 0.9rem;
  color: #1e3a8a;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.race-headers {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.race-header {
  font-size: 0.9rem;
  font-weight: bold;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 60px 250px 1fr 80px;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  align-items: center;
  transition: all 0.3s ease;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.position-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2rem;
}

.position-cell.p1 {
  background: #ffd700;
  color: #000;
}
.position-cell.p2 {
  background: #c0c0c0;
  color: #000;
}
.position-cell.p3 {
  background: #cd7f32;
  color: #000;
}
.position-cell.other {
  background: rgba(45, 27, 105, 0.8);
  color: #ffffff;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.driver-cell {
  display: flex;
  flex-direction: column;
}

.driver-name {
  font-weight: bold;
  font-size: 1.1rem;
}

.team-name {
  color: #ccc;
  font-size: 0.9rem;
}

.race-points {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.race-point {
  padding: 0.3rem;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.9rem;
}

.race-point.points {
  background: rgba(46, 213, 115, 0.3);
}
.race-point.no-points {
  background: rgba(255, 255, 255, 0.1);
  color: #999;
}

.total-points {
  font-weight: bold;
  font-size: 1.3rem;
  color: oklch(0.55 0.21 264.36);
  text-align: center;
}

/* Schedule Section */
.schedule-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
  border: 2px solid oklch(0.55 0.21 264.36);
}

.schedule-section h3 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: #1e3a8a;
  border-bottom: 3px solid oklch(0.55 0.21 264.36);
  padding-bottom: 0.5rem;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.schedule-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch; /* Ensure all items stretch to full width */
}

.race-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid oklch(0.55 0.21 264.36);
  border-radius: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
  transition: all 0.3s ease;
  min-height: 100px; /* Consistent minimum height for all race cards */
}

.race-item:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

.race-round {
  font-weight: bold;
  color: #1e3a8a;
  font-size: 1.1rem;
}

.race-type {
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
  min-width: 80px;
}

.race-type.f1,
.race-type.gr3 {
  background: oklch(0.55 0.21 264.36);
  color: white;
  border: 1px solid oklch(0.45 0.21 264.36);
}

.race-type.endurance {
  background: #1e3a8a;
  color: white;
}

.race-type.rally {
  background: #87ceeb;
  color: #1e3a8a;
}

.race-type.break {
  background: #666;
  color: white;
}

/* Race status badges */
.race-status {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 10;
}

.race-status.next {
  background: linear-gradient(135deg, #2ed573, #20bf6b);
  color: white;
  animation: pulse 2s infinite;
}

.race-status:not(.next) {
  background: linear-gradient(135deg, oklch(0.55 0.21 264.36), oklch(0.45 0.21 264.36));
  color: white;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 213, 115, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 213, 115, 0);
  }
}

/* Next race styling */
.race-item.next-race {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(46, 213, 115, 0.1),
    rgba(32, 191, 107, 0.05)
  );
  border: 2px solid #2ed573;
  box-shadow: 0 4px 15px rgba(46, 213, 115, 0.2);
  min-height: 180px; /* Increased height to balance with mid-season break */
}

.race-item.completed {
  position: relative;
  background: rgba(0, 100, 200, 0.1);
  border: 2px solid oklch(0.55 0.21 264.36);
  opacity: 0.8;
}

/* Countdown styling */
.countdown-container {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding: 1.5rem 1rem; /* Increased padding */
  background: rgba(46, 213, 115, 0.1);
  border-radius: 8px;
  border: 1px solid #2ed573;
  text-align: center;
}

.countdown-label {
  font-size: 0.9rem; /* Slightly larger */
  color: #1e3a8a;
  margin-bottom: 0.75rem; /* Increased margin */
  font-weight: bold;
}

.countdown-timer {
  font-size: 1.4rem; /* Larger font */
  font-weight: bold;
  color: #2ed573;
  font-family: "Courier New", monospace;
  line-height: 1.2;
}

.countdown-days,
.countdown-hours,
.countdown-minutes,
.countdown-seconds {
  display: inline-block;
  min-width: 2ch;
}

/* Mid-season break in schedule */
.race-item.mid-season-break {
  background: rgba(102, 102, 102, 0.1);
  border-color: #666;
  grid-template-columns: auto 1fr;
  justify-content: center;
  text-align: center;
  opacity: 0.7;
  min-height: 125px; /* Set specific height to match regular race cards */
  display: flex;
  align-items: center;
  padding: 2rem 1rem; /* Increased padding for better visual balance */
}

.race-location {
  font-weight: 500;
  color: #1e3a8a;
}

.race-day-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.race-day {
  color: #1e3a8a;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0.9;
}

.race-date {
  color: #1e3a8a;
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

.race-times {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.lobby-time,
.race-start-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.time-label {
  font-size: 0.7rem;
  color: #1e3a8a;
  font-weight: bold;
  opacity: 0.8;
}

.time-value {
  font-size: 0.85rem;
  color: oklch(0.55 0.21 264.36);
  font-weight: bold;
}

.lobby-time .time-value {
  color: #2ed573;
}

.race-duration {
  color: oklch(0.55 0.21 264.36);
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
}

/* Race Details and Results */
.race-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
  grid-column: span 2;
}

.race-laps,
.race-tyres {
  font-size: 0.8rem;
  color: #1e3a8a;
  font-weight: 500;
}

.race-laps {
  font-weight: bold;
}

.race-results {
  grid-column: span 6;
  margin-top: 0.5rem;
}

.podium-results {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-item {
  font-size: 0.85rem;
  font-weight: bold;
  color: #1e3a8a;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Completed race styling */
.race-item.completed {
  background: rgba(0, 100, 200, 0.05);
  border-color: oklch(0.55 0.21 264.36);
  position: relative;
}

.race-item.completed .race-round {
  color: oklch(0.55 0.21 264.36);
}

/* Completed status badge for desktop */
.race-item.completed::after {
  content: "✓ COMPLETED";
  position: absolute;
  top: -8px;
  right: -8px;
  background: oklch(0.55 0.21 264.36);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Under construction message */
.under-construction {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 2px solid oklch(0.55 0.21 264.36);
}

.under-construction h3 {
  color: white;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.under-construction p {
  color: #ccc;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.under-construction .construction-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* Performance Chart */
.performance-chart-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
  border: 2px solid oklch(0.55 0.21 264.36);
}

.performance-chart-section h3 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: #1e3a8a;
  border-bottom: 3px solid oklch(0.55 0.21 264.36);
  padding-bottom: 0.5rem;
}

.chart-container {
  position: relative;
  height: 400px;
  margin-bottom: 2rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.95);
  padding: 2rem 0;
  text-align: center;
  border-top: 2px solid oklch(0.55 0.21 264.36);
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-access-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: "Formula1", Arial, sans-serif;
  transition: all 0.3s ease;
}

.admin-access-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #ffffff;
  border: 2px solid oklch(0.55 0.21 264.36);
  margin: 5% auto;
  padding: 2rem;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(30, 58, 138, 0.3);
  position: relative;
  color: #1e3a8a;
}

.admin-modal {
  max-width: 800px;
}

.close {
  color: #ccc;
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 1rem;
  top: 1rem;
  transition: color 0.3s;
}

.close:hover {
  color: oklch(0.55 0.21 264.36);
}

/* Admin Panel Styles */
.admin-section {
  margin-bottom: 2rem;
}

.admin-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid oklch(0.55 0.21 264.36);
}

.admin-tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: rgba(30, 58, 138, 0.1);
  color: #1e3a8a;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  font-family: "Formula1", Arial, sans-serif;
}

.admin-tab-btn.active {
  background: oklch(0.55 0.21 264.36);
  color: white;
}

.admin-tab-btn:hover:not(.active) {
  background: rgba(0, 100, 200, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: white;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  font-family: "Formula1", Arial, sans-serif;
  background: white;
  color: #1e3a8a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: oklch(0.55 0.21 264.36);
  box-shadow: 0 0 0 3px rgba(0, 100, 200, 0.1);
}

.admin-btn {
  background: linear-gradient(135deg, oklch(0.55 0.21 264.36), oklch(0.45 0.21 264.36));
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Formula1", Arial, sans-serif;
}

.admin-btn:hover {
  background: linear-gradient(135deg, oklch(0.45 0.21 264.36), oklch(0.35 0.21 264.36));
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 100, 200, 0.4);
}

.submit-btn {
  background: linear-gradient(135deg, oklch(0.55 0.21 264.36), oklch(0.45 0.21 264.36));
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  font-family: "Formula1", Arial, sans-serif;
}

.submit-btn:hover {
  background: linear-gradient(135deg, oklch(0.45 0.21 264.36), oklch(0.35 0.21 264.36));
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 100, 200, 0.4);
}

.status-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  display: none;
}

.status-message.success {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid #2ed573;
}

.status-message.error {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border: 1px solid #ff4757;
}

.status-message.loading {
  background: rgba(0, 100, 200, 0.2);
  color: oklch(0.55 0.21 264.36);
  border: 1px solid oklch(0.55 0.21 264.36);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background: linear-gradient(135deg, #000000 0%, oklch(0.55 0.21 264.36) 100%);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
    padding: 2rem 0;
    gap: 0;
    border-top: 2px solid oklch(0.55 0.21 264.36);
    height: calc(100vh - 70px);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    margin: 1rem 0;
  }
  
  .nav-menu a {
    color: #ffffff !important;
    font-size: 1.1rem;
    padding: 1rem 0;
    display: block;
    border-bottom: none;
  }
  
  .nav-menu a:hover {
    color: oklch(0.55 0.21 264.36) !important;
  }
  
  .nav-menu a.active {
    color: oklch(0.55 0.21 264.36) !important;
    border-bottom: 2px solid oklch(0.55 0.21 264.36);
  }

  .nav-container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 90px 0.5rem 2rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .championship-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .championship-title {
    font-size: 1.2rem;
  }

  .main-tab-container {
    max-width: 100%;
    margin: 0;
  }

  .main-tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Hide race-by-race points on mobile */
  .leaderboard-header {
    grid-template-columns: 60px 1fr 80px;
  }

  .race-headers {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 60px 1fr 80px;
    padding: 0.75rem;
  }

  .race-points {
    display: none;
  }

  /* Hide team drivers column on mobile for team standings */
  #teamsTab .leaderboard-header {
    grid-template-columns: 60px 1fr 80px;
  }

  #teamsTab .leaderboard-row {
    grid-template-columns: 60px 1fr 80px;
  }

  #teamsTab .team-drivers {
    display: none;
  }

  .driver-cell {
    padding: 0.5rem 0;
  }

  .position-cell {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .driver-name {
    font-size: 1rem;
  }

  .total-points {
    font-size: 1.1rem;
  }

  .chart-container {
    height: 300px;
  }

  /* Hide performance chart on mobile */
  .performance-chart-section {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-content {
    margin: 10% auto;
    padding: 1.5rem;
    width: 95%;
  }

  /* Schedule mobile adjustments */
  .schedule-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Mobile countdown adjustments */
  .countdown-container {
    padding: 0.75rem;
    margin-top: 0.75rem;
  }

  .countdown-timer {
    font-size: 1rem;
  }

  .race-status {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
  }

  .race-item.next-race {
    margin-bottom: 1rem;
  }

  .race-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 0.5rem;
    text-align: center;
    padding: 1rem 0.5rem;
    margin: 0 0.25rem 0.5rem;
    grid-template-areas:
      "round type status"
      "location location location"
      "day-date day-date laps"
      "tyres tyres tyres"
      "results results results";
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
  }

  .race-round {
    grid-area: round;
    font-size: 1.2rem;
    color: oklch(0.55 0.21 264.36);
    font-weight: bold;
    align-self: center;
    justify-self: center;
  }
  
  /* Show race details and results on mobile */
  .race-details {
    display: block;
    grid-area: tyres;
    margin-top: 0.5rem;
  }
  
  .race-results {
    display: block;
    grid-area: results;
    margin-top: 0.5rem;
  }
  
  /* Mobile-specific race details styling */
  .race-details .race-laps {
    grid-area: laps;
    font-size: 0.75rem;
    color: oklch(0.55 0.21 264.36);
    font-weight: bold;
    align-self: center;
    justify-self: center;
  }
  
  .race-details .race-tyres {
    font-size: 0.7rem;
    color: #1e3a8a;
    font-weight: 500;
    text-align: center;
  }
  
  /* Mobile results styling */
  .race-results .podium-results {
    gap: 0.5rem;
    justify-content: center;
  }
  
  .race-results .result-item {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  /* Completed status badge for mobile - override desktop version */
  .race-item.completed::after {
    display: none; /* Hide desktop version */
  }
  
  .race-item.completed::before {
    content: "✓ COMPLETED";
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    background: oklch(0.55 0.21 264.36);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: bold;
    z-index: 10;
    line-height: 1;
  }

  .race-type {
    grid-area: type;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    align-self: center;
    justify-self: center;
  }

  /* Status area for completed badge */
  .race-item .race-status {
    grid-area: status;
    position: relative;
    align-self: center;
    justify-self: center;
  }

  .race-location {
    grid-area: location;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0.25rem 0;
    justify-self: center;
  }

  .race-day-date {
    grid-area: day-date;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    align-self: center;
    text-align: center;
  }

  .race-day,
  .race-date {
    font-size: 0.85rem;
    text-align: center;
  }

  /* Laps info in mobile layout */
  .race-laps {
    grid-area: laps;
    font-size: 0.75rem;
    color: oklch(0.55 0.21 264.36);
    font-weight: bold;
    align-self: center;
    justify-self: center;
  }
  
  /* Mobile race item spacing */
  .race-item.completed {
    padding-top: 1.5rem; /* Extra space for completed badge */
  }
  
  /* Ensure proper spacing between elements */
  .race-item .race-details,
  .race-item .race-results {
    margin-top: 0.5rem;
  }
  
  /* Mobile tyres styling */
  .race-item .race-tyres {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
    margin: 0 auto;
  }

  /* Hide admin modal on mobile */
  .admin-modal {
    display: none;
  }
  
  /* Mobile layout adjustments */
  .tabs-and-selector {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .main-tab-container {
    max-width: 100%;
    margin: 0;
  }
  
  .season-selector {
    justify-content: center;
    margin: 0 0.25rem;
  }
  
  .season-selector select {
    width: 100%;
    text-align: center;
    min-width: auto;
  }
  
  /* Reduce spacing on mobile */
  .main-tabs-section {
    margin-bottom: 1rem;
    padding-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .main-content {
    padding: 80px 0.25rem 2rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .championship-header {
    padding: 0.75rem;
    margin: 0 0.25rem 1rem;
  }

  .championship-title {
    font-size: 1rem;
  }

  .main-tab-container {
    margin: 0 0.25rem;
  }

  .main-tab-button {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }

  .leaderboard-header,
  .leaderboard-row {
    grid-template-columns: 45px 1fr 60px;
    padding: 0.5rem;
    margin: 0 0.25rem 0.5rem;
  }

  .position-cell {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .driver-name {
    font-size: 0.9rem;
  }

  .team-name {
    font-size: 0.8rem;
  }

  .total-points {
    font-size: 1rem;
  }

  .schedule-section,
  .detailed-leaderboard,
  .performance-chart-section {
    padding: 0.75rem;
    margin: 0 0.25rem 1rem;
  }

  .race-item {
    padding: 0.75rem 0.5rem;
    margin: 0 0 0.5rem;
  }

  .race-location {
    font-size: 1rem;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 90px 1rem 2rem;
  }

  .podium-title h2 {
    font-size: 1.5rem;
  }

  .leaderboard-header,
  .leaderboard-row {
    grid-template-columns: 50px 1fr 70px;
    padding: 0.75rem;
  }

  .position-cell {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .driver-name {
    font-size: 1rem;
  }

  .total-points {
    font-size: 1.1rem;
  }
}
/* Video Gallery Styles */
.video-gallery-section {
    width: 100%;
    margin-bottom: 2rem;
}

.featured-video {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 2px solid oklch(0.55 0.21 264.36);
}

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

.video-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.latest-badge {
    background: linear-gradient(135deg, oklch(0.55 0.21 264.36), oklch(0.45 0.21 264.36));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.video-location {
    color: #ccc;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 10px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.previous-races-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 2px solid oklch(0.55 0.21 264.36);
}

.previous-races-section h3 {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    border-bottom: 3px solid oklch(0.55 0.21 264.36);
    padding-bottom: 0.5rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.video-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(0, 100, 200, 0.3);
    transition: all 0.3s ease;
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: oklch(0.55 0.21 264.36);
    transform: translateY(-5px);
}

.video-info {
    margin-bottom: 1rem;
    text-align: center;
}

.video-info h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.video-info p {
    color: #ccc;
    font-size: 0.9rem;
}

/* Mobile video adjustments */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-video {
        padding: 1rem;
    }
    
    .previous-races-section {
        padding: 1rem;
    }
}