/* ── ROOT VARIABLES (INMEDIKA BRANDING: TEAL & NAVY) ── */
:root {
    --primary: #00897b;
    --primary-dark: #00695c;
    --primary-light: #e0f2f1;
    --secondary-teal: #26a69a;
    --sidebar-bg: #0b2230;
    --sidebar-width: 260px;
    --topbar-h: 62px;
    --radius: 14px;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    margin: 0;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.brand-text { line-height: 1.2; }
.brand-name { display: block; color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .5px; }
.brand-sub  { display: block; color: rgba(255,255,255,.4); font-size: .7rem; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.user-avatar {
    color: rgba(255,255,255,.6);
    font-size: 1.8rem;
}
.user-info { line-height: 1.3; overflow: hidden; }
.user-name { display: block; color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: 10px 12px; }
.nav-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,.3);
    padding: 8px 8px 4px;
    text-transform: uppercase;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.65);
    font-size: .85rem;
    transition: all .2s;
    text-decoration: none;
    margin-bottom: 2px;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--primary); color: #fff; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ── MAIN CONTENT ───────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s ease;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar .breadcrumb-item a { color: var(--primary); text-decoration: none; }

.page-content { padding: 24px; flex: 1; }

/* ── PAGE HEADER ────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title { font-size: 1.25rem; font-weight: 700; margin: 0; }

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-card {
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    background: #fff;
    border-left: 4px solid transparent;
}
.stat-blue  { border-left-color: #3498db; }
.stat-green { border-left-color: #2ecc71; }
.stat-orange{ border-left-color: #e67e22; }
.stat-purple{ border-left-color: #9b59b6; }
.stat-icon { font-size: 1.8rem; opacity: .7; }
.stat-blue .stat-icon   { color: #3498db; }
.stat-green .stat-icon  { color: #2ecc71; }
.stat-orange .stat-icon { color: #e67e22; }
.stat-purple .stat-icon { color: #9b59b6; }
.stat-number { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label  { font-size: .75rem; color: #718096; margin-top: 2px; }

/* ── CARDS ──────────────────────────────────────────── */
.card { border-radius: var(--radius) !important; border: 1px solid #e9ecef !important; }
.card-header { border-radius: var(--radius) var(--radius) 0 0 !important; border-bottom: 1px solid #f0f4f8 !important; }

/* ── AVATAR ─────────────────────────────────────────── */
.avatar-sm {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── SOAL CARD ──────────────────────────────────────── */
.soal-nomor {
    min-width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.soal-card.answered { border-left: 3px solid #2ecc71 !important; }

/* ── OPTION LABELS (Intelegensi) ────────────────────── */
.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all .15s;
}
.option-label:hover { border-color: var(--primary); background: #f0f7ff; }
.option-label.selected { border-color: var(--primary); background: #e8f4fd; }
.option-key {
    width: 28px; height: 28px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
    transition: all .15s;
}
.option-label.selected .option-key { background: var(--primary); color: #fff; }
.option-text { font-size: .9rem; }

/* ── DISC OPTIONS ───────────────────────────────────── */
.disc-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.disc-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}
.d-bg-danger  { background: #fdecea; color: #c0392b; }
.d-bg-warning { background: #fef9e7; color: #d68910; }
.d-bg-success { background: #eafaf1; color: #1e8449; }
.d-bg-primary { background: #eaf4fd; color: #1a5276; }

.disc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all .15s;
    width: 100%;
}
.disc-option:hover { background: #f8f9fa; }
.disc-option.selected { border-width: 2px; }
.d-option.selected  { border-color: #e74c3c; background: #fdecea; }
.i-option.selected  { border-color: #f39c12; background: #fef9e7; }
.s-option.selected  { border-color: #27ae60; background: #eafaf1; }
.c-option.selected  { border-color: #2980b9; background: #eaf4fd; }

.disc-label {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: .85rem;
    flex-shrink: 0;
}
.d-option .disc-label { background: #e74c3c; color: #fff; }
.i-option .disc-label { background: #f39c12; color: #fff; }
.s-option .disc-label { background: #27ae60; color: #fff; }
.c-option .disc-label { background: #2980b9; color: #fff; }
.disc-text { font-size: .88rem; }

/* ── KRAEPELIN ──────────────────────────────────────── */
.kraepelin-digits { display: flex; gap: 4px; flex-wrap: wrap; }
.digit-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kraepelin-num {
    width: 36px; height: 36px;
    background: #2d3748;
    color: #fff;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
}
.kraepelin-input {
    width: 36px; height: 36px;
    border: 2px solid #3498db;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: monospace;
    padding: 0;
    outline: none;
    transition: border-color .15s;
}
.kraepelin-input:focus { border-color: #e74c3c; background: #fff8e1; }

/* Timer bar */
.timer-bar-wrap {
    height: 8px;
    background: rgba(255,255,255,.2);
    border-radius: 4px;
    overflow: hidden;
}
.timer-bar {
    height: 100%;
    background: #27ae60;
    border-radius: 4px;
    transition: width 1s linear, background-color 1s;
}

/* Preview in admin */
.kraepelin-preview { display: flex; flex-wrap: wrap; gap: 4px; }
.digit-badge {
    width: 24px; height: 24px;
    background: #2d3748; color: #fff;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    font-family: monospace;
}

/* ── HASIL TES ──────────────────────────────────────── */
.skor-circle {
    width: 90px; height: 90px;
    border: 5px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.skor-value { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.skor-unit  { font-size: .7rem; color: #718096; }

.skor-circle-big {
    width: 130px; height: 130px;
    border: 6px solid;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    margin: 0 auto;
}
.skor-val { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.skor-pct { font-size: .9rem; }

.disc-result-badge, .disc-result-big {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #1a6ebd, #2ecc71);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    font-weight: 900;
}
.disc-result-big {
    width: 100px; height: 100px;
    font-size: 2.5rem;
}
.disc-result-sm {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, #1a6ebd, #2ecc71);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
}
.disc-mini {
    border-radius: 8px;
    padding: 6px 0;
    font-size: .8rem;
    text-align: center;
}
.disc-bar-card { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.disc-progress-wrap { width: 24px; height: 60px; background: #f0f4f8; border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end; margin-bottom: 4px; }
.disc-progress-bar { width: 100%; border-radius: 4px; transition: height .5s ease; }

/* ── LOGIN PAGE ─────────────────────────────────────── */
.login-wrapper { display: flex; min-height: 100vh; }
.login-left {
    flex: 1;
    background: linear-gradient(150deg, #0b2230 0%, #00695c 60%, #00897b 100%);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    padding: 40px;
}
.login-overlay { text-align: center; }
.feature-item { display: flex; align-items: center; font-size: .95rem; }
.login-right {
    width: 440px;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.login-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
}
.login-footer {
    padding: 16px 40px;
    border-top: 1px solid #f0f4f8;
    text-align: center;
}
.input-group-text { background: #f8f9fa !important; }

/* ── TES CARDS (Dashboard User) ─────────────────────── */
.tes-card { transition: transform .2s, box-shadow .2s; }
.tes-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12) !important; }
.tes-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}
.bg-primary-soft { background: #e0f2f1; }
.bg-warning-soft { background: #fef9e7; }
.bg-success-soft { background: #eafaf1; }

/* ── USER DASHBOARD BG GRADIENT ─────────────────────── */
.bg-gradient-primary {
    background: linear-gradient(135deg, #0b2230 0%, #00695c 50%, #00897b 100%) !important;
    border-radius: var(--radius) !important;
}

/* ── SOAL BANK CARD ─────────────────────────────────── */
.soal-card { transition: box-shadow .2s; }
.soal-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1) !important; }

/* ── RIWAYAT CARD ───────────────────────────────────── */
.riwayat-card { transition: transform .2s; }
.riwayat-card:hover { transform: translateY(-2px); }

/* ── BUTTON XS ──────────────────────────────────────── */
.btn-xs { padding: 2px 8px; font-size: .75rem; border-radius: 4px; }

/* ── TABLE ──────────────────────────────────────────── */
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: #718096; }
.table td { vertical-align: middle; }

/* ── FLASH ──────────────────────────────────────────── */
.flash-messages { margin-bottom: 16px; }

/* ── SIDEBAR COLLAPSE ───────────────────────────────── */
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .login-right { width: 100%; }
    .skor-circle-big { width: 100px; height: 100px; }
    .skor-val { font-size: 1.8rem; }
}

/* ── SIDEBAR BACKDROP MOBILE ────────────────────────── */
.sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 34, 48, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ── STICKY BOTTOM BAR ──────────────────────────────── */
.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}

/* ─── RESPONSIF POP-UP / MODAL SEMUA TES (ANDROID & MOBILE) ─── */
.petunjuk-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(11, 34, 48, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.petunjuk-card {
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0,0,0,0.3);
    animation: zoomInPopup 0.25s ease;
}

.petunjuk-header {
    flex-shrink: 0;
}

.petunjuk-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
}

@keyframes zoomInPopup {
    from { opacity: 0; transform: scale(0.93); }
    to { opacity: 1; transform: scale(1); }
}

/* Khusus Layar Smartphone Android (< 768px) */
@media (max-width: 767.98px) {
    .petunjuk-backdrop {
        padding: 0.5rem !important;
        align-items: center !important;
    }
    .petunjuk-card {
        max-width: 95% !important;
        max-height: 90vh !important;
        border-radius: 1rem !important;
        margin: auto !important;
    }
    /* Header Pop-up Ramping */
    .petunjuk-header,
    .petunjuk-card .bg-primary,
    .petunjuk-card .bg-warning,
    .petunjuk-card .bg-success,
    .petunjuk-card .bg-danger {
        padding: 0.75rem 1rem !important;
    }
    .petunjuk-card .rounded-circle {
        padding: 0.35rem 0.55rem !important;
        margin-bottom: 0.25rem !important;
    }
    .petunjuk-card .rounded-circle i {
        font-size: 1.4rem !important;
    }
    .petunjuk-card h4 {
        font-size: 1.05rem !important;
        margin-bottom: 0.15rem !important;
    }
    .petunjuk-card .small,
    .petunjuk-card p {
        font-size: 0.72rem !important;
    }
    /* Body Pop-up Ramping & Scroll Halus */
    .petunjuk-body,
    .petunjuk-card .p-4 {
        padding: 0.75rem 1rem !important;
    }
    .petunjuk-card .row.g-2 {
        margin-bottom: 0.5rem !important;
    }
    .petunjuk-card .row.g-2 .border {
        padding: 0.35rem 0.5rem !important;
        border-radius: 0.6rem !important;
    }
    .petunjuk-card .row.g-2 small {
        font-size: 0.68rem !important;
    }
    .petunjuk-card .row.g-2 strong {
        font-size: 0.95rem !important;
    }
    .petunjuk-card h6 {
        font-size: 0.85rem !important;
        margin-bottom: 0.35rem !important;
    }
    .petunjuk-card ol,
    .petunjuk-card ul {
        font-size: 0.77rem !important;
        line-height: 1.42 !important;
        padding-left: 1.15rem !important;
        margin-bottom: 0.5rem !important;
    }
    .petunjuk-card ol li,
    .petunjuk-card ul li {
        margin-bottom: 0.25rem !important;
    }
    /* Tombol Mulai Pop-up */
    .petunjuk-card .btn-lg {
        padding: 0.6rem 1rem !important;
        font-size: 0.88rem !important;
        margin-top: 0.4rem !important;
        border-radius: 50px !important;
    }
    .petunjuk-card .alert {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.78rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Penyesuaian Petunjuk & Pilihan Soal di Android */
    .soal-card {
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }
    .soal-card .card-body {
        padding: 12px 14px !important;
    }
    .soal-nomor {
        min-width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }
    /* Tombol Pilihan Tes Intelegensi Touch-Friendly Android */
    .option-label {
        min-height: 46px !important;
        padding: 9px 12px !important;
        border-radius: 8px !important;
        touch-action: manipulation;
    }
    .option-label:active {
        background: #e1effe !important;
        transform: scale(0.99);
    }
    .option-key {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.78rem !important;
    }
    .option-text {
        font-size: 0.86rem !important;
    }
    /* Baris Tes DISC di Layar HP */
    .disc-row {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    .disc-row .form-check-input {
        width: 22px !important;
        height: 22px !important;
    }
}


