/* =============================================
   WBC 2026 - Clásico Mundial de Béisbol
   styles.css - Estilos globales optimizados
   ============================================= */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263548;
  --accent: #e85d04;
  --accent-dark: #c44d03;
  --gold: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3748;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
  --max-width: 1200px;
}

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

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; display: block; }

/* =============================================
   HEADER & NAV
   ============================================= */
.site-header {
  background: rgba(10, 14, 26, 0.97);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.logo span { color: var(--accent); }
.logo .year { color: var(--gold); }

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.main-nav .nav-live {
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  animation: pulse-nav 2s infinite;
}

.main-nav .nav-live:hover { background: var(--accent-dark); }

@keyframes pulse-nav {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 93, 4, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(232, 93, 4, 0); }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 4px;
}

/* =============================================
   AD CONTAINERS - ADSTERRA
   ============================================= */
.ad-container {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  padding: 4px 0;
}

.ad-rectangle {
  width: 300px;
  min-height: 250px;
}

.ad-wide {
  width: 100%;
  min-height: 90px;
}

.ad-wrapper {
  text-align: center;
  padding: 12px 0;
  background: rgba(30, 41, 59, 0.3);
}

.ad-wrapper-sidebar { padding: 0; }

.ad-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a0a05 50%, #0a0e1a 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 16px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '⚾';
  position: absolute;
  font-size: 20rem;
  opacity: 0.03;
  top: -40px;
  right: -40px;
  transform: rotate(15deg);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 93, 4, 0.15);
  border: 1px solid rgba(232, 93, 4, 0.4);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

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

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(232, 93, 4, 0.35);
}

.hero-cta:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(232, 93, 4, 0.45);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }
.hero-stat .num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  display: block;
}
.hero-stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.layout-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.layout-full {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
}

/* =============================================
   SECTION TITLES
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

.section-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.section-link:hover { color: var(--accent); }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* =============================================
   MATCH CARD
   ============================================= */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
  cursor: pointer;
}

.match-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.match-card.live {
  border-color: var(--accent);
  background: rgba(232, 93, 4, 0.08);
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-live {
  background: rgba(232, 93, 4, 0.2);
  color: var(--accent);
  border: 1px solid rgba(232, 93, 4, 0.4);
}

.badge-upcoming {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-finished {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-qf { background: rgba(245, 158, 11, 0.15); color: var(--gold); border: 1px solid rgba(245, 158, 11, 0.3); }

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.match-team.away { flex-direction: row-reverse; text-align: right; }

.team-flag {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.team-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.team-name-short {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-score {
  text-align: center;
  flex-shrink: 0;
}

.score-nums {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-sep { color: var(--text-muted); font-weight: 300; }

.score-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--transition);
}

.btn-watch:hover { background: var(--accent-dark); color: #fff; }

/* =============================================
   STANDINGS TABLE
   ============================================= */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.standings-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.standings-table th:not(:first-child):not(:nth-child(2)) { text-align: center; }

.standings-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(45, 55, 72, 0.5);
}

.standings-table td:not(:first-child):not(:nth-child(2)) { text-align: center; color: var(--text-secondary); }

.standings-table tr:hover td { background: rgba(255,255,255,0.03); }

.standings-table tr.qualified td { border-left: 3px solid var(--success); }
.standings-table tr.eliminated td { opacity: 0.5; }

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

.pos-num {
  width: 20px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pos-num.top { color: var(--gold); }

/* =============================================
   WHERE TO WATCH PAGE
   ============================================= */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.watch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}

.watch-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.watch-card.featured {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.06);
}

.watch-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.watch-platform {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}

.watch-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.watch-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.tag-free { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.tag-premium { background: rgba(245, 158, 11, 0.15); color: var(--gold); }

.btn-platform {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
}

.btn-platform:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Country guide */
.country-guide { margin-top: 32px; }

.country-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover, .tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.country-content { display: none; }
.country-content.active { display: block; }

/* =============================================
   TEAM PAGE
   ============================================= */
.team-hero {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  border-bottom: 1px solid var(--border);
  padding: 40px 16px;
}

.team-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.team-flag-large { font-size: 5rem; }

.team-hero-info h1 {
  font-size: 2rem;
  font-weight: 900;
}

.team-record {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =============================================
   POOL TABS
   ============================================= */
.pool-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.pool-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  background: transparent;
  border: none;
}

.pool-tab.active {
  background: var(--accent);
  color: #fff;
}

.pool-content { display: none; }
.pool-content.active { display: block; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.widget-title {
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.widget-body { padding: 16px; }

.team-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(45, 55, 72, 0.5);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.team-link:last-child { border-bottom: none; }
.team-link:hover { color: var(--accent); }

/* =============================================
   COUNTDOWN
   ============================================= */
.countdown-bar {
  background: linear-gradient(90deg, #1a0a05, var(--bg-card), #1a0a05);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.countdown-bar strong { color: var(--gold); }

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  padding: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-primary); }

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 32px 16px;
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 8px;
}

.page-header h1 em { color: var(--accent); font-style: normal; }

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
}

/* =============================================
   ALERT BOX
   ============================================= */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--gold);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 16px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 10px;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 3px 0;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* =============================================
   UTILS
   ============================================= */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .layout-main { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar > * { flex: 1 1 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-secondary); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); gap: 4px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 16px; border-radius: var(--radius-sm); }
  .menu-toggle { display: flex; }
  .site-header { position: relative; }
  .hero { padding: 32px 16px; }
  .hero-stats { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .layout-full { padding: 20px 16px; }
  .ad-leaderboard { max-width: 320px; min-height: 50px; }
  .team-hero-inner { flex-direction: column; text-align: center; }
  .pool-tabs { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .match-teams { gap: 6px; }
  .team-flag { font-size: 1.4rem; }
  .score-nums { font-size: 1.3rem; }
  .hero h1 { font-size: 1.6rem; }
}
