/* =========================================================================
   CONFIG VARIASI WARNA (DEFAULT: GEMINI DARK MODE)
   ========================================================================= */
/* =========================================================================
   CONFIG VARIASI WARNA (DEFAULT: GEMINI DARK MODE)
   ========================================================================= */
:root {
    --bg-global: #131314;
    --bg-header: #0a1128;      /* NAVY BLUE PEKAT (BIRU DONGKER TUA KUNCI) */
    --border-line: #2f2f30;
    --text-main: #e3e3e3;
    --text-muted: #8e918f;
    --text-white: #ffffff;
    
    /* Neon Glow Components */
    --neon-cyan: #00e5ff;
    --neon-green: #39ff14;
    --neon-red: #ff3d00;
    --text-wrong: #b0bec5;
    
    /* Box & Form Specifics */
    --bg-card-box: #1e1f20;
    --bg-input-field: #131314;
    --border-input: #474749;
    --bg-btn-approve: rgba(57, 255, 20, 0.1);
}

/* =========================================================================
   PERBAIKAN TEMA TERANG: HIGH CONTRAST (HITAM PEKAT, BIRU DONGKER & HIJAU TUA)
   ========================================================================= */
body.light-mode {
    --bg-global: #fafcff;      /* Abu-abu semen teduh Gemini Light */
    --bg-header: #0a1128;      /* KUNCI FIXED: Header tetap Navy Blue pekat */
    --border-line: #b0bec5;    
    --text-main: #0a192f;      /* JITU: Teks utama diganti Biru Dongker Tua Pekat */
    --text-muted: #263238;     
    --text-white: #000000;     /* JITU: Kalimat pertanyaan soal dipaksa HITAM PEKAT LEGAM */
    
    /* Neon & Kunci Jawaban Penyesuaian Mode Terang Kontras Tinggi */
    --neon-cyan: #0b57d0;      /* Biru Google Royal untuk navigasi menu aktif */
    --neon-green: #0b6623;     /* JITU: Khusus kunci jawaban benar diubah HIJAU TUA PEKAT MURNI */
    --neon-red: #b71c1c;       /* Merah darah pekat untuk bullet penanda opsi salah */
    --text-wrong: #0a192f;     /* Teks jawaban salah ikut Biru Dongker Tua agar serasi */
    
    /* Box & Form Editor Mode Terang */
    --bg-card-box: #c4e2f5;
    --bg-input-field: #f1f3f4;
    --border-input: #78909c;
    --bg-btn-approve: rgba(11, 102, 35, 0.15); /* Mengikuti warna hijau tua */
}

/* =========================================================================
   STYLE IMPLEMENTASI VARIABEL GLOBAL
   ========================================================================= */
body { 
    margin: 0; 
    background: var(--bg-global); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    color: var(--text-main); 
    -webkit-font-smoothing: antialiased;
    transition: background 0.2s ease, color 0.2s ease;
}

