/* ══════════════════════════════════════════════
   FutbolStats Pro — style.css
   Estética: Dark mode, verde neón, tipografía condensada deportiva
   ══════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --bg-base:      #0a0c10;
  --bg-card:      #111318;
  --bg-card-2:    #171b22;
  --bg-input:     #1c2029;
  --border:       #252a35;
  --border-glow:  #00e676;

  --neon:         #00e676;
  --neon-dim:     #00b85a;
  --neon-glow:    rgba(0,230,118,0.18);
  --gold:         #f5c518;
  --red-loss:     #ff4757;
  --blue-draw:    #5c9cf5;

  --text-primary:   #eef0f4;
  --text-secondary: #8892a2;
  --text-muted:     #4d5568;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 70px; /* space for sticky ad */
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── AD ZONES ── */
.ad-zone {
  width: 100%;
  text-align: center;
  position: relative;
  padding: 4px 0;
}
.ad-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.ad-label--inline {
  display: inline;
  margin-right: 8px;
}
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #141820, #1c2235);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  min-height: 90px;
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}
.ad-placeholder--square {
  min-height: 250px;
  max-width: 300px;
}
.ad-placeholder--sticky {
  min-height: 50px;
  max-width: 320px;
}
.ad-zone--top {
  background: #0d1018;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.ad-zone--sidebar {
  margin-bottom: 16px;
}
.ad-zone--footer-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(10,12,16,0.97);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ad-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.ad-dismiss:hover { color: var(--text-primary); }

/* ── HEADER ── */
.site-header {
  background: rgba(10,12,16,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 14px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo-icon { font-size: 24px; }
.logo-text em {
  font-style: normal;
  color: var(--neon);
}
.header-nav {
  display: flex;
  gap: 24px;
}
.header-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--neon); text-decoration: none; }

/* ── HERO ── */
.hero {
  padding: 56px 0 40px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(0,230,118,0.07) 0%, transparent 70%),
    var(--bg-base);
}
.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--neon);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 8vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.hero-title .accent { color: var(--neon); }
.hero-sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

/* ── H2H SECTION ── */
.h2h-section { padding: 32px 0 48px; }

.api-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--gold);
  position: relative;
}
.api-banner code {
  background: rgba(245,197,24,0.15);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.api-icon { font-size: 16px; flex-shrink: 0; }

.selector-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}
.team-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.team-label--a { color: var(--neon); }
.team-label--b { color: var(--gold); }

.autocomplete-wrap { position: relative; }

