/* ========================================================
   FaceMark - Kiosk Mode Dedicated Stylesheet
   High-contrast, kiosk layout with live feed sidebar
   ======================================================== */

.kiosk-body {
    background-color: #030712;
    overflow: hidden;
    height: 100vh;
}

.kiosk-header {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.kiosk-clock {
    font-size: 18px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}

.kiosk-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    height: calc(100vh - 64px);
    overflow: hidden;
}

@media (max-width: 992px) {
    .kiosk-main {
        display: block;
        position: relative;
        height: calc(100dvh - 64px);
        overflow: hidden;
    }
    .kiosk-stage {
        width: 100%;
        height: 100%;
        position: relative;
    }
    .kiosk-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65vh;
        max-height: 500px;
        background: rgba(15, 23, 42, 0.98);
        border-top: 2px solid var(--primary);
        border-radius: 20px 20px 0 0;
        z-index: 150;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    }
    .kiosk-sidebar.open {
        transform: translateY(0);
    }
    .challenge-banner {
        top: 12px;
        font-size: 13px;
        padding: 8px 16px;
        max-width: 92%;
        white-space: normal;
        text-align: center;
    }
    .kiosk-controls {
        bottom: 20px;
        gap: 16px;
    }
    .ctrl-btn {
        width: 52px;
        height: 52px;
    }
    .ctrl-btn svg {
        width: 24px;
        height: 24px;
    }
    #btn-close-sidebar {
        display: block !important;
    }
}

/* Left: Viewport Stage */
.kiosk-stage {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.kiosk-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.kiosk-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
}

/* Real-Time Detection Box */
.face-box-hud {
    position: absolute;
    border: 2px solid #38bdf8;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    pointer-events: none;
    transition: all 0.1s ease;
}

/* Kiosk Challenge HUD */
.challenge-banner {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #38bdf8;
    padding: 12px 28px;
    border-radius: 9999px;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
}
.challenge-icon {
    font-size: 20px;
    animation: bounce 1.2s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Match Success Splash Card */
.match-splash {
    position: absolute;
    inset: 0;
    background: rgba(6, 78, 59, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 30px;
}
.match-splash.show {
    opacity: 1;
    pointer-events: auto;
}
.match-photo-wrap {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid #10b981;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
}
.match-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.match-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}
.match-meta {
    font-size: 16px;
    color: #a7f3d0;
    margin-bottom: 12px;
}
.match-time-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 20px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Already Marked Warning Splash */
.match-splash.already-marked {
    background: rgba(120, 53, 15, 0.92);
}
.match-splash.already-marked .match-photo-wrap {
    border-color: #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
}
.match-splash.already-marked .match-meta {
    color: #fde68a;
}

/* Match Error Splash */
.match-splash.error-splash {
    background: rgba(127, 29, 29, 0.92);
}

/* Right Sidebar: Recent Attendance Feed */
.kiosk-sidebar {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}
.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 9999px;
}

.recent-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: transform 0.2s;
}
.recent-item:hover {
    transform: translateX(4px);
    border-color: var(--primary);
}
.recent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: #1e293b;
}
.recent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recent-info {
    flex: 1;
    min-width: 0;
}
.recent-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-sub {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-time {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    text-align: right;
    white-space: nowrap;
}

/* Controls Toolbar */
.kiosk-controls {
    position: absolute;
    bottom: 24px;
    display: flex;
    gap: 12px;
    z-index: 50;
}
.ctrl-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    color: #f8fafc;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}
.ctrl-btn:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}
.ctrl-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
