/**
 * ============================================================================
 * Sum-Ag NHS Attendance System - Page Specific Stylesheet
 * ============================================================================
 */

/* ============================================================================ */
/* LOGIN PAGE */
/* ============================================================================ */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(232, 185, 49, 0.08), transparent),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.08), transparent),
                #0F172A;
    padding: 1.5rem;
}

body.light-mode .login-wrapper {
    background: radial-gradient(circle at top right, rgba(232, 185, 49, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent),
                #F8FAFC;
}

.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* ============================================================================ */
/* QR SCANNER / INDEX PAGE */
/* ============================================================================ */

.qr-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(232, 185, 49, 0.05), transparent 70%),
                #0F172A;
    padding: 1.5rem;
}

.qr-container {
    width: 100%;
    max-width: 480px;
    text-align: center;
    animation: slideUp 0.35s ease-out;
}

.qr-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.qr-display-area {
    width: 260px;
    height: 260px;
    margin: 2rem auto;
    background: #FFFFFF;
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
    border: 4px solid var(--border);
    transition: var(--transition);
}

.qr-card.active .qr-display-area {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.qr-display-area canvas, .qr-display-area img {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Scan Line Animation */
.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanSweep 4s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes scanSweep {
    0%, 100% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.timer-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: var(--primary);
    width: 100%;
    transition: width 1s linear, background-color var(--transition);
}

.timer-bar.warning {
    background: var(--danger);
}

/* ============================================================================ */
/* KIOSK PAGE */
/* ============================================================================ */

.kiosk-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #05070A;
    color: #F8FAFC;
    overflow: hidden;
}

.kiosk-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
}

.kiosk-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    height: calc(100vh - 75px);
}

@media (max-width: 992px) {
    .kiosk-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        overflow-y: auto;
        height: auto;
    }
}

.kiosk-main {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.kiosk-sidebar {
    padding: 2rem;
    background: rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.kiosk-scanner-box {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.kiosk-scanner-box.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* Kiosk scan overlay flash */
.flash-overlay {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
}

.flash-overlay.flash {
    animation: flashAnimation 0.4s ease-out;
}

@keyframes flashAnimation {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* ============================================================================ */
/* PUBLIC HOME PAGE */
/* ============================================================================ */

.home-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: var(--transition);
}

.home-nav.scrolled {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
    height: 70px;
    box-shadow: var(--shadow);
}

.home-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    background: radial-gradient(circle at 10% 20%, rgba(232, 185, 49, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
                #0F172A;
    text-align: center;
}

body.light-mode .home-hero {
    background: radial-gradient(circle at 10% 20%, rgba(232, 185, 49, 0.03) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
                #F8FAFC;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #FFF, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .hero-title {
    background: linear-gradient(135deg, #0F172A, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    color: var(--text-secondary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.25rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

/* Photo Gallery & Filtering */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.gallery-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.gallery-item:hover .gallery-img-placeholder {
    transform: scale(1.05);
    background: rgba(232, 185, 49, 0.05);
    color: var(--primary);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--border-radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
}

/* ============================================================================ */
/* PRINT ID CARD PRINTING */
/* ============================================================================ */

.id-card-print-container {
    padding: 20px;
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.id-card-print-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
}

.id-card-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 320px;
    height: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    color: #1e293b;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.id-card-header {
    background: #0F172A;
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 4px solid var(--primary);
}

.id-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.id-card-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 15px;
}

.id-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
}

.id-card-lrn {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 15px;
}

.id-card-qr {
    width: 130px;
    height: 130px;
    background: white;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media print {
    .id-card-print-container {
        padding: 0 !important;
        background: white !important;
    }
    
    .id-card-print-grid {
        display: block !important;
    }
    
    .id-card-box {
        page-break-inside: avoid !important;
        margin-bottom: 20px !important;
        box-shadow: none !important;
        border: 1px solid #000000 !important;
    }
}
