/* F1 Tracker 2026 - Styles */

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

:root {
  --f1-red: #E10600;
  --f1-dark: #15151E;
  --f1-gray: #38383F;
  --f1-light: #F7F4F1;
  --text-light: #FFFFFF;
  --text-dark: #15151E;
  --accent: #FF8700;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--f1-dark) 0%, var(--f1-gray) 100%);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(90deg, var(--f1-red) 0%, #C10000 100%);
  padding: 2rem 0;
  box-shadow: 0 4px 20px rgba(225, 6, 0, 0.3);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
}

header .tagline {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* Next Race Section */
.next-race {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.1) 0%, rgba(255, 135, 0, 0.1) 100%);
  border: 2px solid var(--f1-red);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(225, 6, 0, 0.2);
}

.next-race h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#countdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.race-info h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.race-info p {
  font-size: 1.1rem;
  opacity: 0.8;
}

.countdown-timer {
  display: flex;
  gap: 1.5rem;
}

.time-unit {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 12px;
  min-width: 80px;
  backdrop-filter: blur(10px);
}

.time-unit span {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--f1-red);
  text-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

.time-unit label {
  display: block;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Calendar Section */
.calendar {
  margin: 3rem 0;
}

.calendar h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tab.active {
  background: var(--f1-red);
  border-color: var(--f1-red);
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.4);
}

.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.race-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.race-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--f1-red), var(--accent));
}

.race-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(225, 6, 0, 0.3);
  border-color: var(--f1-red);
}

.race-card.past {
  opacity: 0.6;
}

.race-round {
  display: inline-block;
  background: var(--f1-red);
  color: var(--text-light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.race-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.race-card .location {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.race-card .date {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
}

.race-card .circuit-preview {
  margin-top: 1rem;
  width: 100%;
  height: 120px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.race-card:hover .circuit-preview {
  opacity: 1;
}

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

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(135deg, var(--f1-dark) 0%, var(--f1-gray) 100%);
  padding: 2rem;
  border: 2px solid var(--f1-red);
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(225, 6, 0, 0.5);
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: var(--f1-red);
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.modal-header .circuit-name {
  font-size: 1.2rem;
  opacity: 0.8;
}

.circuit-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.circuit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--f1-red);
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Footer */
footer {
  background: var(--f1-dark);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  border-top: 2px solid var(--f1-red);
}

footer p {
  opacity: 0.7;
  margin: 0.5rem 0;
}

.tech-note {
  font-size: 0.9rem;
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  #countdown {
    grid-template-columns: 1fr;
  }

  .countdown-timer {
    justify-content: center;
  }

  .time-unit {
    min-width: 60px;
  }

  .time-unit span {
    font-size: 2rem;
  }

  .race-grid {
    grid-template-columns: 1fr;
  }

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

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.time-unit span {
  animation: pulse 2s infinite;
}
