/* ========== RESET & FONTS ========== */
/* Asegúrate de tener cargada una fuente sans-serif gruesa (como Montserrat, Roboto Condensed o similar) */

.ganadores-content {
    width: 100%;
    min-height: 100vh;
    padding-top: 50px;
    position: relative;
    z-index: 2;
    overflow-x: hidden;
}

.ganadores-container {
    width: 100%;
    margin: 0 auto;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========== SECCIÓN DE FECHAS ========== */
.fechas-selector {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(15px, 2vw, 40px);
    margin-top: 50px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    background-color: transparent;
    z-index: 10;
}

.fecha-option {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    border: none;
    color: #fff;
    font-size: clamp(11px, 1.3vw, 15px);
    font-weight: 800;
    text-transform: uppercase;
    padding: 12px 25px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 180px;
    min-height: 55px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Fondos Específicos */
.fecha-option[data-fecha="02-febrero"] {
    background-image: url('../../../public/assets/img/TrazadoAmarillo.webp');
    color: #4A2C22;
    text-shadow: none;
}

.fecha-option[data-fecha="16-febrero"] {
    background-image: url('../../../public/assets/img/TrazadoNaranja.webp');
    color: #ffffff;
    text-shadow: none;
}

.fecha-option[data-fecha="02-marzo"] {
    background-image: url('../../../public/assets/img/TrazadoCaffe.webp');
    color: #F3C302;
    text-shadow: none;
}

/* Interacción Hover y Active */

/* Asegurar color correcto en hover/active para 02-febrero */
.fecha-option[data-fecha="02-febrero"]:hover,
.fecha-option[data-fecha="02-febrero"].active {
    color: #4A2C22;
    text-shadow: none;
}

/* Asegurar color correcto en hover/active para 16-febrero */
.fecha-option[data-fecha="16-febrero"]:hover,
.fecha-option[data-fecha="16-febrero"].active {
    color: #4A2C22;
    text-shadow: none;
}

/* Asegurar color correcto en hover/active para 02-marzo */
.fecha-option[data-fecha="02-marzo"]:hover,
.fecha-option[data-fecha="02-marzo"].active {
    color: #ffffff;
    text-shadow: none;
}

/* ========== LAYOUT PRINCIPAL ========== */
.main-content-section {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(5px, 1vw, 15px);
    align-items: start;
}

/* ========== COLUMNA IZQUIERDA ========== */
.ganadores-left-section {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 46%) minmax(280px, 54%);
    grid-template-areas:
        "campana promo"
        "premios premios";
    grid-auto-rows: max-content;
    align-content: start;
    align-items: center;
    justify-items: start;
    text-align: left;
    padding: 0 4% 40px 1%;
    border-right: #ffffff 4px solid;
    column-gap: clamp(8px, 1.4vw, 20px);
    row-gap: clamp(5px, 1vw, 10px);
}

/* 1. Sticker Campaña */
.campana-wrapper {
    width: 100%;
    max-width: clamp(320px, 42vw, 540px);
    transform: rotate(-10deg);
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    grid-area: campana;
    align-self: center;
    justify-self: center;
}

.campana-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

/* 2. Texto Promocional */
.ganadores-promo-text {
    width: 100%;
    max-width: clamp(320px, 40vw, 540px);
    display: flex;
    flex-direction: column;
    transform: skewX(-5deg);
    grid-column: 2;
    grid-row: 1;
    grid-area: promo;
    align-self: center;
    justify-self: start;
    margin-top: 0;
    padding: 0;
}

.promo-line {
    margin: 0;
    line-height: 1.1;
}

.promo-white,
.promo-white-bold {
    color: #fff;
    font-style: italic;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.promo-white-bold {
    font-size: clamp(20px, 2.5vw, 32px);
    font-weight: 800;
}

.highlight-lenovo {
    display: inline-block;
    background: #e53935;
    color: #ffffff;
    font-weight: 900;
    font-style: normal;
    padding: 2px 4px;
    border-radius: 6px;
    margin-left: 6px;
    /* text-transform: uppercase; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.promo-white {
    font-size: clamp(18px, 2.2vw, 28px);
    font-weight: 700;
}

.promo-yellow-big {
    color: #F3C302;
    font-size: clamp(22px, 2.8vw, 36px);
    font-weight: 900;
    font-style: italic;
    text-shadow: 2px 2px 0px rgba(160, 80, 0, 0.3);
}

/* 3. Premios (Tablet) */
.premios-wrapper {
    width: 100%;
    max-width: clamp(700px, 90vw, 1000px);
    position: relative;
    z-index: 2;
    grid-column: 1 / span 2;
    grid-row: 2;
    grid-area: premios;
    justify-self: center;
    margin: 0 auto;
    padding: 0 10px;
    z-index: -1;
}

.premios-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* 4. Avión (Posicionado relativo a la columna izquierda) */
.avion-papel {
    position: absolute;
    width: clamp(150px, 15vw, 200px);
    left: 100px;
    bottom: 0%;
    animation: floatPlane 4s ease-in-out infinite;
}

@keyframes floatPlane {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* ========== COLUMNA DERECHA (TABLA) ========== */
.ganadores-right-section {
    padding-top: 10px;
}

.tabla-container-visual {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Logo Flotante Ganadores */
.badge-flotante {
    position: absolute;
    top: -50px;
    left: -30px;
    width: clamp(140px, 20vw, 220px);
    z-index: 10;
}

.ganadores-badge-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

/* Header Amarillo */
.tabla-header {
    background: #F3C302;
    padding: 20px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 5;
    box-shadow: 0 4px 0 rgba(199, 137, 2, 1);
    max-width: 520px;
    margin: 0 auto;
}

/* Reajustar el texto para que el logo no lo tape */
.header-texts {
    flex: 1;
    text-align: center;
    color: #4A2C22;
    padding-left: 140px;
}

.titulo-fecha-img {
    display: inline-block;
    height: auto;
    max-height: 140px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 2px rgba(0,0,0,0.1));
}

/* Wrapper Blanco de la Lista */
.tabla-ganadores-wrapper {
    background: #fff;
    border-radius: 0 0 20px 20px;
    padding: 10px 15px 15px;
    max-width: 540px;
    height: auto;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 4px solid #fff;
    margin: 0 auto;
}

/* Estilos de la Scrollbar */
.tabla-ganadores-wrapper::-webkit-scrollbar {
    width: 8px;
}

.tabla-ganadores-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tabla-ganadores-wrapper::-webkit-scrollbar-thumb {
    background: #F3C302;
    border-radius: 4px;
}

/* Lista de Items */
.tabla-ganadores {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px;
    height: 330px;
}

.ganador-item {
    display: grid;
    grid-template-columns: 30px 50px 1fr 95px;
    align-items: center;
    gap: 15px;
    background-color: #4a332a;
    border-radius: 10px;
    padding: 10px 15px;
    border-left: 6px solid #702f8a;
    border-right: 8px solid #ffc107;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.ganador-item:hover {
    transform: scale(1.02);
}

.ganador-numero {
    display: block;
    color: #ffffff;
    font-weight: 800;
    font-size: 20px;
    text-align: center;
}

.ganador-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #ffca28 0%, #ffb300 100%);
    border-radius: 50%;
    border: 2px solid #e6a000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

.ganador-avatar svg {
    width: 60%;
    height: 60%;
    fill: #f5f5f5;
}

.ganador-nombre {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* PUNTOS */
.ganador-puntos {
    color: #ff9800;
    font-size: 18px;
    font-weight: 900;
    text-align: right;
}

/* ========== MI RANKING STICKY ========== */
.mi-ranking-sticky {
    position: sticky;
    top: -10px;
    z-index: 9;
    /* Reset margins/grid to match ganador-item via class, but override here if needed */
    margin-bottom: 20px;
    /* Optional: Slightly brighter border to distinguish "Me" */
    border: 3px solid #F3C302;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
    /* Ensure background is opaque */
    background-color: #5d3a2e; 
}

/* Adjust responsive for sticky if needed */
@media (max-width: 550px) {
    .mi-ranking-sticky {
        top: -5px;
        margin-bottom: 15px;
    }
}

.ganadores-promo {
    margin: 26px auto 0;
    display: table;
    margin-top: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    text-align: center;
    font-style: italic;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}


/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .main-content-section {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .ganadores-left-section {
        padding: 0 0 30px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "campana"
            "promo"
            "premios";
        align-items: center;
        justify-items: center;
        text-align: center;
        border-right: none;
    }

    .ganadores-promo-text {
        align-items: center;
        transform: skewX(0);
        grid-column: 1;
        max-width: 92%;
        margin-top: 0;
    }

    .avion-papel {
        position: absolute;
        width: clamp(100px, 15vw, 180px);
        left: -50px;
        bottom: -5%;
        z-index: 3;
        animation: floatPlane 4s ease-in-out infinite;
    }

    .tabla-header {
        max-width: 60%;
        justify-content: center;
        padding: 20px;
    }

    .tabla-ganadores-wrapper {
        max-width: 60%;
    }

    .header-texts {
        text-align: center;
        padding-left: 0;
    }

    .badge-flotante {
        width: 140px;
        left: 50px;
        top: -20px;
    }

    .campana-wrapper {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
    }

    .premios-wrapper {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
        margin-left: 0;
        margin-top: 10px;
        width: 90%;
        max-width: 700px;
    }
}

/* ========== RESPONSIVE (MÓVILES PEQUEÑOS < 550px) ========== */
@media (max-width: 550px) {
    .premios-wrapper {
        width: 92%;
        max-width: 550px;
        align-items: flex-start;
    }

    .ganadores-container {
        padding: 0 10px;
    }

    .tabla-header {
        flex-direction: column;
        align-items: flex-end;
        padding: 15px 15px 15px 80px;
    }

    .header-texts {
        text-align: center;
    }



    .badge-flotante {
        width: 110px;
        left: 5px;
        top: -20px;
    }

    .ganador-item {
        grid-template-columns: 20px 40px 1fr 68px;
        gap: 8px;
        padding: 10px;
    }

    .ganador-numero {
        font-size: 16px;
    }

    .ganador-avatar {
        width: 40px;
        height: 40px;
    }

    .ganador-nombre {
        font-size: 14px;
    }

    .ganador-puntos {
        font-size: 15px;
    }

    .tabla-ganadores-wrapper {
        max-width: 72%;
        height: auto;
        min-height: 200px;
        max-height: 500px;
    }
}

/* ========== PAGINACIÓN ========== */
.pagination-controls {
    max-width: 540px;
    margin: 10px auto 0;
    padding: 0 10px;
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(74, 44, 34, 0.9);
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #F3C302;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    gap: 15px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.items-select {
    background: #fff;
    border: 2px solid #F3C302;
    border-radius: 8px;
    padding: 5px 10px;
    color: #4A2C22;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.items-select:focus {
    box-shadow: 0 0 0 2px rgba(243, 195, 2, 0.5);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    background: #F3C302;
    color: #4A2C22;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #F3C302;
    color: #4A2C22;
    box-shadow: 0 0 10px rgba(243, 195, 2, 0.4);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Ajuste Responsive Paginación */
@media (max-width: 550px) {
    .pagination-controls {
        max-width: 85%;
    }

    .pagination-wrapper {
        justify-content: center;
        flex-direction: column;
    }
}

/* ========== TUTORIAL INTERACTIVO ========== */
/* ========== TUTORIAL INTERACTIVO ========== */
.tutorial-btn-trigger {
    position: fixed;
    top: 110px;
    right: 20px;
    background: #F3C302;
    color: #4A2C22;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(243, 195, 2, 0.5);
    /* Highest possible z-index */
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulseHelp 3s infinite;
}

.tutorial-btn-trigger:hover {
    transform: scale(1.1) rotate(10deg);
}

.tutorial-btn-trigger svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

@keyframes pulseHelp {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 195, 2, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(243, 195, 2, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(243, 195, 2, 0);
    }
}

/* Overlay oscuro de fondo */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    /* High z-index but below components */
    z-index: 999990 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(3px);
}

.tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Elemento resaltado */
.tutorial-highlight {
    position: relative;
    /* Must be higher than overlay */
    z-index: 999995 !important;
    box-shadow: 0 0 0 4px #F3C302, 0 0 30px rgba(243, 195, 2, 0.5);
    /* Removido el box-shadow gigante pseudo-overlay porque ya tenemos overlay real */
    background-color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Tooltip Card */
.tutorial-tooltip {
    position: absolute;
    background: #fff;
    width: 300px;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Must be higher than overlay and highlight */
    z-index: 999999 !important;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid #F3C302;
    pointer-events: auto;
}

.tutorial-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* Flechita del tooltip */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    /* La posición se manejará con JS classes */
}

/* Variantes de posición de flecha */
.tutorial-tooltip.top::before {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: #F3C302 transparent transparent transparent;
}

.tutorial-tooltip.bottom::before {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent #F3C302 transparent;
}

.tutorial-content h3 {
    margin: 0 0 10px;
    color: #DA291C;
    /* Rojo Chocolisto */
    font-size: 20px;
    font-weight: 800;
}

.tutorial-content p {
    margin: 0 0 20px;
    color: #4A2C22;
    font-size: 14px;
    line-height: 1.5;
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-skip {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    padding: 10px;
}

.tutorial-next {
    background: #DA291C;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(218, 41, 28, 0.3);
    transition: transform 0.2s;
}

.tutorial-next:hover {
    transform: scale(1.05);
    background: #c21d10;
}

/* Animación de Scroll para el paso de la tabla */
.scroll-icon-anim {
    width: 24px;
    height: 40px;
    border: 3px solid #F3C302;
    border-radius: 12px;
    position: relative;
    margin: 0 auto 15px;
    opacity: 0.5;
}

.scroll-icon-anim::after {
    content: '';
    width: 4px;
    height: 8px;
    background: #DA291C;
    position: absolute;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
    0% {
        top: 6px;
        opacity: 1;
    }

    100% {
        top: 22px;
        opacity: 0;
    }
}

/* ========== MENSAJES DE CARGA Y ERROR ========== */
.loading-message,
.error-message,
.no-ganadores {
    text-align: center;
    padding: 40px 20px;
    color: #4A2C22;
    font-size: 16px;
    font-weight: 600;
}

.loading-message {
    color: #F3C302;
    animation: pulse 1.5s ease-in-out infinite;
}

.error-message {
    color: #D32F2F;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 10px;
    padding: 30px;
}

.no-ganadores {
    color: #4a2c22;
    font-weight: 700;
    font-size: 18px;
    font-style: italic;
    opacity: 0.8;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 520px) {
    .premios-promo {
        width: min(100%, 320px);
    }
}