/* MAIN HEADER: NAVY BLUE TETAP DI KEDUA TEMA */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-header); /* Dikunci ke Navy Blue lewat variabel di atas */
    border-bottom: 1px solid var(--border-line);
    box-sizing: border-box;
}
.header-logo {
    display: flex;
    align-items: center;
    min-width: 0;
}
.logo-image {
    max-height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
}
.profile-area { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

/* Menjaga lencana user tetap menyala di atas background Navy */
.user-badge { 
    background-color: rgba(0, 229, 255, 0.08); 
    color: #00e5ff; 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 13px; 
    font-weight: 500; 
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* Memastikan tombol logout & switch tema kontras di atas Navy */
.btn-logout { 
    background: transparent; 
    padding: 6px; 
    font-size: 14px; 
    color: #cbd5e0;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-logout:hover { color: #ff3d00; }
.mobile-text { display: inline; }

.btn-theme-toggle {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    color: #cbd5e0;
    transition: transform 0.2s;
}
.btn-theme-toggle:hover {
    transform: scale(1.1);
    color: #ffffff;
}

/* KEPALA & TAB MENU */
.kepala { 
    display: block; 
    padding: 10px 20px 0 20px; 
    border-bottom: 1px solid var(--border-line); 
    background: transparent; 
}
.tab-menu { 
    display: flex; 
    justify-content: flex-start; 
    gap: 16px;
    border-bottom: none;
}
.tab-button {
    background: transparent; 
    padding: 10px 4px; 
    border: none;
    cursor: pointer;
    font-size: 14px; 
    font-weight: 600; /* Dipertebal agar tegas */
    color: var(--text-muted); 
    position: relative;
    transition: color 0.2s ease;
}
.tab-button:hover { color: var(--text-main); }
.tab-button.active { color: var(--neon-cyan); }
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--neon-cyan); 
}

/* CONTAINER UTAMA */
.data-container { 
    background-color: transparent; 
    padding: 10px 20px; 
    margin-top: 10px; 
    margin-bottom: 15px; 
    height: 70vh; 
    overflow-y: auto; 
    box-shadow: none; 
}

/* KARTU SOAL (MODE PRATINJAU) */
.question-card { 
    background: transparent; 
    color: var(--text-main); 
    padding: 20px 0; 
    border-bottom: 1px solid var(--border-line); 
    opacity: 1 !important; 
}
.question-card.approved { opacity: .5 !important; }
.question-card.rejected { border-bottom-color: var(--border-input); }
.question-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.question-header h5 { margin: 0; font-size: 14px; color: var(--neon-cyan) !important; font-weight: bold; }
.status-icon { font-size: 12px; color: var(--neon-green) !important; font-weight: bold; }
.question-card p { color: var(--text-white) !important; font-size: 15px; line-height: 1.6; font-weight: 600; }

/* OPSI JAWABAN HIGH CONTRAST */
.ans-right { color: var(--neon-green) !important; font-weight: bold; margin: 8px 0; display: block; }
.ans-right::before { content: '✓ '; color: var(--neon-green); font-weight: bold; }
.ans-wrong { color: var(--text-wrong) !important; margin: 8px 0; display: block; font-weight: 500; }
.ans-wrong::before { content: '• '; color: var(--neon-red) !important; font-weight: bold; }

/* DISKUSI / KOMENTAR */
.mini-comment-box { background: var(--bg-card-box); margin-top: 15px; padding: 12px; border-radius: 8px; border: none; }
.mini-comment-title { font-size: 12px; font-weight: bold; color: var(--neon-cyan); margin-bottom: 8px; display: block;}

/* JITU LEGA: Menaikkan max-height dari 150px ke 400px agar ruang diskusi luas dan leluasa */
.mini-comment-list { max-height: 500px; overflow-y: auto; font-size: 13px; margin-bottom: 12px; color: var(--text-main); scrollbar-width: thin; }

.mini-comment-item { padding: 8px 0; border-bottom: 1px solid var(--border-line); text-align: left; }
.mini-comment-item-text { color: var(--text-main); margin-top: 3px; font-size: 13px; line-height: 1.5; }
.mini-comment-reply { margin-left: 20px !important; padding-left: 12px !important; border-left: 2px solid var(--border-input) !important; background: transparent !important; padding-top: 6px !important; padding-bottom: 6px !important; }
.comment-actions { margin-top: 6px; font-size: 11px; }
.comment-actions span { cursor: pointer; margin-right: 12px; color: var(--text-muted); }
.comment-actions span:hover { color: var(--neon-cyan); text-decoration: underline; }
.input-flex-row { display: flex; gap: 8px; width: 100%; align-items: center; }
.input-comment-field { flex: 1; padding: 8px 12px; font-size: 13px; background: var(--bg-input-field); border: 1px solid var(--border-input); color: var(--text-main); border-radius: 20px; outline: none; }
.input-comment-field:focus { border-color: var(--neon-cyan); }
.btn-mini-send, .btn-mini-reply, .btn-mini-save, .btn-mini-cancel { background: transparent; color: var(--neon-cyan); padding: 6px 12px; font-size: 12px; border: none; cursor: pointer; font-weight: 500; }
.btn-mini-send:hover, .btn-mini-reply:hover { color: var(--text-main); }

/* FORM EDITOR */
.card-form { background-color: var(--bg-card-box) !important; border-left: 4px solid var(--neon-red) !important; margin-bottom: 25px; padding: 15px !important; border-radius: 8px; color: var(--text-main) !important; text-align: left; border-top: 1px solid var(--border-line); border-right: 1px solid var(--border-line); border-bottom: 1px solid var(--border-line); }
.card-form h4 { color: var(--neon-cyan) !important; font-size: 15px; font-weight: bold; }
.card-form textarea { background: var(--bg-input-field) !important; color: var(--text-main) !important; border: 1px solid var(--border-input) !important; border-radius: 6px; padding: 10px; width: 100% !important; box-sizing: border-box; }
.btn-parse-trigger { background-color: transparent !important; color: var(--neon-cyan) !important; border: 1px solid var(--neon-cyan) !important; padding: 10px 15px; margin-top: 8px; border-radius: 20px; cursor: pointer; font-weight: bold; width: 100% !important; font-size: 13px; }
.btn-parse-trigger:hover { background: var(--bg-btn-approve) !important; }

.editor-row { background: transparent !important; color: var(--text-main) !important; padding: 20px 0 !important; border-bottom: 1px solid var(--border-line) !important; box-shadow: none !important; }
.editor-row.row-locked { opacity: 0.5; }
.editor-row strong { color: var(--neon-cyan) !important; font-size: 15px; font-weight: bold; }
.editor-row label { font-weight: bold !important; font-size: 12px !important; color: var(--text-muted) !important; margin-top: 12px; margin-bottom: 4px; display: block; }

.editor-row textarea.edit-soal, .input-jawaban-container input { width: 100% !important; background: var(--bg-card-box) !important; color: var(--text-main) !important; border: 1px solid var(--border-input) !important; border-radius: 6px; padding: 10px !important; font-size: 14px !important; box-sizing: border-box; display: block; -webkit-text-fill-color: var(--text-main) !important; }
.editor-row textarea.edit-soal:disabled, .input-jawaban-container input:disabled { background: var(--bg-input-field) !important; color: var(--text-muted) !important; -webkit-text-fill-color: var(--text-muted) !important; border: 1px solid var(--border-line) !important; cursor: not-allowed; }
.editor-row textarea:focus, .input-jawaban-container input:focus { border-color: var(--neon-cyan) !important; outline: none; }

.status-icon, .editor-row span[style*="color"] { font-size: 12px !important; font-weight: bold !important; color: var(--neon-green) !important; }

/* DROPDOWN & BAR AKSI */
.dropdown-flex-container { display: flex; gap: 8px; width: 100%; margin-bottom: 10px; }
.sheetDropdown, .sheetDropdown2 { background: var(--bg-card-box); border: 1px solid var(--border-input); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-main); font-weight: 500; }
.sheetDropdown:focus, .sheetDropdown2:focus { border-color: var(--neon-cyan); outline: none; }

