/* ================================================================
   Calcio Finder — PRO THEME (capa visual sobre calcio-finder.css)
   Inspirado en futbuteo.com, adaptado a la marca A10web (#0068FF)
   No modifica clases ni HTML existente: solo repinta y refina.
   ================================================================ */

:where(.calcio-finder-virtual, .calcio-profile, .calcio-card, .cf-search-block, .cf-league, .cp-comparator, .cf-stand-pack, .cf-results, .cf-map-section) {
  /* Paleta de marca sobre base oscura tipo futbuteo */
  --cf-brand:      #0068FF;
  --cf-brand-dark: #0050c8;
  --cf-brand-glow: rgba(0, 104, 255, .35);

  --cf-green:  #22c55e;
  --cf-yellow: #f1c40f;
  --cf-red:    #ef4444;
  --cf-blue:   var(--cf-brand);

  --cf-dark:   #0b1220;   /* fondo base tipo futbuteo */
  --cf-dark2:  #121a2b;   /* paneles */
  --cf-dark3:  #1a2439;   /* hover / bordes internos */

  --cf-bg:     #f4f6fa;
  --cf-white:  #ffffff;
  --cf-border: #e4e8f0;
  --cf-text:   #0b1220;
  --cf-muted:  #6b7686;

  --cf-r:      14px;
  --cf-shadow: 0 8px 28px rgba(11,18,32,.10);
  --cf-shadow-dark: 0 16px 48px rgba(0,0,0,.45);
}

/* ----------------------------------------------------------------
   Base tipográfica
   ---------------------------------------------------------------- */
[data-calcio-search], [data-calcio-comparator],
.calcio-profile, .cf-league, .calcio-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

/* ----------------------------------------------------------------
   BUSCADOR — barra tipo "pill" hero, como futbuteo
   ---------------------------------------------------------------- */
/* Fix de desbordamiento: un <input> dentro de un contenedor flex no se
   encoge por debajo de su ancho intrínseco a menos que min-width se
   fuerce a 0. Sin esto, el buscador del comparador se salía de su
   columna en pantallas estrechas o cuando el padre también es flex. */
.cf-search, .cf-search__bar { min-width: 0; width: 100%; }
.cf-search__input { min-width: 0; }

.cf-search__bar {
  border-radius: 99px;
  border: 2px solid transparent;
  background: var(--cf-white);
  box-shadow: 0 6px 24px rgba(11,18,32,.08);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.cf-search__bar:focus-within {
  border-color: var(--cf-brand);
  box-shadow: 0 8px 32px var(--cf-brand-glow);
  transform: translateY(-1px);
}
.cf-search--dark .cf-search__bar {
  background: var(--cf-dark2);
  border-color: rgba(255,255,255,.08);
  box-shadow: var(--cf-shadow-dark);
}
.cf-search--dark .cf-search__bar:focus-within {
  border-color: var(--cf-brand);
  box-shadow: 0 0 0 4px var(--cf-brand-glow);
}
.cf-search__clear:hover { background: var(--cf-brand); color: #fff; }

.cf-search__drop {
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(11,18,32,.16);
}
.cf-search--dark .cf-search__drop {
  background: var(--cf-dark2);
  border: 1px solid rgba(255,255,255,.08);
}
.cf-ac-item--select:hover,
.cf-search--dark .cf-ac-item:hover { background: rgba(0,104,255,.12) !important; }
.cf-ac-thumb {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(11,18,32,.15);
}

/* ----------------------------------------------------------------
   COMPARADOR — el bloque principal que pediste mejorar
   ---------------------------------------------------------------- */
.cp-comparator {
  background: var(--cf-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(11,18,32,.10);
  border: 1px solid var(--cf-border);
}

.cp-comparator__header {
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(0,104,255,.35), transparent 60%),
    linear-gradient(135deg, var(--cf-dark) 0%, #0f1b33 60%, var(--cf-dark2) 100%);
  padding: 2.5rem 2rem;
  position: relative;
}
.cp-comparator__header::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.25));
  pointer-events: none;
}
.cp-comparator__title {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  background: linear-gradient(90deg, #fff, #cfe0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cp-comparator__sub { color: rgba(255,255,255,.6); }

.cp-comparator__search-row { padding: 2rem; gap: 1.5rem; }

.cp-comparator__col {
  background: var(--cf-bg);
  border: 1px solid var(--cf-border);
  border-radius: 16px;
  padding: 1.1rem 1.1rem 1.3rem;
  transition: border-color .2s;
}
.cp-comparator__col:focus-within { border-color: var(--cf-brand); }
.cp-comparator__label,
.cp-comparator__search-lbl {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em;
  color: var(--cf-brand); text-transform: uppercase;
}

/* Badge VS circular, como un marcador de partido */
.cp-comparator__vs {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  margin: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cf-brand), var(--cf-brand-dark));
  color: #fff;
  font-size: 1rem; font-weight: 900;
  box-shadow: 0 8px 24px var(--cf-brand-glow);
  align-self: center;
}

