/* =========================================================
   SmartPresensi QR - Ultra Professional Responsive Kiosk Scanner
   Mobile-First & Large Display Responsive Styles
========================================================= */

:root {
    --kiosk-bg: #060913;
    --kiosk-card-bg: rgba(15, 23, 42, 0.75);
    --kiosk-border: rgba(255, 255, 255, 0.1);
    --kiosk-text: #f8fafc;
    --kiosk-accent: #06b6d4;
    --kiosk-laser: #00f2fe;
    --kiosk-hud: rgba(6, 182, 212, 0.4);
}

/* Theme 1: Cyber Neon Pro */
[data-kiosk-theme="cyber_neon"] {
    --kiosk-bg: radial-gradient(circle at top right, #0d1527 0%, #050811 100%);
    --kiosk-card-bg: rgba(11, 18, 38, 0.85);
    --kiosk-border: rgba(6, 182, 212, 0.25);
    --kiosk-text: #f8fafc;
    --kiosk-accent: #06b6d4;
    --kiosk-laser: #00f2fe;
    --kiosk-hud: rgba(6, 182, 212, 0.5);
}

/* Theme 2: Midnight Cosmic Aurora */
[data-kiosk-theme="midnight_aurora"] {
    --kiosk-bg: radial-gradient(circle at 80% 20%, #2e0854 0%, #0b021a 100%);
    --kiosk-card-bg: rgba(28, 11, 48, 0.85);
    --kiosk-border: rgba(168, 85, 247, 0.3);
    --kiosk-text: #faf5ff;
    --kiosk-accent: #a855f7;
    --kiosk-laser: #c084fc;
    --kiosk-hud: rgba(168, 85, 247, 0.5);
}

/* Theme 3: Executive Gold & Onyx */
[data-kiosk-theme="executive_gold"] {
    --kiosk-bg: radial-gradient(circle at top, #1c1917 0%, #09090b 100%);
    --kiosk-card-bg: rgba(24, 24, 27, 0.9);
    --kiosk-border: rgba(245, 158, 11, 0.3);
    --kiosk-text: #fffbeb;
    --kiosk-accent: #f59e0b;
    --kiosk-laser: #fbbf24;
    --kiosk-hud: rgba(245, 158, 11, 0.5);
}

/* Theme 4: Modern Daylight Clean */
[data-kiosk-theme="clean_daylight"] {
    --kiosk-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --kiosk-card-bg: rgba(255, 255, 255, 0.95);
    --kiosk-border: rgba(15, 23, 42, 0.12);
    --kiosk-text: #0f172a;
    --kiosk-accent: #2563eb;
    --kiosk-laser: #3b82f6;
    --kiosk-hud: rgba(37, 99, 235, 0.3);
}

* {
    box-sizing: border-box;
}

body.kiosk-body {
    background: var(--kiosk-bg);
    color: var(--kiosk-text);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

.kiosk-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Top Header */
.kiosk-header {
    background: var(--kiosk-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--kiosk-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    gap: 12px;
}

.kiosk-school-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kiosk-school-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

.kiosk-school-title h1 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--kiosk-text);
    line-height: 1.2;
}

.kiosk-school-title p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

/* Digital Clock */
.kiosk-clock-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--kiosk-border);
}

.kiosk-clock-time {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
    color: var(--kiosk-accent);
    letter-spacing: 1.5px;
    line-height: 1.1;
}

.kiosk-clock-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

/* Main Grid Layout */
.kiosk-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 18px;
    flex: 1;
    width: 100%;
}

/* Camera Scanner Container */
.kiosk-camera-card {
    background: var(--kiosk-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--kiosk-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.kiosk-camera-viewport {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    border: 1px solid var(--kiosk-border);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    width: 100%;
}

.kiosk-camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kiosk-camera-viewport canvas#face-landmarks-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 5;
}

/* HUD Overlay & Targeting Frame */
.kiosk-hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-target-box {
    width: min(240px, 68vw);
    height: min(240px, 68vw);
    position: relative;
    border: 2px dashed var(--kiosk-hud);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
}

/* Corner HUD brackets */
.kiosk-target-box::before,
.kiosk-target-box::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: var(--kiosk-accent);
    border-style: solid;
}
.kiosk-target-box::before {
    top: -2px; left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 18px;
}
.kiosk-target-box::after {
    bottom: -2px; right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 18px;
}

/* Laser Scan Line */
.kiosk-laser-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--kiosk-laser);
    box-shadow: 0 0 16px var(--kiosk-laser), 0 0 30px var(--kiosk-laser);
    animation: laserScan 2.2s infinite ease-in-out alternate;
}

@keyframes laserScan {
    0% { top: 6%; opacity: 0.8; }
    100% { top: 92%; opacity: 0.8; }
}

