/* ============================================================
   UI/UX UPGRADE — Modern Design System
   Layer on top of styles.css for premium look
   ============================================================ */

/* --- Enhanced Custom Properties --- */
:root {
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glass: rgba(255,255,255,0.7);
  --glass-border: rgba(255,255,255,0.3);
  --radius-xl: 28px;
}

/* --- Smoother scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-dark); }

/* --- Better body --- */
body {
  background: #FAFAFA;
  overflow-x: hidden;
}

/* ============================================================
   HEADER — Glassmorphism on scroll
   ============================================================ */
.header {
  transition: all 0.5s var(--ease-smooth);
  backdrop-filter: blur(0px);
}

.header.scrolled {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: all 0.3s var(--ease-out);
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 70%;
}

/* ============================================================
   HERO — Enhanced parallax feel
   ============================================================ */
.hero-fullscreen {
  min-height: 100svh;
}

.hero-content {
  animation: heroFadeUp 1.2s var(--ease-out) 0.3s both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  text-shadow: 0 4px 40px rgba(0,0,0,0.3);
}

.hero-subtitle {
  animation: heroFadeUp 1.2s var(--ease-out) 0.6s both;
}

.hero-cta {
  animation: heroFadeUp 1.2s var(--ease-out) 0.9s both;
}

.hero-badge {
  animation: heroFadeUp 1s var(--ease-out) 0.1s both, badgePulse 3s ease-in-out 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,24,45,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(192,24,45,0); }
}

/* ============================================================
   SECTIONS — Spacing & flow
   ============================================================ */
.section {
  position: relative;
}

/* Diagonal separator between sections */
.section + .section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.1;
}

.section-title {
  position: relative;
  display: inline-block;
}

/* Animated underline on section titles */
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--red);
  border-radius: 4px;
}

.section-header-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Normalize centered section headers — consistent across all sections */
.section-header-center {
  text-align: center;
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.section-header-center .section-label,
.section-header-center .section-title,
.section-header-center .section-desc {
  margin-left: auto;
  margin-right: auto;
}

.section-header-center .section-desc {
  max-width: 640px;
}

/* ============================================================
   STAT ITEMS — Counter animation feel
   ============================================================ */
.stat-item {
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  transform: scaleX(0);
  transition: transform 0.6s var(--ease-out);
  transform-origin: left;
}

.stat-item:hover::before {
  transform: scaleX(1);
}

.stat-item:hover {
  box-shadow: 0 8px 32px rgba(192,24,45,0.1);
  border-color: transparent;
}

.stat-number {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

/* ============================================================
   EDITION CARDS — Premium hover
   ============================================================ */
.edition-card {
  border-radius: var(--radius-xl);
  min-height: 400px;
}

.edition-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  border: 2px solid transparent;
  transition: border-color 0.4s;
  z-index: 2;
  pointer-events: none;
}

.edition-card:hover::after {
  border-color: var(--red);
}

.edition-card:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}

/* ============================================================
   MATCH CARDS — Clean modern look
   ============================================================ */
.match-card {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  padding: 10px 8px;
  transition: all 0.35s var(--ease-bounce);
}

@media (min-width: 768px) {
  .match-card { padding: 16px; }
}

.match-card:hover {
  box-shadow: 0 12px 36px rgba(192,24,45,0.12);
  transform: translateY(-3px);
}

.match-score {
  font-size: 15px;
  background: var(--red-pale);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .match-score { font-size: 18px; padding: 4px 12px; }
}

.match-phase-tag {
  border-radius: 20px;
}

/* ============================================================
   STANDINGS TABLE — Clean design
   ============================================================ */
.standings-table {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
  background: var(--white);
}

.standings-table td {
  transition: background 0.2s;
}

.standings-table tr:hover td {
  background: #FAFBFC;
}

.standings-table .qualified-row td {
  background: #E8F5E9;
}

