/* ===== VARIABLES ===== */
:root {
  --celeste-100: #E1F5FE;
  --celeste-200: #B3E5FC;
  --celeste-300: #81D4FA;
  --celeste-400: #4FC3F7;
  --celeste-500: #29B6F6;
  --celeste-600: #03A9F4;
  --celeste-700: #039BE5;
  --celeste-800: #0288D1;
  --celeste-900: #01579B;

  --dorado-300: #FFE082;
  --dorado-400: #FFD54F;
  --dorado-500: #FFD700;
  --dorado-600: #D4AF37;
  --dorado-700: #B8960C;

  --blanco: #FFFFFF;
  --blanco-80: rgba(255, 255, 255, 0.8);
  --blanco-60: rgba(255, 255, 255, 0.6);
  --blanco-30: rgba(255, 255, 255, 0.3);
  --blanco-10: rgba(255, 255, 255, 0.1);

  --sombra-dorada: 0 0 20px rgba(255, 215, 0, 0.3);
  --sombra-card: 0 4px 15px rgba(0, 0, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Archivo', sans-serif;

  --max-width: 1440px;
  --navbar-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

body {
  font-family: var(--font-body);
  color: var(--blanco);
  min-height: 100vh;
  background: linear-gradient(165deg, var(--celeste-400) 0%, var(--celeste-700) 50%, var(--celeste-900) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 48px;
}

/* ===== UTILITIES ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 1.5vw, 1.4rem); }

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

a:hover {
  color: var(--dorado-300);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== SECTION TITLES ===== */
.section {
  padding: 60px 0;
}

.section__title {
  text-align: left;
  margin-bottom: 40px;
  color: var(--blanco);
  text-shadow: var(--sombra-dorada);
  position: relative;
  font-size: 1.8rem;
}

.section__title i {
  margin-right: 10px;
  color: var(--dorado-500);
}

.section__title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--dorado-500), transparent);
  margin: 12px 0 0;
}

/* ===== CARDS ===== */
.card {
  background: rgba(1, 87, 155, 0.35);
  border: 1px solid var(--dorado-600);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra-dorada);
}

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--dorado-600);
}

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

thead th {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
  color: var(--dorado-500);
  padding: 10px 12px;
  text-align: center;
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-weight: 600;
}

.team-cell img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--gold {
  background: linear-gradient(135deg, var(--dorado-500), var(--dorado-600));
  color: var(--celeste-900);
}

.btn--gold:hover {
  background: linear-gradient(135deg, var(--dorado-300), var(--dorado-500));
  box-shadow: var(--sombra-dorada);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--dorado-500);
  border: 1px solid var(--dorado-600);
}

.btn--outline:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: var(--sombra-dorada);
}

/* ===== FOOTER ===== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 48px;
  z-index: 1000;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 2px solid var(--dorado-600);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.footer__share {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__share a {
  color: var(--blanco-60);
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.footer__share a:hover {
  color: var(--dorado-500);
  transform: scale(1.15);
}

.footer__center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__center a {
  color: var(--blanco-60);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer__center a:hover {
  color: var(--dorado-500);
  transform: scale(1.05);
}

.footer-sep {
  color: var(--dorado-700);
  font-size: 0.7rem;
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--blanco-60);
  font-style: italic;
}

/* ===== FLAG PLACEHOLDER ===== */
.flag-img,
.flag-img--lg {
  display: inline-block;
  vertical-align: middle;
}

.flag-img {
  width: 24px;
  height: 18px;
}

.flag-img--lg {
  width: 36px;
  height: 27px;
}

/* flag-icons overrides for consistent sizing */
.fi {
  border-radius: 2px;
}

.team-cell .fi {
  width: 24px;
  height: 18px;
}

.upcoming__team .fi,
.flag-img--lg.fi {
  width: 36px;
  height: 27px;
}

.bracket__team .fi {
  width: 20px;
  height: 15px;
}

.calendar__match-team .fi {
  width: 24px;
  height: 18px;
}

.stat-card__table .team-cell .fi {
  width: 20px;
  height: 15px;
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 540px) {
  .footer__inner {
    padding: 0 12px;
    gap: 8px;
  }

  .footer__share {
    gap: 10px;
  }

  .footer__center a span {
    display: none;
  }

  .footer__center {
    gap: 10px;
  }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] body {
  background: linear-gradient(165deg, #0b152b 0%, #101420 50%, #141218 100%);
}

/* Cards & panels — shift blue → deep navy */
[data-theme="dark"] .card {
  background: rgba(15, 25, 55, 0.5);
  border-color: rgba(212, 175, 55, 0.35);
}

[data-theme="dark"] .upcoming__match {
  background: rgba(15, 25, 55, 0.5);
  border-color: rgba(212, 175, 55, 0.35);
}

/* Section alternating stripes */
[data-theme="dark"] .section[style] {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Navbar — slightly darker glass */
[data-theme="dark"] .navbar {
  background: rgba(0, 0, 0, 0.55);
}

/* Footer — slightly darker glass */
[data-theme="dark"] .footer {
  background: rgba(0, 0, 0, 0.55);
}

/* Smooth theme transition */
body,
.navbar,
.footer,
.card,
.upcoming__match,
.section {
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* ===== FOOTER CONTROLS ===== */
.footer__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Timezone selector */
.tz-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0 10px 0 8px;
  height: 30px;
  transition: all 0.3s;
}

.tz-select-wrapper:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.tz-select-icon {
  font-size: 0.7rem;
  color: var(--blanco-60);
  flex-shrink: 0;
}

.tz-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  color: var(--blanco-80, rgba(255, 255, 255, 0.8));
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  outline: none;
  letter-spacing: 0.3px;
}

.tz-select option {
  background: #1a2744;
  color: #fff;
  padding: 4px 8px;
}

/* ===== DARK MODE TOGGLE BUTTON ===== */

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--blanco-70, rgba(255, 255, 255, 0.7));
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(15deg);
}
