/* =========================================================
   RESET & VARIABEL DASAR
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --success: #10b981;
}

/* Proteksi Anti-Blok Teks Soal Ujian (PC & HP) */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* Grid 2 Kolom Panel Guru Kuis & Ujian */
.quiz-grid-guru {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

/* =========================================================
   HALAMAN LOGIN (index.html)
========================================================= */
.login-body {
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #020617);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-wrapper {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-header h2 {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}

/* =========================================================
   TOMBOL & INPUT FORM
========================================================= */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-left: 4px;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

/* =========================================================
   LAYOUT DASHBOARD UTAMA
========================================================= */
.app-layout {
    display: flex;
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-brand {
    padding: 0 20px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 15px 0 5px 10px;
}

.menu-item {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 15px;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.menu-item.active {
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* =========================================================
   DASHBOARD RPL VIBE (BERANDA)
========================================================= */
.rpl-banner {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(15, 23, 42, 0.9)), url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.3);
}

.banner-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-family: 'Courier New', Courier, monospace;
}

.banner-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.tech-stack-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-stack-pills span {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: #a5b4fc;
}

.banner-icon {
    font-size: 60px;
    filter: drop-shadow(0 0 15px rgba(79, 70, 229, 0.6));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.5);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
}

.terminal-box {
    background: #09090b;
    border-radius: 12px;
    border: 1px solid #27272a;
    overflow: hidden;
    font-family: 'Consolas', 'Courier New', monospace;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #18181b;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #27272a;
}

.terminal-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-title {
    margin-left: auto;
    margin-right: auto;
    font-size: 12px;
    color: #71717a;
}

.terminal-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #e4e4e7;
}

.terminal-body .prompt { color: #22c55e; font-weight: bold; }
.terminal-body .output { color: #a1a1aa; }

.cursor-blink {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: #e4e4e7;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =========================================================
   RESPONSIVITAS MOBILE (LAYAR HP)
========================================================= */
@media (max-width: 768px) {
    #btnToggleMenu { display: block !important; }

    .quiz-grid-guru {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.buka { left: 0; }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding-top: 70px;
    }

    .topbar {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 1000;
        padding: 10px 15px;
        background: #0f172a;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .content-area {
        padding: 15px;
    }

    .user-info { gap: 10px !important; }
    #infoPenggunaTampil { display: none; }
    #namaPenggunaTampil { font-size: 11px !important; }
    #ikonProfil { width: 30px !important; height: 30px !important; font-size: 14px !important; }
    #btnLogout { padding: 4px 10px !important; font-size: 11px !important; }
}

.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 9998; backdrop-filter: blur(2px);
}
.sidebar-overlay.tampil { display: block; }

/* Pastikan Pop-Up Peringatan (SweetAlert) Selalu Tampil Paling Depan */
.swal2-container {
    z-index: 999999 !important;
}

/* =========================================================
   EDITOR SOAL (GAMBAR & TEKS)
========================================================= */
#teksSoalQuizBaru:empty:before {
    content: attr(data-placeholder);
    color: #64748b;
    pointer-events: none;
    display: block;
}
#teksSoalQuizBaru img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#teksSoalQuizBaru:focus {
    border-color: #10b981 !important;
    background: rgba(0, 0, 0, 0.4) !important;
}