@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap");

:root {
    --c1: #667eea;
    --c2: #764ba2;
    --dispon: #34d399;
    --vend: #f43f5e;
}

* {
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #fff;
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

h1 {
    text-align: center;
    margin-top: 0;
    font-size: clamp(1.4rem, 4vw, 2rem);
}

#subtitle {
    text-align: center;
    margin-top: 0.2rem;
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    font-weight: 300;
}

.counter {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

#progress {
    width: 100%;
    height: 20px;
    background: #ffffff40;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

#progressBar {
    height: 100%;
    background: #34d399;
    width: 0%;
    transition: width 0.3s;
}

#clock {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

#capture {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 420px;
    background: #fff;
    border-radius: 15px;
    padding: 1rem;
    color: #222;
}

#capture h2 {
    text-align: center;
    margin: 0 0 0.8rem 0;
    font-size: 1.2rem;
}

#capture .grid-cap {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.3rem;
}

#capture .num-cap {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

#prizesInCapture {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
}

.dispon-cap {
    background: #34d399;
    color: #fff;
}

.vend-cap {
    background: #f43f5e;
    color: #fff;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,
            minmax(clamp(2rem, 8vw, 2.8rem), 1fr));
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.num {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    transition: 0.3s;
    user-select: none;
}

.num.dispon {
    background: var(--dispon);
}

.num.vend {
    background: var(--vend);
    color: #fff;
    cursor: not-allowed;
}

.num:hover {
    transform: scale(1.08);
}

.btn-csv,
.btn-img,
.btn-share,
.btn-terms,
.btn-reset,
.btn-pay,
.btn-hash,
.btn-raffle {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
}

.btn-csv {
    background: #111;
}

.btn-img {
    background: #08d;
}

.btn-share {
    background: #25d366;
}

.btn-terms {
    background: #555;
}

.btn-reset {
    background: #f43f5e;
}

.btn-pay {
    background: #7c3aed;
}

.btn-hash {
    background: #f59e0b;
}

.btn-raffle {
    background: #10b981;
}

.modal {
    position: fixed;
    overflow: auto;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    color: #222;
    border-radius: 15px;
    padding: 1.5rem;
    width: 100%;
    max-width: 320px;
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 0.6rem;
    margin: 0.5rem 0;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.btn {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    background: var(--c1);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

#participants,
#winners {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ---- GALERÍA DE PREMIOS ---- */
.prizes {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.prizes ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .9rem;
    line-height: 1.4;
    color: #fff
}

.prizes ul li {
    margin-bottom: .3rem;
    cursor: pointer;
}

/* Luz roja solo para números vendidos */
.num.ruleta-rojo {
    background: #ffeb3b !important;
    color: #fff !important;
    box-shadow: 0 0 12px #ffeb3b;
    transform: scale(1.15);
    transition: all 0.08s;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
    }

    .modal-content div {
        margin: 5px 0;
    }
}

/* ---------- Selector glass ---------- */
.lang-switch {
    display: flex;
    justify-content: flex-end;
}

.lang-switch select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 2rem;
    padding: .45rem 2.2rem .45rem .9rem;
    font-size: .9rem;
    color: #fff;
    cursor: pointer;
    transition: background .25s ease, box-shadow .25s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    background-size: 1rem;
}

.lang-switch select:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lang-switch select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

/* Modal de imagen del premio */
.prize-modal {
    max-width: 500px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    color: #222;
}

.prize-modal img {
    width: 100%;
    border-radius: 15px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.prize-modal h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.prize-modal p {
    margin: 0;
    font-size: 1rem;
    color: #555;
}

/* ---------- Modal Ganador ---------- */
.winner-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
    font-weight: bold;
    flex-direction: column;
}

.winner-modal-box {
    background: #222;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.winner-modal-title {
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 10px;
}

.winner-modal-number {
    font-size: clamp(2rem, 8vw, 6rem);
    margin: 10px 0;
}

.winner-modal-name {
    font-size: clamp(1rem, 3vw, 2rem);
    margin: 5px 0;
}

.winner-modal-wp {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    margin: 5px 0;
}

.winner-modal-footer {
    font-size: 1rem;
    margin-top: 2rem;
    color: #ff0;
}

