/* ============================================================
   STYLE UTAMA APLIKASI CBT
   ============================================================ */
:root {
    --sidebar-width: 240px;
    --primary: #3b5bdb;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

/* ---------- HEADER USER ---------- */
.user-navbar {
    min-height: 72px;
    background: rgba(11, 13, 16, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
}

.user-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.user-brand:hover { color: #fff; }
.user-brand strong { color: #3b5bdb; font-weight: 800; }
.user-brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #3b5bdb, #748ffc);
    border-radius: 12px;
    box-shadow: 0 7px 14px rgba(59, 91, 219, .25);
}
.user-nav-links { gap: .25rem; }
.user-nav-links .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem .85rem;
    color: #a7b0bf;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
    transition: color .2s ease, background-color .2s ease;
}
.user-nav-links .nav-link:hover,
.user-nav-links .nav-link.active {
    color: #fff;
    background: rgba(116, 143, 252, .16);
}
.user-nav-links .nav-link i { font-size: 1rem; }
.user-profile {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-left: 1.1rem;
    padding-left: 1.1rem;
    border-left: 1px solid rgba(255, 255, 255, .12);
}
.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c7d2fe;
    background: rgba(99, 102, 241, .28);
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 800;
}
.user-name {
    max-width: 130px;
    overflow: hidden;
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #94a3b8;
    border-radius: 9px;
}
.user-logout:hover { color: #dc2626; background: #fef2f2; }
.user-navbar-toggler { color: #f8fafc; border: 0; font-size: 1.5rem; }
.user-navbar-toggler:focus { box-shadow: none; }

.user-shell {
    color: #1e293b;
    background-color: #f4f6fa !important;
    background-image: radial-gradient(#dce2ee 1px, transparent 1px);
    background-size: 22px 22px;
}
.user-shell main {
    min-height: calc(100vh - 130px);
}
.user-shell main > .mb-4 h4,
.user-shell main > h4,
.user-shell main > h5 {
    color: #111827;
    font-weight: 800;
    letter-spacing: -.03em;
}
.user-shell .card:not(.card-stat) {
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06) !important;
}
.user-shell .card:not(.card-stat):hover {
    border-color: rgba(59, 91, 219, .25);
}
.user-shell .btn-primary {
    background: #111827;
    border-color: #111827;
}
.user-shell .btn-primary:hover,
.user-shell .btn-primary:focus {
    background: #3b5bdb;
    border-color: #3b5bdb;
}
.user-shell .btn-outline-primary {
    color: #334bb5;
    border-color: #aab8ed;
}
.user-shell .btn-outline-primary:hover {
    color: #fff;
    background: #111827;
    border-color: #111827;
}
.user-shell .card-stat {
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}
.user-shell .table thead th {
    color: #475569;
    background: #f1f4f9;
}
.user-shell .soal-nav-btn {
    border-color: #d9dfeb;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .04);
}
.user-shell .soal-nav-btn.active {
    outline-color: #111827;
}
.user-shell .pilihan-jawaban label {
    background: rgba(255, 255, 255, .72);
    border-color: #dce2ec;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.user-shell .pilihan-jawaban label:hover {
    border-color: #748ffc;
    background: #f4f6ff;
    transform: translateX(2px);
}
.user-shell .pilihan-jawaban label.selected,
.user-shell .pilihan-jawaban input[type=radio]:checked + label {
    border-color: #3b5bdb;
    background: #eef2ff;
}
.user-footer {
    color: #64748b !important;
}

@media (max-width: 991.98px) {
    .user-nav-links { padding-top: 1rem; }
    .user-nav-links .nav-link { width: 100%; }
    .user-profile {
        margin: .75rem 0 0;
        padding: .75rem 0 0;
        border-top: 1px solid rgba(255, 255, 255, .12);
        border-left: 0;
    }
}

/* ---------- LAYOUT ADMIN (SIDEBAR) ---------- */
#wrapper {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #1e2a4a;
    color: #fff;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar-brand {
    padding: 1.2rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar .nav-link {
    color: rgba(255,255,255,.75);
    padding: .75rem 1.25rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    width: 22px;
    display: inline-block;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.08);
    border-left-color: var(--primary);
}

.content-wrapper {
    flex: 1;
    min-width: 0;
}

.topbar {
    padding: .5rem 1rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1040;
        transition: left .25s ease;
        height: 100vh;
    }
    .sidebar.show {
        left: 0;
    }
}

/* ---------- CARD & UTIL ---------- */
.card-stat {
    border: none;
    border-radius: .75rem;
    color: #fff;
}
.card-stat .stat-icon {
    font-size: 2.2rem;
    opacity: .85;
}
.bg-grad-blue   { background: linear-gradient(135deg,#3b5bdb,#5c7cfa); }
.bg-grad-green  { background: linear-gradient(135deg,#2f9e44,#51cf66); }
.bg-grad-orange { background: linear-gradient(135deg,#e8590c,#ff922b); }
.bg-grad-purple { background: linear-gradient(135deg,#6741d9,#9775fa); }

.table thead th {
    white-space: nowrap;
    background: #f1f3f9;
}

.badge-status-aktif { background:#2f9e44; }
.badge-status-nonaktif,
.badge-status-draft { background:#868e96; }

/* ---------- HALAMAN UJIAN (SOAL NAVIGATOR) ---------- */
.soal-nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
}
.soal-nav-btn.answered {
    background: #2f9e44;
    color: #fff;
    border-color: #2f9e44;
}
.soal-nav-btn.ragu {
    background: #f59f00;
    color: #fff;
    border-color: #f59f00;
}
.soal-nav-btn.active {
    outline: 3px solid #3b5bdb;
    outline-offset: 1px;
}

#timerBox {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}
#timerBox.text-danger {
    animation: blink 1s infinite;
}
@keyframes blink {
    50% { opacity: .35; }
}

.pilihan-jawaban label {
    display: block;
    padding: .65rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    margin-bottom: .5rem;
    cursor: pointer;
}
.pilihan-jawaban input[type=radio] {
    margin-right: .5rem;
}
.pilihan-jawaban input[type=radio]:checked + label,
.pilihan-jawaban label.selected {
    border-color: var(--primary);
    background: #edf1ff;
}

/* ---------- MATERI DETAIL ---------- */
/* !important dipakai supaya gambar hasil resize TinyMCE (yang menyimpan lebar/tinggi
   dalam atribut/HTML) tetap otomatis menyesuaikan lebar layar (responsive) */
.materi-konten img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: .5rem;
}
.materi-konten table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

/* ---------- DATATABLES (dalam card Bootstrap) ---------- */
.card .dataTables_wrapper {
    padding: 1rem;
}
.card .dataTables_wrapper .table {
    margin-bottom: 0;
}
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: .25rem .5rem;
    margin-left: .5rem;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: .2rem .4rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: .3rem .65rem;
    margin-left: 2px;
    border-radius: .375rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
