/* Lights Out League Styles */

:root {
  /* F1 Colors */
  --f1-red: #e10600;
  --f1-red-dark: #b30500;
  --f1-black: #15151e;
  --f1-white: #ffffff;
  --f1-gray: #38383f;
  --f1-gray-light: #67676d;

  /* UI Colors */
  --bg-primary: #0f0f13;
  --bg-secondary: #1a1a23;
  --bg-card: #22222d;
  --bg-hover: #2a2a38;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a8;
  --border-color: #38383f;
  --success: #00d853;
  --warning: #ffc107;
  --danger: #ff4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--f1-red);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--f1-white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: 2.5rem;
  font-family: "Racing Sans One", cursive;
  color: var(--f1-white);
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

/* Navbar */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: "Racing Sans One", cursive;
  font-size: 1.5rem;
  color: var(--f1-white);
}

.logo:hover {
  color: var(--f1-white);
}

.logo-f1 {
  background: var(--f1-red);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--f1-white);
}

.nav-admin {
  color: var(--f1-red) !important;
}

.nav-user {
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-2xl) 0;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-note {
  margin-top: var(--space-sm);
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--f1-red);
  color: white;
}

.btn-primary:hover {
  background: var(--f1-red-dark);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--f1-red);
  color: var(--f1-red);
}

.btn-success {
  background: var(--success);
  color: var(--bg-primary);
}

.btn-warning {
  background: var(--warning);
  color: var(--bg-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--f1-red);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-primary);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tr:hover {
  background: var(--bg-hover);
}

/* Position badges */
.position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
}

.position-1 {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: var(--bg-primary);
}

.position-2 {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: var(--bg-primary);
}

.position-3 {
  background: linear-gradient(135deg, #cd7f32, #a06020);
  color: var(--bg-primary);
}

.position-other {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

/* Alerts */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: rgba(0, 216, 83, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.alert-danger {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-info {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid #007bff;
  color: #007bff;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--f1-white);
  font-family: "Racing Sans One", cursive;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

/* Race cards */
.race-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}

.race-card:hover {
  border-color: var(--f1-red);
}

.race-round {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--f1-red);
  font-family: "Racing Sans One", cursive;
  min-width: 3rem;
}

.race-info {
  flex: 1;
}

.race-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.race-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.race-status {
  font-size: 0.75rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-weight: 600;
}

.status-upcoming {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.status-drivers_assigned {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning);
}

.status-results_imported {
  background: rgba(0, 123, 255, 0.2);
  color: #007bff;
}

.status-completed {
  background: rgba(0, 216, 83, 0.2);
  color: var(--success);
}

/* Driver badge */
.driver-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.driver-code {
  font-weight: 700;
  color: var(--f1-red);
}

/* Allocation grid */
.allocation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.allocation-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.allocation-player {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.allocation-driver {
  font-size: 1.25rem;
  font-weight: 700;
}

.allocation-code {
  font-size: 2rem;
  font-family: "Racing Sans One", cursive;
  color: var(--f1-red);
  margin-top: var(--space-sm);
}

/* Auth forms */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
}

.auth-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--text-secondary);
}

/* Sprint badge */
.sprint-badge {
  display: inline-block;
  padding: 2px 6px;
  background: var(--warning);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: var(--space-sm);
}

/* Hero */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* Actions bar */
.actions-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

/* Standings highlight */
.standings-row.current-user {
  background: rgba(225, 6, 0, 0.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: var(--space-md);
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .race-card {
    flex-direction: column;
    text-align: center;
  }
}
