/* --- 1. VARIABLES & RESET --- */
:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --dark: #0f172a;
    --light: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--dark);
    color: var(--light);
    height: 100vh;
    overflow: hidden; /* Mencegah scroll */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 2. BACKGROUND ANIMATION --- */
.bg-shapes {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.shape-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; left: -100px; animation-delay: 0s; }
.shape-2 { width: 400px; height: 400px; background: var(--danger); bottom: -50px; right: -50px; animation-delay: 2s; }
.shape-3 { width: 300px; height: 300px; background: var(--success); top: 40%; left: 40%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* --- 3. LAYOUT UTAMA --- */
.kiosk-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* --- 4. HEADER --- */
.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.brand { display: flex; align-items: center; gap: 1rem; }
.logo-glow {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.5);
}
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.brand-subtitle { font-size: 0.9rem; opacity: 0.7; letter-spacing: 1px; text-transform: uppercase; }

.header-right { display: flex; gap: 1rem; align-items: stretch; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.datetime-wrapper { text-align: right; display: flex; flex-direction: column; justify-content: center; min-width: 180px; }
.datetime-wrapper .clock { font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.datetime-wrapper .date { font-size: 0.9rem; opacity: 0.8; margin-bottom: 4px; }

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    width: 60px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.fullscreen-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }

/* --- 5. MAIN CONTENT & SCREENS --- */
.kiosk-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.state-screen {
    position: absolute;
    width: 100%;
    max-width: 900px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
}

.state-screen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* --- IDLE SCREEN --- */
.idle-content { text-align: center; }
.scanner-animation {
    position: relative;
    width: 280px; height: 180px;
    margin: 0 auto 2rem;
}
.card-illustration {
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}
.card-icon {
    background: -webkit-linear-gradient(#fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}
.signal-wave {
    position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
    font-size: 3rem; color: var(--accent);
    animation: pulse-signal 2s infinite;
}
@keyframes pulse-signal { 0% { opacity: 0.2; transform: translateX(-50%) scale(0.8); } 50% { opacity: 1; transform: translateX(-50%) scale(1.1); } 100% { opacity: 0.2; transform: translateX(-50%) scale(0.8); } }

.idle-title { font-size: 3.5rem; font-weight: 800; margin-bottom: 0.5rem; background: linear-gradient(to right, #fff, #cbd5e1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.idle-subtitle { font-size: 1.2rem; opacity: 0.6; font-weight: 300; letter-spacing: 1px; }

/* --- RESULT CARDS (Success & Error) --- */
.result-card {
    width: 100%;
    max-width: 750px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header-badge {
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
}
.success-mode .icon-circle { background: var(--success); color: #000; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.success-mode h2 { color: var(--success); font-weight: 700; font-size: 1.5rem; text-shadow: 0 0 20px rgba(6, 214, 160, 0.3); }

.card-body-layout { padding: 2rem; display: flex; gap: 2.5rem; align-items: center; }

/* Photo Section */
.photo-section { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.photo-frame {
    width: 180px; height: 180px;
    border-radius: 20px;
    padding: 5px;
    background: linear-gradient(135deg, var(--glass-border), transparent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.student-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 16px;
    background-color: #1e293b;
}
.status-pill {
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    background: var(--success); color: #004d36;
}

/* Info Section */
.info-section { flex: 1; }
.student-name { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.2rem; }
.student-nis { font-size: 1.1rem; opacity: 0.6; font-family: monospace; }
.divider { margin: 1.5rem 0; border: none; height: 1px; background: var(--glass-border); }

.grid-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
.info-item { display: flex; flex-direction: column; }
.info-item.full-width { grid-column: 1 / -1; margin-top: 1rem; background: rgba(255,255,255,0.05); padding: 0.8rem; border-radius: 12px; align-items: center; flex-direction: row; justify-content: space-between; }

.label { font-size: 0.85rem; text-transform: uppercase; opacity: 0.6; font-weight: 600; margin-bottom: 4px; }
.value { font-size: 1.2rem; font-weight: 600; }
.time-highlight { font-size: 1.5rem; font-weight: 700; color: var(--accent); font-family: monospace; }

/* --- ERROR SCREEN STYLES --- */
.error-mode { text-align: center; padding: 4rem 2rem; align-items: center; border: 1px solid rgba(239, 71, 111, 0.3); }
.error-icon-wrapper { font-size: 5rem; color: var(--danger); margin-bottom: 1.5rem; animation: shake 0.5s ease-in-out; filter: drop-shadow(0 0 30px rgba(239, 71, 111, 0.4)); }
.error-title { font-size: 2.5rem; font-weight: 800; color: var(--danger); margin-bottom: 1rem; }
.error-content-box { background: rgba(239, 71, 111, 0.1); padding: 1rem 2rem; border-radius: 12px; margin-bottom: 2rem; border: 1px solid rgba(239, 71, 111, 0.2); }
.error-message { font-size: 1.5rem; font-weight: 600; color: #fff; }
.error-instruction { opacity: 0.6; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* --- 6. FOOTER --- */
.kiosk-footer { margin-top: 2rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; opacity: 0.6; }
.status-indicator { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; background-color: var(--success); border-radius: 50%; box-shadow: 0 0 10px var(--success); }
.rfid-hidden-wrapper { opacity: 0; position: absolute; top: -9999px; }