/* assets/css/style.css - Sistem Ujian Kompetensi Perangkat Desa (Modern UI Overhaul) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-subtle: #eff6ff;
    --primary-hover: #1d4ed8;
    --primary-color: #2563eb;

    --secondary-color: #0d9488;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --light-bg: #f8fafc;
    --card-border: #e2e8f0;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 6px 18px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 14px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 22px 35px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
    --shadow-primary: 0 8px 20px -3px rgba(37, 99, 235, 0.35);

    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styling */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Modern Minimalist Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism Navigation Bar */
.navbar-custom {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a8a 100%) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.25);
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.navbar-custom .nav-link {
    border-radius: var(--radius-sm);
    padding: 6px 12px !important;
    transition: var(--transition);
    color: #cbd5e1 !important;
}

.navbar-custom .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}

.navbar-custom .nav-link.active {
    color: #ffffff !important;
    background: rgba(37, 99, 235, 0.4) !important;
    border: 1px solid rgba(147, 197, 253, 0.3);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Modern Cards */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-custom {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.hover-elevate {
    transition: var(--transition);
}

.hover-elevate:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg) !important;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.06);
}

/* Modern Gradient Badges & Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    font-size: 0.925rem;
    letter-spacing: 0.2px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: #ffffff;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 10px 24px -3px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(245, 158, 11, 0.35);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
}

.btn-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.35);
}

.btn-dark:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
}

.btn-outline-primary {
    border: 1.5px solid #2563eb;
    color: #2563eb;
    background: transparent;
}
.btn-outline-primary:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-outline-secondary {
    border: 1.5px solid #cbd5e1;
    color: #475569;
}
.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* Modern Form Controls */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #ffffff;
    color: #1e293b;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    background-color: #ffffff;
}

.input-group-text {
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    background-color: #f8fafc;
    color: #64748b;
    padding: 0.65rem 1rem;
}

.form-label {
    font-size: 0.875rem;
    letter-spacing: 0.2px;
}

/* Modern Badges */
.badge {
    border-radius: 9999px;
    padding: 0.4em 0.8em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.bg-primary-subtle {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe;
}

.badge.bg-success-subtle {
    background-color: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0;
}

.badge.bg-warning-subtle {
    background-color: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fde68a;
}

.badge.bg-danger-subtle {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca;
}

.badge.bg-info-subtle {
    background-color: #ecfeff !important;
    color: #0891b2 !important;
    border: 1px solid #a5f3fc;
}

/* Modern Tables */
.table {
    --bs-table-bg: transparent;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
}

.table thead.table-dark th {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #f8fafc !important;
    border-bottom: none !important;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* CBT Navigation Number Grid */
.cbt-number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px;
}

@media (min-width: 992px) {
    .cbt-number-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.btn-cbt-num {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    position: relative;
    border: 1.5px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cbt-num:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-cbt-num.active {
    outline: 3px solid #2563eb !important;
    outline-offset: 2px;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.45) !important;
    z-index: 2;
}

.btn-cbt-num.answered {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-cbt-num.doubtful {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.btn-cbt-num.unanswered {
    background-color: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

/* CBT Question Layout */
.question-option {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    background-color: #ffffff;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.question-option:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
    transform: translateX(4px);
    box-shadow: var(--shadow-xs);
}

.question-option.selected {
    border-color: #2563eb;
    background: linear-gradient(to right, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    transform: translateX(4px);
}

.option-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 14px;
    flex-shrink: 0;
    transition: var(--transition);
}

.question-option:hover .option-badge {
    background-color: #e2e8f0;
}

.question-option.selected .option-badge {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Timer Sticky Header */
.timer-box {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: var(--radius-md);
    padding: 7px 16px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 16px rgba(56, 189, 248, 0.2);
}

.timer-box.warning {
    background: #450a0a;
    border-color: #f87171;
    color: #f87171;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3), 0 0 20px rgba(248, 113, 113, 0.35);
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

/* Violation Lock Screen Overlay */
.lock-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 24px;
}

.lock-screen-overlay .lock-box {
    max-width: 520px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(239, 68, 68, 0.2);
}

/* Hero Section Accents */
.hero-gradient {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.hero-gradient::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

/* Nav Pills Modern */
.nav-pills .nav-link {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
}

.nav-pills .nav-link.active {
    box-shadow: var(--shadow-sm);
}

/* Watermark */
.watermark {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Print Styling */
@media print {
    body {
        background-color: #ffffff !important;
        font-size: 11pt;
    }
    .no-print {
        display: none !important;
    }
    .print-card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   Admin Sidebar & Responsive Layout
   ========================================================================== */
:root {
    --admin-sidebar-width: 260px;
    --admin-topbar-height: 64px;
    --admin-sidebar-bg: #0f172a; /* Slate 900 */
    --admin-sidebar-border: rgba(255, 255, 255, 0.08);
}

/* Sidebar Styles */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--admin-sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-sidebar-brand {
    height: var(--admin-topbar-height);
    background: rgba(15, 23, 42, 0.6);
}

.admin-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.admin-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.admin-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.95rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.admin-sidebar-nav .nav-link .nav-icon {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 0.95rem;
    text-align: center;
    color: #64748b;
    transition: var(--transition);
}

.admin-sidebar-nav .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-sidebar-nav .nav-link:hover .nav-icon {
    color: #38bdf8;
}

.admin-sidebar-nav .nav-link.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    font-weight: 600;
}

.admin-sidebar-nav .nav-link.active .nav-icon {
    color: #ffffff;
}

.hover-danger-solid:hover {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #ffffff !important;
}

/* Overlay for Mobile */
.admin-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Admin Topbar */
.admin-topbar {
    position: sticky;
    top: 0;
    height: var(--admin-topbar-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1030;
    transition: var(--transition);
}

/* Layout Offsetting for Desktop */
@media (min-width: 992px) {
    .admin-topbar {
        margin-left: var(--admin-sidebar-width);
        width: calc(100% - var(--admin-sidebar-width));
    }

    /* Target content container right after topbar */
    .admin-topbar ~ .container-fluid {
        margin-left: var(--admin-sidebar-width);
        width: calc(100% - var(--admin-sidebar-width));
        max-width: calc(100% - var(--admin-sidebar-width));
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Layout Offsetting & Adjustments for Mobile & Tablet (Layar HP) */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-topbar {
        margin-left: 0;
        width: 100%;
    }

    .admin-topbar ~ .container-fluid {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    /* Small screen card & typography optimizations */
    .card-custom {
        border-radius: var(--radius-md) !important;
    }

    h4, .h4 {
        font-size: 1.25rem !important;
    }

    /* Responsive table container touch scroll */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    /* Button stacking & sizing */
    .btn-group, .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Stat card scale */
    .stat-card {
        padding: 1rem !important;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    :root {
        --admin-sidebar-width: 82vw;
    }

    .admin-topbar ~ .container-fluid {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }

    .btn {
        font-size: 0.825rem;
    }

    .table th, .table td {
        font-size: 0.8rem;
        padding: 0.5rem 0.4rem;
    }

    /* Form controls: prevent automatic zoom on iOS */
    .form-control, .form-select {
        font-size: 16px;
    }
}