/* ============================================================
   LEADERBOARD — Premium list
   ============================================================ */
.leaderboard-item {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: all 0.3s var(--ease-bounce);
}

.leaderboard-item:hover {
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.leaderboard-item:first-child {
  background: linear-gradient(135deg, var(--red-pale), #fff);
  box-shadow: 0 4px 20px rgba(192,24,45,0.12);
}

.leaderboard-rank {
  width: 36px;
  height: 36px;
  background: var(--red-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-item:first-child .leaderboard-rank {
  background: var(--red);
  color: var(--white);
}

/* ============================================================
   BRACKET — Premium dark cards
   ============================================================ */
.bracket-match {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease-smooth);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.bracket-match:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

.bracket-team {
  padding: 14px 18px;
}

.bracket-team.winner {
  background: linear-gradient(90deg, var(--red-pale), var(--white));
}

/* ============================================================
   GALLERY — Modern grid with hover reveal
   ============================================================ */
.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gallery-item img {
  transition: transform 0.8s var(--ease-out), filter 0.4s;
}

.gallery-item:hover img {
  transform: scale(1.12);
  filter: brightness(1.1);
}

/* ============================================================
   PARTNERS — Clean hover
   ============================================================ */
.partner-card {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  transition: all 0.35s var(--ease-bounce);
}

.partner-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.03);
}

/* ============================================================
   BUTTONS — Juicy feel
   ============================================================ */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.97);
}

/* ============================================================
   FOOTER — Modern gradient
   ============================================================ */
.footer {
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

/* ============================================================
   SCROLL ANIMATIONS — Enhanced fade-in variants
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children with CSS counters */
.fade-in.visible > *:nth-child(1) { transition-delay: 0s; }
.fade-in.visible > *:nth-child(2) { transition-delay: 0.08s; }
.fade-in.visible > *:nth-child(3) { transition-delay: 0.16s; }
.fade-in.visible > *:nth-child(4) { transition-delay: 0.24s; }

/* Scale-in variant */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-bounce);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   PAGE HERO — Immersive
   ============================================================ */
.page-hero {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero-title {
  text-shadow: 0 4px 30px rgba(0,0,0,0.3);
  animation: heroFadeUp 1s var(--ease-out) 0.2s both;
}

.page-hero-badge {
  animation: heroFadeUp 0.8s var(--ease-out) 0s both;
  backdrop-filter: blur(10px);
}

.page-hero-subtitle {
  animation: heroFadeUp 1s var(--ease-out) 0.4s both;
}

/* ============================================================
   SOCIAL STATS — Glassmorphism cards
   ============================================================ */
.social-stat {
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.35s var(--ease-bounce);
}

.social-stat:hover {
  transform: translateY(-6px) scale(1.03);
  background: rgba(255,255,255,0.25);
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}

.social-stat-number {
  font-size: 2.4rem;
}

/* ============================================================
   CHAMPION CARD — Gold accent
   ============================================================ */
.champion-card {
  border-radius: var(--radius-xl);
  transition: all 0.4s var(--ease-bounce);
  position: relative;
  overflow: hidden;
}

.champion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FFD700, #FFA000, #FFD700);
}

.champion-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(255,215,0,0.15);
  border-color: rgba(255,215,0,0.4);
}

/* ============================================================
   TEAM MODAL — Premium upgrade
   ============================================================ */
.team-modal-content {
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(0,0,0,0.4);
}

