/* RUANG CASN Custom Stylesheet */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-color: #0d9488;
    --accent-color: #f59e0b;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --bottom-nav-height: 65px;
    --navbar-height: 56px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    background-color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
}

/* Ticker Styles */
.ticker-wrapper {
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid var(--accent-color);
    width: 100%;
    position: relative;
    z-index: 1020;
}
.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 25s linear infinite;
    will-change: transform;
}
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
.ticker-wrapper:hover .ticker-content {
    animation-play-state: paused;
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0284c7 100%);
    color: white;
    padding: 70px 0 60px;
    border-radius: 0 0 30px 30px;
}

/* Card Enhancements */
.card-custom {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}
.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Stat Card */
.stat-card {
    border-radius: 16px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}
.stat-card .icon-bg {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.2;
}

/* Masa Aktif Badges */
.badge-status-green { background-color: #10b981; color: white; }
.badge-status-yellow { background-color: #eab308; color: #1e293b; }
.badge-status-orange { background-color: #f97316; color: white; }
.badge-status-red { background-color: #ef4444; color: white; }

/* Copy Box */
.copy-box {
    background-color: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* CBT Exam Engine Styles */
.cbt-question-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.cbt-option {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}
.cbt-option:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}
.cbt-option.selected {
    border-color: var(--primary-color);
    background-color: #e0edff;
    font-weight: 600;
}
.cbt-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #cbd5e1;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}
.cbt-option.selected .cbt-option-letter {
    background-color: var(--primary-color);
    color: white;
}

/* Nav Grid Numbers */
.cbt-num-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cbt-num-btn.answered {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}
.cbt-num-btn.doubt {
    background-color: #ffc107;
    color: #000;
    border-color: #ffc107;
}
.cbt-num-btn.current {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.4);
    font-size: 1.1rem;
    font-weight: bold;
}

/* Mobile Bottom Nav Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1040;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    width: 20%;
    height: 100%;
}
.mobile-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}
.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    body {
        padding-bottom: var(--bottom-nav-height);
    }
    .mobile-bottom-nav {
        display: flex;
    }
}

/* ------------------------------------------------------------- */
/* BACKEND & FRONTEND SIDEBAR DESKTOP & MOBILE HAMBURGER MENU   */
/* ------------------------------------------------------------- */

/* DESKTOP MODE (>= 992px): SIDEBAR TIDAK IKUT SCROLL */
@media (min-width: 992px) {
    .admin-sidebar {
        position: sticky;
        top: 56px;
        height: calc(100vh - 56px);
        overflow-y: auto;
        z-index: 1000;
        background: #1e293b;
        color: #94a3b8;
    }
    .hamburger-btn-toggle {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .sidebar-close-btn {
        display: none !important;
    }
}

/* MOBILE & TABLET MODE (< 992px): HAMBURGER OFF-CANVAS DRAWER */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -290px;
        width: 280px;
        height: 100vh;
        background: #1e293b;
        color: #94a3b8;
        z-index: 1060;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    }
    .admin-sidebar.show {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1050;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    .sidebar-close-btn {
        display: flex !important;
    }
}

/* ------------------------------------------------------------- */
/* RESPONSIVE MODUL MATERI & MOBILE TEXT WRAPPING RULES          */
/* ------------------------------------------------------------- */

#v_konten, .content-box, .materi-container {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
}

#v_konten *, .content-box *, .materi-container * {
    max-width: 100%;
    box-sizing: border-box;
}

#v_konten table, .content-box table, .materi-container table {
    word-break: normal;
}

#v_konten p, .content-box p, .materi-container p,
#v_konten li, .content-box li, .materi-container li,
#v_konten div, .content-box div, .materi-container div {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* KaTeX Responsive Formula Scroll & Wrapping for Smartphone Screens */
.katex-display {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    padding: 6px 0 !important;
    margin: 0.5em 0 !important;
    -webkit-overflow-scrolling: touch;
}

.katex {
    max-width: 100% !important;
    white-space: normal !important;
}

.katex-html {
    max-width: 100% !important;
}

/* Modal View Responsive Fixes */
#viewMateriModal .modal-dialog {
    max-width: 900px;
}

#v_konten {
    max-height: 72vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
    #viewMateriModal .modal-dialog {
        margin: 0.5rem;
    }
    #v_konten {
        padding: 12px !important;
        max-height: 65vh !important;
        font-size: 0.925rem !important;
    }
    .katex-display {
        font-size: 0.9em !important;
    }
    .katex {
        font-size: 0.92em !important;
    }
}

/* Sticky Navigation Sidebar for User Materi Module Page */
@media (min-width: 992px) {
    .sticky-materi-sidebar {
        position: sticky !important;
        top: 80px !important;
        max-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
        z-index: 1020;
    }
}

