/* ============================================
   FIFA World Cup 2026 — Live Tracker Styles
   Dark theme · Glassmorphism · Animated
   ============================================ */

/* ---------- Reset & Fonts ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0b1a;
  --bg-secondary: #111229;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent-live: #ff3366;
  --accent-live-glow: rgba(255, 51, 102, 0.4);
  --accent-scheduled: #00d4ff;
  --accent-finished: #00e676;
  --accent-gold: #ffd700;
  --accent-purple: #7c3aed;
  --accent-orange: #ff6b35;
  --score-bg: rgba(0, 0, 0, 0.4);
  --card-radius: 16px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow-live: 0 0 30px rgba(255, 51, 102, 0.15);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Animated Background ---------- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Container ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ---------- Header ---------- */
.header {
  margin-bottom: 8px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
  animation: trophy-glow 3s ease-in-out infinite;
}

@keyframes trophy-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); }
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.logo-text .highlight {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-year {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 51, 102, 0.1);
  border-radius: 20px;
  animation: indicator-pulse 2s ease-in-out infinite;
}

@keyframes indicator-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 8px var(--accent-live-glow);
  animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.live-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-live);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

/* ---------- Countdown Banner ---------- */
.countdown-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(255, 51, 102, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  animation: fade-up 0.5s ease-out;
}

.countdown-icon {
  font-size: 1.2rem;
}

/* ---------- Status Bar ---------- */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  margin-bottom: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-wrap: wrap;
  gap: 8px;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-icon {
  font-size: 1rem;
}

.status-matches {
  display: flex;
  gap: 10px;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-badge.live {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-live);
}

.status-badge.upcoming {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-scheduled);
}

.status-badge.finished {
  background: rgba(0, 230, 118, 0.1);
  color: var(--accent-finished);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-live), var(--accent-purple));
  opacity: 0;
  transition: opacity var(--transition-med);
  border-radius: 10px;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tab.active .tab-dot {
  background: var(--accent-live);
  box-shadow: 0 0 8px var(--accent-live-glow);
  animation: dot-pulse 1.5s ease-in-out infinite;
}

.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.tab-icon {
  font-size: 1rem;
}

.tab-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 20px;
  text-align: center;
}

.tab.active .tab-count {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Sections ---------- */
.match-section {
  display: none;
  animation: fade-up 0.4s ease-out;
}

.match-section.active {
  display: block;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 12px var(--accent-live-glow);
  animation: dot-pulse 1.5s ease-in-out infinite;
}

.section-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Match Cards Grid ---------- */
.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Loading State ---------- */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-live);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* ---------- Match Card ---------- */
.match-card {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-med);
  cursor: default;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.match-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 60%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.match-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.match-card.live {
  border-color: rgba(255, 51, 102, 0.2);
  box-shadow: var(--shadow-glow-live);
}

.match-card.live:hover {
  box-shadow: var(--shadow-glow-live), var(--shadow-card);
}

/* Match Card—Left: Match Info */

.match-info {
  flex: 1;
  min-width: 0;
}

.match-tournament {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.match-stage {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.match-teams {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-flag {
  font-size: 1.3rem;
  line-height: 1;
  width: 24px;
  height: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-flag img {
  width: 22px;
  height: 16px;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.team-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.team-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

.team-score.score-empty {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Match Meta (Right Side) ---------- */
.match-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  min-width: 80px;
}

.match-status {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 6px;
  text-align: center;
  line-height: 1;
}

.match-status.live {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-live);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.match-status.scheduled {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-scheduled);
}

.match-status.finished {
  background: rgba(0, 230, 118, 0.1);
  color: var(--accent-finished);
}

.match-minute {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-venue {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.match-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ---------- Score Animation ---------- */
@keyframes score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--accent-gold); }
  100% { transform: scale(1); }
}

.score-changed {
  animation: score-pop 0.5s ease-out;
}

/* ---------- Goal Notification Toast ---------- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.9), rgba(124, 58, 237, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(255, 51, 102, 0.3);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 1.3rem;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 20px 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-note {
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.6;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container {
    padding: 12px 10px 40px;
  }

  .header-content {
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .logo-text h1 {
    font-size: 1.2rem;
  }

  .logo-icon {
    font-size: 2rem;
  }

  .tabs {
    gap: 4px;
    padding: 3px;
  }

  .tab {
    padding: 10px 8px;
    font-size: 0.75rem;
    gap: 4px;
  }

  .tab-count {
    display: none;
  }

  .match-card {
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .match-meta {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-width: unset;
  }

  .match-venue {
    text-align: left;
    max-width: none;
  }

  .status-bar {
    padding: 8px 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .status-matches {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 400px) {
  .team-name {
    font-size: 0.8rem;
  }

  .team-score {
    font-size: 1rem;
    min-width: 20px;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
