/* ============================================
   ASILO PRESENZE - Custom CSS
   ============================================ */

:root {
    --asilo-primary: #0066CC;
    --asilo-success: #1a8a3a;
    --asilo-scanner-bg: #0d1117;
}

/* PWA install banner */
#pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
}

/* Scanner page */
#scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: var(--asilo-scanner-bg);
    aspect-ratio: 1;
}

#reader {
    width: 100%;
    height: 100%;
}

/* Override html5-qrcode UI */
#reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

#reader__scan_region img { display: none !important; }
#reader__dashboard_section_swaplink { display: none !important; }
#reader__dashboard_section_filesel button { 
    background: var(--asilo-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
}

/* Scanner result overlay */
#scan-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: none;
    opacity: 0;
}

#scan-result.show { opacity: 1; pointer-events: auto; }
#scan-result.success { background: rgba(26,138,58,0.92); color: white; }
#scan-result.error   { background: rgba(198,35,35,0.92); color: white; }
#scan-result.warning { background: rgba(163,113,18,0.92); color: white; }

.scan-icon { font-size: 4rem; margin-bottom: 1rem; }

/* Dashboard cards */
.stat-card {
    border-left: 4px solid var(--asilo-primary);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-number { font-size: 2.5rem; font-weight: 700; color: var(--asilo-primary); }

/* QR code card */
.qr-card { cursor: pointer; transition: box-shadow 0.2s; }
.qr-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* Registro table */
.registro-table .presenza-ok { background-color: rgba(26,138,58,0.08); }
.registro-table .presenza-assente { background-color: rgba(198,35,35,0.05); }
.registro-table .presenza-giustificata { background-color: rgba(163,113,18,0.08); }

.badge-presenza {
    font-size: .75rem;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Loading spinner overlay */
#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}
#loading-overlay.show { display: flex; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .stat-card .stat-number { font-size: 1.8rem; }
    #scanner-container { max-width: 100%; border-radius: 0; }
}

/* Print styles per il registro */
@media print {
    .it-header-wrapper, .it-header-slim-wrapper, 
    .it-header-navbar-wrapper, footer, .no-print { display: none !important; }
    .container { max-width: 100% !important; }
}