.action-bar { display: flex; gap: 8px; margin-top: 12px; margin-bottom: 12px; padding: 0 20px; }
.action-bar button { background: var(--bg-card-box); color: black; border: 1px solid var(--border-input); border-radius: 20px; padding: 8px 16px; font-size: 13px; font-weight: bold; box-shadow: none; }
.action-bar button:hover { background: var(--border-line); color: var(--text-main); }
.btn-approve { background: var(--bg-btn-approve) !important; color: var(--neon-green) !important; font-size: 12px; font-weight: bold; border: 1px solid var(--border-input) !important; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.btn-approve:hover { background: var(--neon-green) !important; color: var(--bg-global) !important; }

/* SIDEBAR */
.sidebar { width: 290px; height: 100%; position: fixed; top: 0; right: -320px; background-color: var(--bg-header); box-shadow: -10px 0 30px rgba(0,0,0,0.3); border-left: 1px solid var(--border-line); padding: 8px; overflow-y: auto; z-index: 100; color: #ffffff; transition: 0.3s; }
.sidebar.open { right: 0; }
.sidebar h3 { font-size: 15px; font-weight: 500; color: #00e5ff; border-bottom: 1px solid var(--border-line); padding-bottom: 8px; margin:5px;}
.toggleSidebar { position: fixed; top: 30px; right: 10px; font-size: 33px; cursor: pointer; background: none; border: none; color: var(--neon-cyan); z-index: 102; }
.info-section { background-color: var(--bg-global); border-radius: 8px; border-left: 3px solid #00e5ff; padding: 6px; margin-bottom: 15px; font-size:smaller; color: var(--text-main); }
.status-badge { background: var(--bg-card-box); font-size:smaller; color: var(--neon-cyan); font-weight: normal; border-radius: 4px; padding: 2px 6px; border: 1px solid var(--border-line); }
.badge-selesai {
    background: #e6fffa; 
    color: #234e52; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 0.8em; 
    font-weight: bold; 
    margin-left: 10px; 
    border: 1px solid #b2f5ea;
}

/* MEDIA QUERIES */
@media screen and (max-width: 768px) {
    .tab-button { font-size: 13px; }
    .main-header { padding: 10px 12px; }
    .kepala, .action-bar, .data-container { padding-left: 12px; padding-right: 12px; }
    .user-badge { padding: 6px 10px; max-width: 80px; }
}