/* ============================================
   Leaderboard Styles
   ============================================ */

.leaderboard-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 80px 20px;
  min-height: 100vh;
}

.leaderboard-section .section-title {
  color: white;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-align: center;
}

.leaderboard-section .section-description {
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.methodology-link {
  color: #ffd700;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 215, 0, 0.4);
  transition: border-color 0.2s ease;
}

.methodology-link:hover {
  border-bottom-color: #ffd700;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Leaderboard Cards */
.leaderboard-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.leaderboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.leaderboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Rank-specific colors */
.leaderboard-card.rank-legend::before { background: linear-gradient(90deg, #ffd700, #ffed4e); }
.leaderboard-card.rank-headliner::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.leaderboard-card.rank-session::before { background: linear-gradient(90deg, #48bb78, #38a169); }
.leaderboard-card.rank-garage::before { background: linear-gradient(90deg, #ed8936, #dd6b20); }
.leaderboard-card.rank-broken::before { background: linear-gradient(90deg, #fc8181, #f56565); }

/* Leaderboard Header */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.leaderboard-position {
  font-size: 1.5rem;
  font-weight: 800;
  color: #cbd5e0;
  min-width: 50px;
}

.leaderboard-rank-badge {
  flex: 1;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaderboard-rank-badge.rank-legend {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #744210;
}

.leaderboard-rank-badge.rank-headliner {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.leaderboard-rank-badge.rank-session {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
}

.leaderboard-rank-badge.rank-garage {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
  color: white;
}

.leaderboard-rank-badge.rank-broken {
  background: linear-gradient(135deg, #fc8181, #f56565);
  color: white;
}

.leaderboard-score {
  font-size: 1.75rem;
  font-weight: 800;
  color: #2d3748;
  min-width: 80px;
  text-align: right;
}

.leaderboard-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 20px 0;
  line-height: 1.3;
}

/* Checks */
.leaderboard-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.check-item {
  background: #f7fafc;
  border-radius: 8px;
  padding: 10px 12px;
  transition: background 0.2s ease;
}

.check-item.perfect { background: #c6f6d5; }
.check-item.partial { background: #fefcbf; }
.check-item.fail { background: #fed7d7; }

.check-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.check-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
}

.check-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4a5568;
}

.check-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.check-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.check-item.perfect .check-bar-fill { background: #48bb78; }
.check-item.partial .check-bar-fill { background: #ecc94b; }
.check-item.fail .check-bar-fill { background: #fc8181; }

.check-detail {
  font-size: 0.8rem;
  color: #718096;
  font-weight: 500;
}

/* Meta */
.leaderboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.meta-tool,
.meta-date,
.meta-loc {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: #edf2f7;
  color: #4a5568;
  font-weight: 600;
}

/* Warnings */
.leaderboard-warning,
.leaderboard-broken {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.leaderboard-warning {
  background: #fefcbf;
  color: #744210;
}

.leaderboard-broken {
  background: #fed7d7;
  color: #742a2a;
}

/* Footer links */
.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: white;
  border-bottom-color: white;
}

/* Archive section styling */
.archive-section {
  opacity: 0.95;
}

.archive-section .section-title::after {
  content: ' (Legacy View)';
  font-size: 0.5em;
  color: #a0aec0;
  font-weight: 400;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
  
  .leaderboard-card {
    padding: 20px;
  }
  
  .leaderboard-section .section-title {
    font-size: 2rem;
  }
  
  .leaderboard-header {
    flex-wrap: wrap;
  }
  
  .leaderboard-position {
    font-size: 1.25rem;
    min-width: auto;
  }
  
  .leaderboard-score {
    font-size: 1.5rem;
    min-width: auto;
  }
  
  .leaderboard-rank-badge {
    flex-basis: 100%;
    order: 3;
  }
}
