/* Leaderboard-specific styles */

/* Override body overflow from main style.css to allow scrolling */
body {
  overflow-y: auto !important;
  overflow-x: hidden;
  height: auto !important;
}

.container {
  height: auto !important;
  min-height: 100vh;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.back-button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Since Date Display */
.since-date {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 15px 5px 15px;
  letter-spacing: 0.5px;
}

/* Leaderboard Grid */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
  margin: 0 auto;
  max-width: 1800px;
}

@media (min-width: 768px) {
  .leaderboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .leaderboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1600px) {
  .leaderboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Leaderboard Cards */
.leaderboard-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.leaderboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

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

/* Specific card color accents */
.leaderboard-card[data-category="mostFlights"]::before {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.leaderboard-card[data-category="highestAltitude"]::before {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.leaderboard-card[data-category="fastestSpeed"]::before {
  background: linear-gradient(90deg, #eab308, #f59e0b);
}

.leaderboard-card[data-category="mostDistance"]::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.leaderboard-card[data-category="mostHours"]::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.leaderboard-card[data-category="mostAirports"]::before {
  background: linear-gradient(90deg, #ec4899, #db2777);
}

.leaderboard-card[data-category="longestFlight"]::before {
  background: linear-gradient(90deg, #f97316, #ea580c);
}

.leaderboard-card[data-category="longestDuration"]::before {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.leaderboard-card[data-category="mostVisited"]::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 0;
  letter-spacing: 0.5px;
}

/* Card Content */
.card-content {
  min-height: 140px;
}

.loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 40px 0;
  font-size: 14px;
}

.no-data {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 40px 20px;
  font-size: 14px;
  font-style: italic;
}

/* Leaderboard Entries */
.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

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

.leaderboard-entry:last-child {
  margin-bottom: 0;
}

/* Medal/Rank */
.entry-rank {
  font-size: 22px;
  line-height: 1;
  min-width: 30px;
  text-align: center;
}

.entry-rank.medal {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.entry-rank.number {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

/* Entry Info */
.entry-info {
  flex: 1;
  min-width: 0;
}

.entry-registration {
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.entry-aircraft {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Entry Value */
.entry-value {
  text-align: right;
  min-width: 70px;
}

.entry-stat {
  font-size: 18px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 2px;
}

.entry-unit {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Entry Details (for flight-specific info) */
.entry-details {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  gap: 8px;
  align-items: center;
}

.entry-route {
  display: flex;
  align-items: center;
  gap: 4px;
}

.entry-route-arrow {
  opacity: 0.5;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.leaderboard-card {
  animation: fadeIn 0.5s ease forwards;
}

.leaderboard-card:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-card:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-card:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-card:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-card:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-card:nth-child(6) { animation-delay: 0.3s; }
.leaderboard-card:nth-child(7) { animation-delay: 0.35s; }
.leaderboard-card:nth-child(8) { animation-delay: 0.4s; }

/* Responsive adjustments */
@media (max-width: 767px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-icon {
    font-size: 28px;
  }

  .entry-stat {
    font-size: 18px;
  }

  .back-button {
    padding: 6px 12px;
    font-size: 13px;
  }
}
