/* ===== INDEX PAGE STYLES ===== */

/* ===== FIX: evitar desbordes horizontales en móviles ===== */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Evitar escalados raros en iOS/Safari */
body {
    transform: none !important;
    zoom: 1 !important;
}

/* Asegura que medios e imágenes no empujen el viewport */
img,
svg,
canvas,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Evita que flex/grids generen overflow por min-width implícito */
.grid,
.flex {
    min-width: 0;
}

/* Contenedores grandes: recortar cualquier desbordamiento horizontal */
.max-w-7xl,
section,
.card-dark,
.tabla-posiciones {
    overflow-x: visible;
}

/* Carruseles: nunca más anchos que el viewport */
.pills-carousel {
    max-width: 100%;
}

/* Títulos y textos extensos que puedan provocar desbordes */
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span {
    overflow-wrap: break-word;
}

/* HERO CON CARRUSEL */
.hero {
    min-height: 70vh;
    position: relative;
    overflow: hidden;
}

.banner-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(80, 233, 69, 0.41), rgba(10, 14, 39, 0.95));
}

.banner-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px);
    pointer-events: none;
}

.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--panteras);
    width: 30px;
    border-radius: 6px;
}

/* LIVE MATCH */
.live-match {
    background: linear-gradient(135deg, #1A1E3A, #0A0E27);
    border: 2px solid var(--panteras);
    position: relative;
    overflow: hidden;
}

.live-match::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.live-badge {
    background: linear-gradient(45deg, #0dff00ff, #44ff4dff);
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* CARDS */
.card-dark {
    background: linear-gradient(135deg, #1A1E3A, #0F1229);
    border: 1px solid rgba(69, 233, 118, 0.3);
    transition: all 0.3s ease;
    overflow-x: clip;
}

.card-dark:hover {
    border-color: var(--panteras);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(85, 233, 69, 0.3);
}

/* TABLE */
.tabla-posiciones {
    background: #1A1E3A;
}

/* === Tablas responsivas sin desbordar el viewport === */
.tabla-posiciones {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    max-inline-size: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    contain: inline-size;
    scrollbar-width: thin;
}

.tabla-posiciones table {
    min-width: 360px;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.tabla-posiciones th,
.tabla-posiciones td {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La columna de EQUIPO sí puede romper en 2 líneas en pantallas pequeñas */
@media (max-width: 480px) {

    .tabla-posiciones th:nth-child(2),
    .tabla-posiciones td:nth-child(2) {
        white-space: normal;
        word-break: break-word;
    }

    .tabla-posiciones td .flex {
        min-width: 0;
    }

    .tabla-posiciones td .flex span {
        display: inline-block;
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.clasificacion {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22c55e;
}

.descenso {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef5b44ff;
}

/* STATS BAR */
.stat-bar {
    background: linear-gradient(90deg, var(--panteras) 0%, var(--panteras-dark) 100%);
    height: 8px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.stat-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* GOLEADORES */
.goleador-card {
    background: linear-gradient(135deg, #1A1E3A 0%, #0F1229 100%);
    position: relative;
    overflow: hidden;
}

.ranking-badge {
    background: linear-gradient(135deg, var(--panteras), var(--panteras-dark));
    box-shadow: 0 4px 15px rgba(69, 233, 102, 0.5);
}

/* Ajuste de espacio en nombre de goleadores */
.goleador-card h4 {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FOOTER */
.footer {
    background: #0A0E27;
    border-top: 3px solid var(--panteras);
}

/* LIGA PILLS - Botones compactos de filtro */
.liga-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(15, 18, 41, 0.8);
    border: 1px solid rgba(69, 233, 118, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    scroll-snap-align: start;
}

.liga-pill:hover {
    background: rgba(49, 192, 27, 0.2);
    border-color: var(--panteras);
    transform: translateY(-1px);
}

.liga-pill.active {
    background: linear-gradient(135deg, var(--panteras), var(--panteras-dark));
    border-color: var(--panteras);
    box-shadow: 0 2px 8px rgba(49, 192, 27, 0.4);
}

.liga-pill img {
    filter: brightness(1.2);
}

.liga-pill.active img {
    filter: brightness(1.5) drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* CARRUSEL DE PILLS */
.pills-carousel-container {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    contain: inline-size;
}

.pills-carousel {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 8px;
    padding: 4px 2px;
    max-width: 100%;
}

.pills-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--panteras), var(--panteras-dark));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

.carousel-arrow:hover {
    box-shadow: 0 4px 12px rgba(49, 192, 27, 0.6);
}

.pills-carousel-container:hover .carousel-arrow.visible {
    opacity: 1;
}

.carousel-arrow.left {
    left: 0;
}

.carousel-arrow.right {
    right: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
    }

    .liga-pill {
        padding: 6px 10px;
        font-size: 11px;
    }

    .carousel-arrow {
        display: none;
    }

    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Deshabilitar hover transforms en móvil - no funcionan bien en touch */
    .card-dark:hover {
        transform: none;
    }

    /* Ajustar el truncado de nombres de goleadores */
    .goleador-card h4 {
        max-width: 150px;
    }

    /* Mejorar visualización de partidos en móvil */
    .partido-item {
        padding: 0.75rem 0.5rem;
    }

    .partido-item .text-sm {
        font-size: 0.75rem;
    }

    /* Reducir tamaño del live match en móvil */
    .live-match {
        padding: 1.5rem !important;
    }

    .live-match .bebas.text-3xl {
        font-size: 1.25rem;
    }
}

/* MÓVILES PEQUEÑOS - Ajustes adicionales */
@media (max-width: 480px) {

    /* Nombres de goleadores más pequeños para caber */
    .goleador-card h4 {
        max-width: 100px;
        font-size: 0.75rem;
    }

    .goleador-card .bebas.text-3xl {
        font-size: 1.5rem;
    }

    .ranking-badge {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Tabla de posiciones más compacta */
    .tabla-posiciones table {
        min-width: 320px;
    }

    /* Reducir padding en cards */
    .card-dark {
        padding: 1rem !important;
    }

    /* Hero más pequeño */
    .hero .bebas.text-7xl {
        font-size: 2.5rem !important;
    }

    .hero .text-xl {
        font-size: 1rem !important;
    }

    /* Botones del hero más pequeños */
    .hero .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 0.875rem;
    }

    /* Footer compacto */
    .footer {
        padding: 1.5rem 0;
    }
}