/* ---------- Premios para imagen / captura ---------- */
.prizes-capture-box {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

.prizes-capture-title {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.prizes-capture-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.8rem;
    line-height: 1.3;
}

.prizes-capture-item {
    margin-bottom: 0.2rem;
}

.ganador-previo {
    background: #5e636e !important;
    color: white !important;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* === BARRA SUPERIOR === */
.top-bar {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

/* === BOTÓN ADMIN (GLASS) === */
.btn-admin {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 2rem;
    padding: .45rem 2.2rem .45rem .9rem;
    font-size: .9rem;
    color: #fff;
    cursor: pointer;
}

.btn-admin:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-admin:active {
    transform: translateY(0);
}

/* Añadir esto a tu admin.css o style.css */
.winner-item-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.winner-item-clickable:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Un ligero resaltado al pasar el mouse */
    border-radius: 5px;
}

/* Estilo para el Botón de WhatsApp en el Modal Ganador */
.winner-whatsapp-btn {
    display: flex;
    /* Para centrar el icono y el texto */
    align-items: center;
    justify-content: center;
    padding: 10px 25px;
    margin-top: 25px;
    /* Espacio superior */
    background-color: #25D366;
    /* Verde de WhatsApp */
    color: white !important;
    /* Asegura que el texto sea blanco */
    text-decoration: none;
    border-radius: 50px;
    /* Bordes redondeados para estilo "pastilla" */
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    /* Sombra suave */
    transition: background-color 0.3s, box-shadow 0.3s;
    width: fit-content;
    /* Se ajusta al contenido */
    max-width: 80%;
    margin-left: auto;
    /* Centrar el botón */
    margin-right: auto;
}

.winner-whatsapp-btn:hover {
    background-color: #128C7E;
    /* Un verde más oscuro al pasar el mouse */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

/* Estilo para el ícono de WhatsApp (si usas un emoji o FontAwesome) */
.winner-whatsapp-btn .whatsapp-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

/* 1. Estilo para el contenedor del plugin intl-tel-input */
.iti {
    /* Esta clase envuelve todo el campo (bandera + número) */
    width: 100%;
    /* Asegura que ocupe todo el ancho del modal */
    display: flex;
    /* Ayuda a que los elementos internos fluyan correctamente */
}

/* 2. Ajuste al input principal */
/* Esto reemplaza o complementa tu estilo original de input. */
.iti input[type="tel"] {
    /* El ancho debe ser flexible o ocupar el espacio restante */
    flex-grow: 1;
    /* Asegúrate de que tenga la misma altura y padding que tus otros inputs */
    height: 50px;
}

/* 3. Estilo para el botón del prefijo (la bandera) */
.iti__flag-container {
    height: 100%;
}

.iti__selected-flag {
    /* Ajusta el padding para que la bandera esté bien centrada */
    padding-right: 6px;
    border-radius: 8px 0 0 8px;
    /* Si quieres bordes redondeados solo a la izquierda */
}

#confirmBtn {
    margin-top: 0.5rem;
}

#demo-alert {
    background: rgba(255, 243, 205, 0.95);
    border-left: 5px solid #ffc107;
    color: #856404;
    padding: 15px;
    margin: 20px auto;
    max-width: 420px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#demoLoginLink {
    color: #856404;
    font-weight: bold;
    text-decoration: underline;
}

/* BOTÓN DE DESCARGA EN LISTA DE PARTICIPANTES */
.participant-item {
    display: flex;
    justify-content: space-between;
    /* Texto a la izquierda, botón a la derecha */
    align-items: center;
    /* padding: 8px 0; */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-mini-download {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    margin-left: 10px;
}

/* =========================================
   ESTILOS LOGIN GLASSMORPHISM
   ========================================= */

/* Tarjeta de Vidrio */
.glass-login-card {
    background: rgb(255 255 255 / 46%);
    backdrop-filter: blur(15px);
    /* Efecto borroso detrás */
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    position: relative;
    animation: fadeInLogin 0.3s ease-out;
}

/* Botón de cerrar estilizado */
.close-glass {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.close-glass:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Inputs transparentes */
.input-group-glass input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.input-group-glass input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #00e676;
    color: white;
    /* Verde neón al enfocar */
}

/* Botón de Acción Brillante */
.btn-glass-action {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6a35ff 0%, #ff2a4d 100%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(106, 53, 255, 0.4);
    transition: transform 0.2s;
}

.btn-glass-action:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 42, 77, 0.5);
}

@keyframes fadeInLogin {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#quickLoginError {
    color: #c80404;
    font-size: 13px;
    margin-top: 15px;
    min-height: 20px;
    font-weight: bold;
}

/* Spinner de Carga */
.loader-spin {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Estado deshabilitado del botón */
.btn-glass-action:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    /* Quita el efecto zoom al pasar mouse */
}

/* Botón de Cerrar Sesión */
.btn-logout {
    background: rgba(255, 77, 77, 0.15);
    /* Rojo transparente */
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #ff4d4d;
    /* Rojo sólido al pasar el mouse */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.4);
}