/**
 * hub.css - Styles pour le hub central
 * Design minimaliste, professionnel, gaming
 */

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #151a21;
  --bg-card: #1a1f28;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;
  --border-color: rgba(255, 255, 255, 0.08);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   CONTAINER
   ============================================================================ */

.hub-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.hub-title h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, #b0b5ba);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.hub-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.hub-nav .nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: var(--transition);
}

.hub-nav .nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================================
   CIRCUITS GRID
   ============================================================================ */

.circuits-wrapper {
  flex: 1;
  margin-bottom: 3rem;
}

.circuits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

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

/* ============================================================================
   CIRCUIT CARD
   ============================================================================ */

.circuit-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

/* Logo AA en background */
.circuit-card::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -60px;
  width: 350px;
  height: 350px;
  background-image: url("/assets/team/team_AA.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.08;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo Nordic pour Road to Valhalla */
.circuit-card[data-league="road-to-valhalla"]::before {
  background-image: url("/assets/team/team_NORDIC.png");
  width: 380px;
  height: 380px;
  right: -80px;
}

/* Logo NUC */
.circuit-card[data-league="nuc"]::before {
  background-image: url("/assets/team/team_NUC.png");
  width: 380px;
  height: 380px;
  right: -80px;
}

.circuit-card:hover::before {
  opacity: 0.15;
  transform: translateY(-50%) scale(1.05);
}

.circuit-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(var(--glow-rgb, 102, 126, 234), 0.3);
  transform: translateY(-8px);
}

/* Glow effect spécifique par circuit */
.circuit-card[data-league="weekly-aces"] {
  --glow-rgb: 102, 126, 234;
}

.circuit-card[data-league="road-to-valhalla"] {
  --glow-rgb: 77, 208, 225;
}

.circuit-card[data-league="worldwide"] {
  --glow-rgb: 255, 193, 7;
}

.circuit-card[data-league="no1u"] {
  --glow-rgb: 156, 39, 176;
}

/* Background gradient avec la couleur de la league */
.circuit-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  opacity: 0.8;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.circuit-card:hover .circuit-background {
  height: 10px;
  opacity: 1;
  box-shadow: 0 4px 20px rgba(var(--glow-rgb), 0.5);
}

/* ============================================================================
   CIRCUIT CONTENT
   ============================================================================ */

.circuit-content {
  position: relative;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  z-index: 1;
}

.circuit-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.circuit-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================================
   CIRCUIT INFO
   ============================================================================ */

.circuit-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.circuit-card:hover .circuit-info {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Badge LIVE */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  animation: pulse-live 2s ease-in-out infinite;
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ============================================================================
   CIRCUIT LINKS
   ============================================================================ */

.circuit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.circuit-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
}

.circuit-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: var(--transition);
}

.circuit-link:hover {
  color: var(--text-primary);
}

.circuit-link:hover::after {
  width: 100%;
}

/* ============================================================================
   CIRCUIT CTA
   ============================================================================ */

.circuit-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(
    90deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.circuit-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.circuit-cta:hover::before {
  left: 100%;
}

.circuit-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(var(--glow-rgb), 0.4);
}

.circuit-cta .arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.circuit-cta:hover .arrow {
  transform: translateX(6px);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.hub-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hub-footer p {
  margin: 0;
}

.hub-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hub-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.hub-footer a:hover {
  color: var(--text-primary);
}

.hub-footer .fan-content {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ============================================================================
   LOADING & ERROR STATES
   ============================================================================ */

.loading-state,
.empty-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-state button {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.error-state button:hover {
  background: var(--bg-card);
  border-color: var(--text-secondary);
}

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

@media (max-width: 768px) {
  .hub-container {
    padding: 1rem;
  }

  .hub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .hub-title h1 {
    font-size: 1.5rem;
  }

  .circuit-content {
    padding: 1.5rem;
  }

  .circuit-header h2 {
    font-size: 1.5rem;
  }
}
