/* =====================================================
   ESTADÍSTICAS AVANZADAS — CSS
   Mobile-first. Glassmorphism. Dark/Light mode aware.
   ===================================================== */

/* ── Section wrapper ────────────────────────────────── */
.adv-section {
    margin: 2rem 0 1.5rem;
}

.adv-section__title {
    margin-bottom: 1.2rem;
}

/* ── Metric Cards Grid ──────────────────────────────── */
.adv-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.adv-card {
    position: relative;
    border-radius: 14px;
    padding: 18px 16px;
    background: rgba(8, 12, 30, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.adv-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    border-radius: 14px 14px 0 0;
}

.adv-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.adv-card__value {
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.adv-card__label {
    font-size: clamp(10px, 1.1vw, 13px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
}

.adv-card__tooltip {
    font-size: clamp(9px, 0.85vw, 11px);
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-top: 2px;
}

/* Light mode */
body.light-mode .adv-card {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .adv-card__value {
    color: #1a1a2e;
}

body.light-mode .adv-card__label {
    color: rgba(0, 0, 0, 0.55);
}

body.light-mode .adv-card__tooltip {
    color: rgba(0, 0, 0, 0.4);
}

/* ── Tendencia de Forma ─────────────────────────────── */
.adv-trend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

.adv-trend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(8, 12, 30, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.adv-trend-arrow {
    font-size: 28px;
    font-weight: 900;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.adv-trend-arrow--up {
    color: #00e676;
    background: rgba(0, 230, 118, 0.15);
}

.adv-trend-arrow--down {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.15);
}

.adv-trend-arrow--neutral {
    color: #90a4ae;
    background: rgba(144, 164, 174, 0.15);
}

.adv-trend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.adv-trend-label {
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.adv-trend-detail {
    font-size: clamp(9px, 0.85vw, 11px);
    color: rgba(255, 255, 255, 0.5);
}

body.light-mode .adv-trend-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .adv-trend-label {
    color: #333;
}

body.light-mode .adv-trend-detail {
    color: #666;
}

/* ── Radar Chart ────────────────────────────────────── */
.adv-radar-wrap {
    max-width: 480px;
    margin: 0 auto 1.5rem;
    aspect-ratio: 1 / 1;
}

/* ── Shot Zones ─────────────────────────────────────── */
.adv-zones-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

.adv-zone-card {
    text-align: center;
    padding: 16px 10px;
    border-radius: 12px;
    background: rgba(8, 12, 30, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.adv-zone-pct {
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.adv-zone-pct--good {
    color: #00e676;
}

.adv-zone-pct--mid {
    color: #ffab40;
}

.adv-zone-pct--bad {
    color: #ff5252;
}

.adv-zone-name {
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 6px;
}

.adv-zone-detail {
    font-size: clamp(9px, 0.85vw, 11px);
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

body.light-mode .adv-zone-card {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .adv-zone-pct {
    color: #1a1a2e;
}

body.light-mode .adv-zone-name {
    color: #555;
}

body.light-mode .adv-zone-detail {
    color: #888;
}

/* ── Tiros por cuarto bars ──────────────────────────── */
.adv-quarter-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 120px;
    margin-bottom: 1.5rem;
    padding: 0 8px;
}

.adv-quarter-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.adv-quarter-bar__fill {
    width: 100%;
    max-width: 52px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #ff8a00, #e52e71);
    min-height: 4px;
    transition: height 0.6s ease;
    position: relative;
}

.adv-quarter-bar__pct {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}

.adv-quarter-bar__label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

body.light-mode .adv-quarter-bar__pct {
    color: #333;
}

body.light-mode .adv-quarter-bar__label {
    color: #777;
}

/* ── Consistencia Badge ─────────────────────────────── */
.adv-streaks {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.adv-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 138, 0, 0.2);
    border: 1px solid rgba(255, 138, 0, 0.4);
}

.adv-streak-badge__icon {
    font-size: 16px;
}

.adv-streak-badge--hot {
    background: rgba(230, 81, 0, 0.25);
    border-color: rgba(255, 111, 0, 0.5);
}

body.light-mode .adv-streak-badge {
    color: #333;
    background: rgba(255, 138, 0, 0.12);
    border-color: rgba(255, 138, 0, 0.3);
}

/* ── Equipo: Distribución + EOE ─────────────────────── */
.adv-team-highlight {
    display: flex;
    gap: 20px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.adv-team-big-stat {
    flex: 1;
    min-width: 200px;
    padding: 24px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(8, 12, 30, 0.55), rgba(20, 35, 78, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    text-align: center;
}

.adv-team-big-stat__val {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    color: #ff8a00;
    line-height: 1;
}

.adv-team-big-stat__label {
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
}

.adv-team-big-stat__hint {
    font-size: clamp(9px, 0.8vw, 11px);
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

body.light-mode .adv-team-big-stat {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(240, 245, 255, 0.8));
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .adv-team-big-stat__val {
    color: #e65100;
}

body.light-mode .adv-team-big-stat__label {
    color: #555;
}

body.light-mode .adv-team-big-stat__hint {
    color: #999;
}

/* ── Donut Distribution Chart ───────────────────────── */
.adv-donut-wrap {
    max-width: 280px;
    margin: 0 auto 1.5rem;
}

/* ── Top eFG% mini table ────────────────────────────── */
.adv-mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: clamp(11px, 1vw, 14px);
}

.adv-mini-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 800;
    font-size: clamp(10px, 0.9vw, 12px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.adv-mini-table td {
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.adv-mini-table tr:hover td {
    background: rgba(255, 138, 0, 0.08);
}

body.light-mode .adv-mini-table th {
    color: #777;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .adv-mini-table td {
    color: #333;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .adv-mini-table tr:hover td {
    background: rgba(255, 138, 0, 0.05);
}

/* ── Sub-section titles ─────────────────────────────── */
.adv-subtitle {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.8rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.light-mode .adv-subtitle {
    color: #444;
}

/* =====================================================
   RESPONSIVE — Tablet → Desktop
   ===================================================== */
@media (min-width: 769px) {
    .adv-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .adv-trend-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .adv-radar-wrap {
        max-width: 400px;
    }

    .adv-quarter-bars {
        height: 160px;
    }
}

/* ── Phone tweaks ───────────────────────────────────── */
@media (max-width: 480px) {
    .adv-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .adv-card {
        padding: 14px 12px;
    }

    .adv-trend-grid {
        grid-template-columns: 1fr;
    }

    .adv-zones-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .adv-quarter-bars {
        height: 100px;
    }

    .adv-radar-wrap {
        max-width: 300px;
    }

    .adv-team-highlight {
        flex-direction: column;
    }

    .adv-team-big-stat {
        min-width: 0;
    }

    .adv-streaks {
        gap: 6px;
    }
}