.team-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.team-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-glow);
}
.team-input::placeholder { color: var(--text-muted); }

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: rgba(0,230,118,0.08); }
.autocomplete-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 2px;
}
.autocomplete-item-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.team-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}
.team-badge-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}
.team-badge-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.team-preview-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 28px;
}
.vs-divider span {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.btn-analyze {
  width: 100%;
  padding: 16px;
  background: var(--neon);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-analyze:hover {
  background: #00ff88;
  box-shadow: 0 0 24px rgba(0,230,118,0.4);
  transform: translateY(-1px);
}
.btn-analyze:active { transform: translateY(0); }
.btn-analyze:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-icon { font-size: 20px; }

/* ── LOADING SPINNER ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 48px;
  color: var(--text-secondary);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--neon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESULTS LAYOUT ── */
.results-section { padding: 8px 0 48px; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

/* ── MATCHUP HEADER ── */
.matchup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 16px;
  margin-bottom: 20px;
}
.mh-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mh-team-badge {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.mh-team-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mh-team--a .mh-team-name { color: var(--neon); }
.mh-team--b .mh-team-name { color: var(--gold); }
.mh-center { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.1em; }

/* ── SUMMARY STATS ── */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.stat-bubble {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
}
.stat-bubble-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-bubble-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-bubble--a .stat-bubble-num { color: var(--neon); }
.stat-bubble--draw .stat-bubble-num { color: var(--blue-draw); }
.stat-bubble--b .stat-bubble-num { color: var(--gold); }
.stat-bubble--total .stat-bubble-num { color: var(--text-primary); }

.win-bar-wrap { margin-top: 16px; }
.win-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  overflow: hidden;
  display: flex;
  margin-bottom: 6px;
}
.win-bar-a { background: var(--neon); height: 100%; transition: width 0.8s ease; }
.win-bar-draw { background: var(--blue-draw); height: 100%; transition: width 0.8s ease; }
.win-bar-b { background: var(--gold); height: 100%; transition: width 0.8s ease; }
.win-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── MATCH LIST ── */
.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 18px;
  background: var(--neon);
  border-radius: 2px;
}

.match-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.match-item:hover { border-color: var(--neon-dim); background: rgba(0,230,118,0.03); }

.match-item-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.match-team {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-team--home { text-align: right; }
.match-team--away { text-align: left; }
.match-team--winner { color: var(--neon); }

.match-score-wrap { text-align: center; }
.match-score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.match-score-sep { color: var(--text-muted); }
.score-a { color: var(--text-primary); }
.score-b { color: var(--text-primary); }
.score-win .score-a { color: var(--neon); }
.score-win-b .score-b { color: var(--gold); }

.match-meta {
  padding: 6px 16px 10px;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--border);
}
.match-meta span { display: flex; align-items: center; gap: 4px; }

.match-detail {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px dashed var(--border);
  animation: slideDown 0.2s ease;
}
.match-detail.open { display: block; }
@keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.goal-list { list-style: none; padding: 8px 0 0; }
.goal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.goal-item .goal-min {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--neon);
  min-width: 36px;
  font-size: 14px;
}
.goal-icon { font-size: 14px; }
.card-item { color: var(--gold); }
.red-card-item { color: var(--red-loss); }
.no-events { color: var(--text-muted); font-size: 13px; padding-top: 8px; }

.detail-expand-btn {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color var(--transition);
}
.detail-expand-btn:hover { color: var(--neon); }
.chevron { transition: transform 0.2s; display: inline-block; }
.chevron.open { transform: rotate(180deg); }

/* ── FORM/RACHA ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-team-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.form-team-title--a { color: var(--neon); }
.form-team-title--b { color: var(--gold); }
.form-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.form-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}
.form-badge--W { background: rgba(0,230,118,0.15); color: var(--neon); border: 1.5px solid var(--neon); }
.form-badge--D { background: rgba(92,156,245,0.15); color: var(--blue-draw); border: 1.5px solid var(--blue-draw); }
.form-badge--L { background: rgba(255,71,87,0.12); color: var(--red-loss); border: 1.5px solid var(--red-loss); }
.form-record {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── ODDS CARD ── */
.odds-card {
  border-color: rgba(245,197,24,0.2);
}
.odds-header {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.odds-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.odd-bubble {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 10px 6px;
}
.odd-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.odd-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}
.odds-disclaimer {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.btn-bet {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--gold), #d4a017);
  color: #000;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), transform var(--transition);
}
.btn-bet:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* ── FOOTER ── */
.site-footer {
  background: #080a0d;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
.footer-logo em { font-style: normal; color: var(--neon); }
.footer-copy { font-size: 11px; color: var(--text-muted); }
.footer-api { font-size: 11px; color: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .results-grid { grid-template-columns: 1fr; }
  .results-sidebar { order: -1; display: flex; gap: 12px; flex-wrap: wrap; }
  .ad-zone--sidebar { margin-bottom: 0; flex: 1; min-width: 200px; }
  .odds-card { flex: 1; min-width: 200px; margin-bottom: 0; }
}
@media (max-width: 620px) {
  .selector-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .vs-divider { padding: 4px 0; }
  .vs-divider span { font-size: 20px; }
  .summary-stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .match-team { font-size: 13px; }
  .match-score { font-size: 20px; }
  .matchup-header { flex-direction: column; gap: 8px; }
  .mh-team { flex-direction: row; }
  .hero-title { font-size: 36px; }
  .header-nav { display: none; }
}
@media (max-width: 400px) {
  .summary-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-bubble-num { font-size: 28px; }
}