.team-modal-header {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(135deg, var(--red), #E91E63);
  padding: 24px 28px;
}

.team-modal-photo {
  transition: transform 0.6s var(--ease-out);
}

.team-modal-body {
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   FORM INPUTS — Modern floating feel
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  transition: all 0.3s var(--ease-smooth);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 6px rgba(192,24,45,0.08);
  transform: translateY(-1px);
}

/* ============================================================
   HOTEL CARDS — Interactive
   ============================================================ */
.hotel-card {
  border-radius: var(--radius-lg);
  transition: all 0.35s var(--ease-bounce);
}

.hotel-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

/* ============================================================
   INFO CARDS — Geneve page
   ============================================================ */
.info-card {
  border-radius: var(--radius-xl);
  transition: all 0.4s var(--ease-bounce);
  border: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(192,24,45,0.1);
}

.info-card:hover .info-card-icon {
  transform: scale(1.2) rotate(-5deg);
}

.info-card-icon {
  transition: transform 0.4s var(--ease-bounce);
}

/* ============================================================
   STEP CARDS — Jeu page
   ============================================================ */
.how-step {
  border-radius: var(--radius-xl);
  transition: all 0.4s var(--ease-bounce);
  border: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.how-step:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.08);
}

/* ============================================================
   FILTER TABS — Pill design
   ============================================================ */
.filter-tab {
  border-radius: 50px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  transition: all 0.3s var(--ease-bounce);
}

.filter-tab:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(192,24,45,0.1);
}

.filter-tab.active {
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(192,24,45,0.25);
  transform: translateY(-1px);
}

.filter-select {
  border-radius: 50px;
  border: 2px solid var(--gray-200);
  padding: 10px 20px;
  transition: all 0.3s var(--ease-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%234A4A4A'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.filter-select:focus {
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(192,24,45,0.1);
}

/* ============================================================
   MOBILE MENU — Full screen elegant
   ============================================================ */
.mobile-menu {
  background: linear-gradient(180deg, var(--white) 0%, var(--red-pale) 100%);
}

.mobile-menu .mobile-link {
  font-size: 24px;
  letter-spacing: 3px;
  transition: all 0.3s;
}

.mobile-menu .mobile-link:hover {
  color: var(--red);
  transform: translateX(10px);
}

/* ============================================================
   SMOOTH PAGE TRANSITIONS (on load)
   ============================================================ */
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  animation: pageIn 0.5s var(--ease-out);
}

/* ============================================================
   RESPONSIVE POLISH
   ============================================================ */
@media (max-width: 767px) {
  .section {
    padding: 48px 0;
  }

  .stat-item {
    padding: 20px 12px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .match-card {
    padding: 10px 8px;
  }

  .match-score {
    font-size: 14px;
    padding: 2px 6px;
  }

  .match-team { font-size: 11px; }
  .match-team-name { max-width: 80px; }
  .match-time { font-size: 11px; }
  .match-phase-tag { font-size: 8px; }

  .hero-title {
    letter-spacing: 2px;
  }

  .club-card {
    padding: 18px 12px;
  }

  .club-logo {
    width: 60px;
    height: 60px;
  }

  .edition-card {
    min-height: 300px;
    padding: 24px;
  }

  .page-hero {
    min-height: 35vh;
    padding: 100px 0 50px;
  }

  .page-hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .team-modal-content {
    border-radius: var(--radius-lg);
    margin: 10px;
  }

  .bracket-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    min-width: unset;
  }

  .compo-pitch {
    height: 200px;
  }

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

  .roster-list {
    grid-template-columns: 1fr;
  }

  .social-stat-number {
    font-size: 1.8rem;
  }

  .footer-grid {
    gap: 24px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .section {
    padding: 64px 0;
  }

  .club-card {
    padding: 20px 14px;
  }
}

/* ============================================================
   TOUCH DEVICE — Larger targets, no hover dependent
   ============================================================ */
@media (hover: none) {
  .club-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  .club-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .match-card:hover {
    transform: none;
  }

  .match-card:active {
    transform: scale(0.98);
  }

  .btn:hover::before {
    display: none;
  }

  .btn:active {
    transform: scale(0.95);
  }
}

/* ============================================================
   REDUCED MOTION — Accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in, .scale-in, .fade-in-left, .fade-in-right {
    opacity: 1;
    transform: none;
  }
}