.cp-comparator__actions { padding: 0 2rem 1.5rem; }
.cp-comparator__btn {
  background: linear-gradient(135deg, var(--cf-brand), var(--cf-brand-dark));
  border: none; border-radius: 99px;
  padding: .9rem 2.2rem;
  font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 10px 28px var(--cf-brand-glow);
  transition: transform .15s, box-shadow .15s;
}
.cp-comparator__btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px var(--cf-brand-glow);
  opacity: 1;
}

.cp-comparator__result { padding: 0 2rem 2rem; }

/* Tabla comparativa: cabecera oscura + barras de progreso detrás del valor */
.cp-cmp-grid {
  border: 1px solid var(--cf-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(11,18,32,.06);
}
.cp-cmp-row--header {
  background: var(--cf-dark);
  padding: 1rem 1.25rem;
}
.cp-cmp-row--stat {
  padding: .85rem 1.25rem;
  position: relative;
}
.cp-cmp-row--stat:nth-child(even) { background: #fafbfd; }
.cp-cmp-row--stat:hover { background: rgba(0,104,255,.05); }

.cp-cmp-a, .cp-cmp-b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.cp-cmp-a.win, .cp-cmp-b.win {
  color: var(--cf-brand);
  font-size: 1.05rem;
  position: relative;
}
.cp-cmp-a.win::after, .cp-cmp-b.win::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cf-brand);
  margin: 0 .35rem;
  vertical-align: middle;
}
.cp-cmp-a.lose, .cp-cmp-b.lose { color: #a7afbd; }

.cp-chart-box {
  background: var(--cf-dark2);
  border-radius: 18px;
  padding: 1.5rem;
}
.cp-chart-box h3 { color: rgba(255,255,255,.55); margin: 0 0 .75rem; }
.cp-chart-note { font-size: .78rem; color: rgba(255,255,255,.4); margin: -.25rem 0 1rem; line-height: 1.4; }

/* Altura fija para el lienzo: sin esto, un <canvas> responsive dentro de
   un grid puede colapsar a una altura mínima y el gráfico "desaparece"
   aunque los ejes se pinten correctamente (el bug de "Goles por temporada"
   en blanco venía de aquí en combinación con datos vacíos). */
.cp-chart-wrap { position: relative; height: 260px; }
.cp-chart-wrap canvas { max-height: 260px; }

.cp-chart-empty {
  height: 260px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: rgba(255,255,255,.35); font-size: .85rem;
  border: 1px dashed rgba(255,255,255,.12); border-radius: 12px; margin: 0;
}

/* ----------------------------------------------------------------
   MAPA DE GEOLOCALIZACIÓN DE CAMPOS
   ---------------------------------------------------------------- */
.cf-map-section {
  background: var(--cf-white);
  border-radius: 20px;
  border: 1px solid var(--cf-border);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(11,18,32,.08);
}
.cf-map-toolbar {
  display: flex; gap: .75rem; align-items: center;
  padding: 1.25rem 1.25rem 1rem;
  flex-wrap: wrap;
}
.cf-map-search { flex: 1; min-width: 220px; }
.cf-map-locate {
  background: var(--cf-brand); color: #fff; border: none;
  border-radius: 99px; padding: .8rem 1.4rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.cf-map-locate:hover { background: var(--cf-brand-dark); transform: translateY(-1px); }
.cf-map-locate:disabled { opacity: .6; cursor: wait; transform: none; }

.cf-map-canvas {
  width: 100%;
  background: #eef1f6;
  z-index: 0; /* evita que Leaflet quede por encima de menús del tema */
}
.cf-map-hint {
  padding: .85rem 1.25rem 1.25rem;
  font-size: .82rem; color: var(--cf-muted); margin: 0;
}

.cf-map-popup strong { display: block; font-size: .95rem; margin-bottom: .2rem; }
.cf-map-popup__loc { font-size: .8rem; color: #6b7686; margin-bottom: .5rem; }
.cf-map-popup__actions { display: flex; gap: .75rem; font-size: .82rem; }
.cf-map-popup__actions a { color: var(--cf-brand); font-weight: 600; text-decoration: none; }
.cf-map-popup__actions a:hover { text-decoration: underline; }
.cf-map-you { font-size: 22px; text-align: center; line-height: 24px; }

/* Mini-mapa embebido en la ficha individual de cada estadio */
.cf-stadium-map {
  height: 280px; border-radius: 14px; overflow: hidden;
  margin-top: 1rem; border: 1px solid var(--cf-border); z-index: 0;
}
.cf-stadium-actions { display: flex; gap: 1rem; margin-top: .75rem; flex-wrap: wrap; }
.cf-link--primary {
  background: var(--cf-brand); color: #fff !important; padding: .6rem 1.2rem;
  border-radius: 99px; font-weight: 700; text-decoration: none !important;
}
.cf-link--primary:hover { background: var(--cf-brand-dark); }

@media (max-width: 640px) {
  .cp-comparator__search-row,
  .cp-comparator__result,
  .cp-comparator__actions { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ----------------------------------------------------------------
   FICHAS DE COMPETICIÓN / TARJETAS
   ---------------------------------------------------------------- */
.cf-comp-card {
  border-radius: 18px;
  border: 1px solid var(--cf-border);
  box-shadow: 0 4px 16px rgba(11,18,32,.06);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cf-comp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(11,18,32,.14);
  border-color: var(--cf-brand);
}
.cf-comp-card__head { background: linear-gradient(135deg, var(--cf-dark), #16213e); }
.cf-comp-card__cta {
  background: var(--cf-brand);
  border-radius: 99px;
  font-weight: 700;
  transition: background .15s;
}
.cf-comp-card__cta:hover { background: var(--cf-brand-dark); }

/* ----------------------------------------------------------------
   PODIUM (clasificaciones)
   ---------------------------------------------------------------- */
.cf-podium__pos--gold   { background: linear-gradient(135deg,#ffd76a,#e8a920); color:#3a2a00; }
.cf-podium__pos--silver { background: linear-gradient(135deg,#e6e9ef,#b9c0cc); color:#232a35; }
.cf-podium__pos--bronze { background: linear-gradient(135deg,#e0a56f,#b06a30); color:#2c1704; }
.cf-podium__logo { box-shadow: 0 4px 14px rgba(11,18,32,.12); }

.cf-rank--gold   { color: #b8860b; font-weight: 800; }
.cf-rank--silver { color: #6d7686; font-weight: 800; }
.cf-rank--bronze { color: #a05a2c; font-weight: 800; }

/* ----------------------------------------------------------------
   BÚSQUEDA POR LIGA / FILTROS EN CASCADA
   ---------------------------------------------------------------- */
.cf-league__hero {
  background: radial-gradient(120% 160% at 0% 0%, rgba(0,104,255,.30), transparent 60%),
              linear-gradient(135deg, var(--cf-dark), #0f1b33);
  border-radius: 20px;
}
.cf-league__btn {
  background: var(--cf-brand);
  border-radius: 99px;
  font-weight: 700;
  transition: background .15s, transform .15s;
}
.cf-league__btn:hover { background: var(--cf-brand-dark); transform: translateY(-1px); }
.cf-league__btn--ghost {
  background: transparent;
  border: 1px solid var(--cf-border);
  color: var(--cf-text);
}
.cf-league__input, .cf-league__sel {
  border-radius: 10px;
  border: 1px solid var(--cf-border);
  transition: border-color .15s;
}
.cf-league__input:focus, .cf-league__sel:focus {
  border-color: var(--cf-brand);
  outline: none;
}

/* ----------------------------------------------------------------
   TABLAS DE CLASIFICACIÓN
   ---------------------------------------------------------------- */
.cf-stand__table { border-radius: 14px; overflow: hidden; }
.cf-stand-tab.is-active,
.cf-tab.is-active {
  background: var(--cf-brand);
  color: #fff;
}

.cf-stand-empty { padding: 1rem 1.1rem; border: 1px dashed var(--cf-border); border-radius: 12px; }
.cf-stand-empty > p { margin: 0; }
.cp-admin-diagnostic { margin-top: .85rem; padding: .75rem .9rem; border-radius: 10px; background: #fff8e1; color: #5f4500; }
.cp-admin-diagnostic summary { cursor: pointer; font-weight: 700; }
.cp-admin-diagnostic code { white-space: normal; overflow-wrap: anywhere; }
