/* --- RESET & VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --sidebar-bg: #f7f9fc;
    --text-color: #334155;
    --heading-color: #0f172a;
    --accent-color: #2563eb;
    --border-color: #e2e8f0;
    --code-bg: #f1f5f9;
    --redacted-bg: #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

.layout-container { display: flex; min-height: 100vh; }

/* --- SIDEBAR (DESKTOP) --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--heading-color);
    font-size: 1.1rem;
}
.brand .logo { width: 32px; height: auto; }

/* Hamburger Menu (Hidden on Desktop) */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.menu-toggle span { display: block; width: 25px; height: 3px; background-color: var(--heading-color); border-radius: 3px; transition: 0.3s; }

.nav-container {
    padding: 0 2rem 2rem 2rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-label { font-size: 0.75rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.nav-links a { text-decoration: none; color: #64748b; font-size: 0.9rem; padding: 0.5rem; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover { background-color: #e2e8f0; color: var(--accent-color); }
.highlight-link { color: var(--accent-color) !important; font-weight: 600; }

.sidebar-footer { margin-top: auto; padding-top: 2rem; font-size: 0.75rem; color: #94a3b8; border-top: 1px solid var(--border-color); }
.status-indicator { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.dot.red { width: 8px; height: 8px; border-radius: 50%; background-color: #ef4444; box-shadow: 0 0 5px #ef4444; }

/* --- MAIN CONTENT --- */
.doc-content { flex-grow: 1; padding: 4rem 6rem; max-width: 1000px; position: relative; }
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 90; }

h1 { font-size: 2.5rem; font-weight: 800; color: var(--heading-color); margin-bottom: 1rem; line-height: 1.2; }
h2 { font-size: 1.8rem; font-weight: 700; color: var(--heading-color); margin-top: 3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
p { margin-bottom: 1.5rem; font-size: 1.05rem; }
.breadcrumbs { font-size: 0.85rem; color: var(--accent-color); font-weight: 600; margin-bottom: 1rem; text-transform: uppercase; }
.lead { font-size: 1.25rem; color: #475569; font-weight: 300; }
.divider { border: 0; border-top: 1px solid var(--border-color); margin: 3rem 0; }

/* Redacted & Infobox */
.redacted { background-color: var(--redacted-bg); color: var(--redacted-bg); cursor: help; padding: 0 4px; border-radius: 2px; transition: 0.3s; }
.redacted:hover { background-color: transparent; color: #dc2626; text-decoration: line-through; }

.infobox { float: right; width: 300px; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; margin-left: 2rem; margin-bottom: 1rem; overflow: hidden; }
.infobox-header { background: #e2e8f0; padding: 10px; font-weight: bold; text-align: center; font-size: 0.9rem; border-bottom: 1px solid #cbd5e1; }
.infobox-image { padding: 20px; text-align: center; background: #fff; }
.infobox-image img { width: 80px; height: auto; }
.infobox-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.infobox-table td, .infobox-table th { padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
.infobox-table th { background: #f1f5f9; text-align: left; }
code { background: var(--code-bg); padding: 2px 5px; border-radius: 4px; font-family: monospace; font-size: 0.85rem; color: #d946ef; }

/* Video */
.video-container { background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 0.5rem; }
video { width: 100%; height: auto; display: block; }
.video-caption { background: #0f172a; color: #94a3b8; font-family: monospace; font-size: 0.75rem; padding: 8px 15px; display: flex; justify-content: space-between; }
.caption-text { font-size: 0.9rem; color: #64748b; font-style: italic; }

/* Quiz & Forms */
.quiz-container { background: #f8fafc; border: 1px solid var(--border-color); padding: 2rem; border-radius: 12px; margin-top: 2rem; }
.question-block { margin-bottom: 2rem; }
.q-label { display: block; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: #64748b; margin-bottom: 0.5rem; }
.options { display: grid; gap: 10px; margin-top: 10px; }
.option-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; transition: 0.2s; }
.option-item:hover { border-color: var(--accent-color); }
.btn-submit, .btn-restart { display: block; width: 100%; text-align: center; background: var(--heading-color); color: #fff; padding: 1rem; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-submit:hover { background: #334155; }
.result-box { text-align: center; padding: 1rem; animation: popIn 0.5s ease; }
.result-img { max-width: 100%; border-radius: 8px; margin: 1.5rem auto; display: block; }
.badge { background: #e2e8f0; color: #475569; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.result-danger h3 { color: #dc2626; }
.result-warning h3 { color: #d97706; }
.result-safe h3 { color: #16a34a; }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }

/* Market Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.card { background: #fff; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 8px; }
.subtitle { font-size: 0.85rem; color: #64748b; margin-bottom: 1rem; }
.code-block { display: block; background: #f1f5f9; padding: 10px; word-break: break-all; border-radius: 6px; color: #334155; }
.external-link { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--border-color); padding: 1rem; border-radius: 8px; text-decoration: none; color: inherit; transition: 0.2s; margin-bottom: 10px; }
.external-link:hover { border-color: #94a3b8; transform: translateX(5px); }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    /* Layout */
    .layout-container { flex-direction: column; }
    
    /* Sidebar becomes Navbar */
    .sidebar { width: 100%; height: auto; position: fixed; top: 0; border-right: none; border-bottom: 1px solid var(--border-color); padding: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); }
    .sidebar-header { padding: 1rem 1.5rem; width: 100%; z-index: 101; background: inherit; }
    
    /* Nav Links (Hidden by default) */
    .nav-container { 
        display: none; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: #fff; 
        border-bottom: 1px solid var(--border-color); 
        padding: 1rem 1.5rem; 
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
    }
    .nav-container.active { display: flex; } /* Show via JS */
    
    /* Hamburger Menu Animation */
    .menu-toggle { display: flex; }
    .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Main Content Adjustments */
    .doc-content { padding: 6rem 1.5rem 2rem 1.5rem; } /* Top padding for fixed header */
    .overlay.active { display: block; }
    body.no-scroll { overflow: hidden; }

    /* Typography Adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; margin-top: 2rem; }
    .lead { font-size: 1rem; }

    /* Components Stacking */
    .infobox { float: none; width: 100%; margin: 1rem 0 2rem 0; }
    .grid-2 { grid-template-columns: 1fr; }
    
    /* Video Caption Stack */
    .video-caption { flex-direction: column; gap: 5px; text-align: center; }
}

/* --- ENHANCED QUIZ STYLES --- */

/* Question Header */
.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.q-tag {
    background: #0f172a;
    color: #00ff00; /* Hacker green */
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 1px;
}

/* Options Grid (Kartu Pilihan) */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

/* Hide default radio button */
.option-card input[type="radio"] {
    display: none;
}

/* The Card Look */
.option-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.option-card .emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: grayscale(100%);
    transition: 0.2s;
}

.option-card .text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
}

/* Hover & Selected States */
.option-card:hover .card-content {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.option-card input[type="radio"]:checked + .card-content {
    border-color: var(--accent-color);
    background-color: #eff6ff; /* Light blue bg */
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.option-card input[type="radio"]:checked + .card-content .emoji {
    filter: grayscale(0%);
    transform: scale(1.2);
}

.option-card input[type="radio"]:checked + .card-content .text {
    color: var(--accent-color);
    font-weight: 700;
}

/* Responsive Grid for Mobile */
@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr; /* Stack vertikal di HP */
    }
    .option-card .card-content {
        flex-direction: row; /* Horizontal layout di dalam kartu HP */
        justify-content: flex-start;
        text-align: left;
        padding: 1rem;
        gap: 15px;
    }
    .option-card .emoji { margin-bottom: 0; font-size: 1.5rem; }
}

/* --- FAKE LOADING SCREEN --- */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.loader-content {
    text-align: center;
    width: 80%;
}

.terminal-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--heading-color);
    margin: 15px 0;
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 1.2em; /* Mencegah layout lompat */
}

/* Simple Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Progress Bar Animation */
.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    animation: fillBar 3.5s ease-in-out forwards;
}

@keyframes fillBar { 0% { width: 0%; } 100% { width: 100%; } }

/* Result Box Polish */
.result-box {
    position: relative;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: scanDown 2s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes scanDown { 0% { top: -10%; } 100% { top: 110%; } }