/* ==============================================================================
   TicketEscolar PWA - Paleta "Academia Moderna" & Estilos Institucionales
   ============================================================================== */

:root {
    /* Paleta Institucional "Academia Moderna" */
    --primary: #1e3a8a;       /* Azul Marino Oxford */
    --primary-hover: #172554; /* Azul Marino Oxford Profundo */
    --accent: #4f46e5;        /* Añil / Índigo Eléctrico */
    --accent-hover: #4338ca;  /* Añil Intenso */
    --surface: #f8fafc;       /* Gris Hielo Neutro */
    --card: #ffffff;          /* Blanco Puro */
    --text-main: #0f172a;     /* Grafito Profundo */
    --text-muted: #64748b;    /* Gris Acero */

    /* Semáforo de Validación para Escáner */
    --success: #16a34a;       /* Esmeralda Intenso */
    --warning: #d97706;       /* Ámbar / Ocre Cálido */
    --danger: #dc2626;        /* Carmesí Puro */
}

/* Animación de escaneo láser */
@keyframes laser-scan {
    0% {
        top: 5%;
        opacity: 0.8;
    }
    50% {
        top: 90%;
        opacity: 1;
    }
    100% {
        top: 5%;
        opacity: 0.8;
    }
}

.scanner-laser {
    position: absolute;
    left: 5%;
    right: 5%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #38bdf8, #2563eb, transparent);
    box-shadow: 0 0 15px 3px rgba(56, 189, 248, 0.85);
    animation: laser-scan 2.2s infinite ease-in-out;
    border-radius: 9999px;
    z-index: 20;
}

/* Efecto de ticket perforado institucional */
.ticket-container {
    position: relative;
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.ticket-notch-left, .ticket-notch-right {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: #f8fafc; /* Color de superficie Gris Hielo Neutro */
    border-radius: 50%;
    top: 68%;
    transform: translateY(-50%);
    z-index: 10;
}

.ticket-notch-left {
    left: -12px;
}

.ticket-notch-right {
    right: -12px;
}

.ticket-divider {
    position: absolute;
    top: 68%;
    left: 18px;
    right: 18px;
    border-top: 2px dashed #e5e7eb;
}

/* Glassmorphism */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-panel-dark {
    background: rgba(17, 24, 39, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animaciones de entrada suaves */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeInScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pulsación de badge */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.03);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 1.8s infinite ease-in-out;
}

/* Visor de Escáner HTML5-QRCode */
#reader {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    border: none !important;
    overflow: hidden !important;
}

#reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 1.5rem !important;
}

#reader__scan_region {
    background: transparent !important;
    min-height: 100% !important;
}

#reader__scan_region video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#reader__dashboard, #reader__dashboard_section_csr, #reader__dashboard_section_swaplink {
    display: none !important;
}

/* Animación de Modal de Resultado */
@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-pop, .animate-scale-up {
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================================================
   Estilos de Impresión Limpia para Boletos (window.print)
   ============================================================================== */
@media print {
    body {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ocultar botones, cabeceras del sitio y modales al imprimir */
    header, 
    #action-buttons-container, 
    #modal-ticket-preview, 
    .no-print {
        display: none !important;
    }

    main {
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: 100% !important;
    }

    #ticket-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        margin: 10px auto !important;
        max-width: 480px !important;
        page-break-inside: avoid !important;
    }

    .ticket-notch-left, .ticket-notch-right {
        background-color: #ffffff !important;
    }
}

