/* ==========================================================================
   SISTEMA DE RIFA DIGITAL - EDICIÓN EN 1 SOLA PANTALLA (SIN SCROLL)
   DISEÑO SOBRIO, MINIMALISTA Y PROFESIONAL ESTILO SAAS CORPORATIVO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-main: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-subtle: #e2e8f0;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden; /* Garantiza 1 sola pantalla sin scroll */
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar oculto o ultra sutil para elementos internos si se requiere */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

/* Tarjeta contenedora principal de la aplicación */
.app-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}

/* Grilla Matriz 10x10 que se auto-ajusta a la pantalla disponible */
.grid-10x10 {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(0, 1fr));
    gap: 3.5px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .grid-10x10 {
        gap: 4.5px;
    }
}

/* Casilla de cada número individual */
.numero-box {
    width: 100%;
    height: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12.5px;
    line-height: 1;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    position: relative;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
}

@media (min-width: 640px) {
    .numero-box {
        border-radius: 8px;
        font-size: 14.5px;
        min-height: 38px;
    }
}

/* Estado 1: DISPONIBLE (Blanco puro, sobrio y elegante) */
.numero-box.disponible {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}
.numero-box.disponible:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.numero-box.disponible:active {
    transform: scale(0.92);
}

/* Estado 2: SELECCIONADA (Obsidiana / Negro pizarra de alta gama) */
.numero-box.seleccionada {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3) !important;
    z-index: 10;
}
.numero-box.seleccionada::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background: #38bdf8;
}

/* Estado 3: APARTADA (Amarillo cálido sobrio, sin estridencias) */
.numero-box.apartada {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
    cursor: not-allowed;
    opacity: 0.9;
}
.numero-box.apartada::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 3.5px;
    height: 3.5px;
    border-radius: 9999px;
    background: #f59e0b;
}

/* Estado 4: PAGADA (Verde menta suave, confirmada) */
.numero-box.pagada {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px #86efac;
}
.numero-box.pagada::after {
    content: '✓';
    position: absolute;
    top: 1px;
    right: 2px;
    font-size: 7px;
    font-weight: 900;
    color: #16a34a;
    line-height: 1;
}

@media (min-width: 640px) {
    .numero-box.pagada::after {
        font-size: 9px;
    }
}

/* Modales y fondo desenfocado sutil */
.modal-backdrop-clean {
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-enter {
    animation: modalEnterAnim 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnterAnim {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Barra flotante inferior de selección */
.dock-seleccion {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* Toast flotante de notificación */
#toast-container {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.toast-msg {
    pointer-events: auto;
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
