/**
 * ============================================================================
 * F1 Portal - Features Styles
 * ============================================================================
 */

/* ============================================================================
   LIGHT MODE
   ============================================================================ */

body.light-mode {
  --bg0: #f5f5f7;
  --bg1: #ffffff;
  --bg2: #e8e8ed;
  --txt: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0,0,0,.1);
}

body.light-mode .global-nav {
  background: rgba(255,255,255,.9);
  border-bottom-color: rgba(0,0,0,.1);
}

body.light-mode .hero {
  background: linear-gradient(180deg, #f5f5f7 0%, #e8e8ed 100%);
}

body.light-mode .hero-bg {
  opacity: 0.3;
}

body.light-mode .feature-card,
body.light-mode .page-link,
body.light-mode .countdown-card,
body.light-mode .standings-card,
body.light-mode .quiz-card {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 2px 20px rgba(0,0,0,.05);
}

body.light-mode footer {
  background: #e8e8ed;
}

/* ============================================================================
   THEME TOGGLE BUTTON
   ============================================================================ */

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--txt);
  cursor: pointer;
  transition: all .2s ease;
}

.theme-toggle:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--acc);
  color: var(--acc);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============================================================================
   COUNTDOWN SECTION
   ============================================================================ */

.countdown-section {
  padding: 60px 40px;
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
}

.countdown-card {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
}

.countdown-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.countdown-flag {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.countdown-info h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.countdown-info p {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

.countdown-round {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.countdown-unit {
  text-align: center;
}

.countdown-value {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.countdown-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

.countdown-separator {
  font-size: 48px;
  font-weight: 300;
  color: var(--muted);
  opacity: .3;
  line-height: 1;
}

.countdown-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ============================================================================
   STANDINGS SECTION
   ============================================================================ */

.standings-section {
  padding: 80px 40px;
  background: var(--bg1);
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.standings-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}

.standings-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.standings-card h3 span {
  font-size: 20px;
}

.standing-row {
  display: grid;
  grid-template-columns: 30px 1fr auto 120px 50px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.standing-pos {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.standing-pos:nth-child(1) { color: #FFD700; }
.standing-row:nth-child(1) .standing-pos { color: #FFD700; }
.standing-row:nth-child(2) .standing-pos { color: #C0C0C0; }
.standing-row:nth-child(3) .standing-pos { color: #CD7F32; }

.standing-name {
  font-size: 14px;
  font-weight: 600;
}

.standing-team {
  font-size: 12px;
  text-align: right;
}

.standing-team-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.standing-bar-container {
  height: 8px;
  background: rgba(255,255,255,.05);
  border-radius: 4px;
  overflow: hidden;
}

.standing-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}

.standing-points {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

/* ============================================================================
   QUIZ SECTION
   ============================================================================ */

.quiz-section {
  padding: 80px 40px;
  background: linear-gradient(180deg, var(--bg1), var(--bg0));
}

.quiz-card {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
}

.quiz-progress {
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  border-radius: 3px;
  transition: width .3s ease;
}

.quiz-question-num {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.quiz-question {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 28px 0;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255,255,255,.05);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--txt);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
}

.quiz-option:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
  border-color: var(--acc);
}

.quiz-option.correct {
  background: rgba(60,239,255,.15);
  border-color: var(--acc2);
  color: var(--acc2);
}

.quiz-option.incorrect {
  background: rgba(255,46,99,.15);
  border-color: var(--acc);
  color: var(--acc);
}

.quiz-result {
  text-align: center;
  padding: 20px 0;
}

.quiz-score {
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-percentage {
  font-size: 20px;
  color: var(--muted);
  margin: 8px 0 16px 0;
}

.quiz-message {
  font-size: 18px;
  margin-bottom: 28px;
}

/* ============================================================================
   FAVORITE BUTTON
   ============================================================================ */

.favorite-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s ease;
}

.favorite-btn:hover {
  color: #FFD700;
  transform: scale(1.1);
}

.favorite-btn.is-favorite {
  color: #FFD700;
}

.favorite-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================================
   CIRCUIT CARDS
   ============================================================================ */

.circuit-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all .2s ease;
}

.circuit-card:hover {
  border-color: var(--acc);
  transform: translateY(-4px);
}

.circuit-map {
  height: 180px;
  background: var(--bg2);
  position: relative;
  overflow: hidden;
}

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

.circuit-info {
  padding: 20px;
}

.circuit-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.circuit-location {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px 0;
}

.circuit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.circuit-stat {
  text-align: center;
}

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

.circuit-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============================================================================
   DRIVER PROFILE MODAL
   ============================================================================ */

.driver-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.driver-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(10px);
}

.driver-modal-content {
  position: relative;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.driver-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  z-index: 10;
}

.driver-modal-close:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

.driver-modal-header {
  display: flex;
  gap: 24px;
  padding: 32px;
  border-bottom: 1px solid var(--border);
}

.driver-photo {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255,255,255,.1);
}

.driver-header-info {
  flex: 1;
}

.driver-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  opacity: .2;
}

.driver-name {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.driver-team {
  font-size: 16px;
  margin: 8px 0 0 0;
}

.driver-modal-body {
  padding: 32px;
}

.driver-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.driver-stat-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.driver-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--acc2);
}

.driver-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.driver-bio {
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .countdown-timer {
    gap: 10px;
  }
  
  .countdown-value {
    font-size: 36px;
  }
  
  .countdown-separator {
    font-size: 32px;
  }
  
  .standings-grid {
    grid-template-columns: 1fr;
  }
  
  .standing-row {
    grid-template-columns: 30px 1fr 50px;
  }
  
  .standing-team,
  .standing-bar-container {
    display: none;
  }
  
  .driver-modal-header {
    flex-direction: column;
    text-align: center;
  }
  
  .driver-photo {
    margin: 0 auto;
  }
  
  .driver-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