/* Face Recognition HUD Oval Target */
.kiosk-face-oval {
    width: min(240px, 65vw);
    height: min(310px, 80vw);
    border: 2px dashed var(--kiosk-hud);
    border-radius: 50% / 45%;
    position: relative;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.25), inset 0 0 25px rgba(6, 182, 212, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kiosk-face-oval.detected {
    border-color: #10b981;
    border-style: solid;
    box-shadow: 0 0 45px rgba(16, 185, 129, 0.4), inset 0 0 30px rgba(16, 185, 129, 0.2);
}

.kiosk-face-oval::before {
    content: '';
    position: absolute;
    top: 15px;
    width: 16px;
    height: 16px;
    border-top: 3px solid var(--kiosk-accent);
    border-left: 3px solid var(--kiosk-accent);
}

.kiosk-face-oval::after {
    content: '';
    position: absolute;
    bottom: 15px;
    width: 16px;
    height: 16px;
    border-bottom: 3px solid var(--kiosk-accent);
    border-right: 3px solid var(--kiosk-accent);
}

.face-scanning-glow {
    position: absolute;
    inset: 0;
    border-radius: 50% / 45%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: pulseScan 2.5s infinite ease-in-out;
}

@keyframes pulseScan {
    0%, 100% { transform: scale(0.98); opacity: 0.4; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* Kiosk Mode / Method Tabs */
.kiosk-nav-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    padding: 4px;
    gap: 6px;
    margin-bottom: 14px;
    border: 1px solid var(--kiosk-border);
}

.kiosk-nav-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kiosk-nav-tab:hover {
    color: var(--kiosk-text);
}

.kiosk-nav-tab.active {
    background: var(--kiosk-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

/* Upload Face Dropzone */
.face-upload-dropzone {
    border: 2px dashed var(--kiosk-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.face-upload-dropzone:hover, .face-upload-dropzone.dragover {
    border-color: var(--kiosk-accent);
    background: rgba(6, 182, 212, 0.06);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.15);
}

.face-upload-preview {
    max-width: 100%;
    max-height: 240px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--kiosk-accent);
}

/* Mode Switcher Buttons */
.kiosk-mode-bar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px;
    border-radius: var(--radius-sm);
    width: 100%;
}

.kiosk-mode-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12.5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.kiosk-mode-btn.active {
    background: var(--kiosk-accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* Side Live Stream Card */
.kiosk-feed-card {
    background: var(--kiosk-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--kiosk-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.kiosk-feed-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-height: 520px;
}

.kiosk-feed-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--kiosk-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.35s ease;
    gap: 8px;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Attendance Result Popup Badge */
.kiosk-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}

.kiosk-popup-card {
    background: var(--kiosk-card-bg);
    border: 2px solid var(--kiosk-accent);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 40px rgba(6, 182, 212, 0.3);
    animation: popupBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupBounce {
    0% { transform: scale(0.7) translateY(30px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.kiosk-popup-photo {
    width: 90px;
    height: 110px;
    border-radius: 14px;
    object-fit: cover;
    margin: 0 auto 14px auto;
    border: 3px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.theme-pill-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--kiosk-border);
    color: var(--kiosk-text);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

/* =========================================================
   Mobile-First Responsive Overrides (Screen width <= 900px)
========================================================= */
@media (max-width: 900px) {
    .kiosk-wrapper {
        padding: 10px 12px;
        gap: 12px;
    }

    .kiosk-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 14px 12px;
        gap: 12px;
        text-align: center;
    }

    .kiosk-school-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin: 0 auto;
        width: 100%;
    }

    .kiosk-school-brand img {
        width: 52px;
        height: 52px;
        margin: 0 auto 6px auto;
        display: block;
    }

    .kiosk-school-title {
        text-align: center;
    }

    .kiosk-school-title h1 {
        font-size: 15px;
        text-align: center;
    }

    .kiosk-school-title p {
        text-align: center;
        font-size: 11px;
    }

    .kiosk-header-top-row {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 10px;
        flex-wrap: wrap;
    }

    .kiosk-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .kiosk-camera-card {
        padding: 12px;
    }

    .kiosk-camera-viewport {
        min-height: 280px !important;
        height: 280px;
    }

    .kiosk-mode-bar {
        gap: 4px;
        padding: 4px;
    }

    .kiosk-mode-btn {
        font-size: 11px;
        padding: 8px 4px;
        gap: 4px;
    }

    .kiosk-mode-btn i {
        font-size: 12px;
    }

    .kiosk-feed-card {
        padding: 12px;
    }

    .kiosk-feed-list {
        max-height: 280px;
    }
}

/* Corner Notification Toast Stacking Animation */
@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(45px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes kioskToastFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

