:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --dark: #334155;
    --light: #F8FAFC;
    --gray: #64748B;
    --gray-light: #E2E8F0;
    --danger: #EF4444;
    --bg-color: #EAEDF1;
    --card-bg: #FFFFFF;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ANTI-COPAS (Copy-Paste Protection) */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
    -webkit-touch-callout: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: #f4f6f9;
    color: var(--dark);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

#result-screen {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid #d2d6de;
    max-width: 520px;
    margin: 2rem auto;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }

.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--dark);
}

.subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header .school-name {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    text-align: center;
}

.login-header .cbt-badge-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.65rem;
    letter-spacing: 0.75px;
    text-align: center;
    text-transform: uppercase;
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    transform: rotate(-5deg);
    transition: transform 0.3s;
}
.logo-icon:hover {
    transform: rotate(0deg) scale(1.05);
}
.school-logo-img {
    transition: transform 0.3s ease;
}
.school-logo-img:hover {
    transform: scale(1.04);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray);
}
input, select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.95rem;
    color: var(--dark);
    transition: border-color 0.2s ease;
    outline: none;
    -webkit-user-select: auto;
    user-select: auto;
}
input::placeholder {
    color: #94a3b8;
}
input:focus, select:focus {
    border-color: var(--primary);
}
input:disabled, select:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Global Image Restraints for Questions */
img {
    max-width: 100%;
    height: auto;
}

/* Buttons */
.btn-primary, .btn-outline {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}
.btn-primary:disabled {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: rgba(79, 70, 229, 0.05);
}

/* Exam Screen */
#exam-screen {
    /* Tailwind classes handle the layout now */
}
.exam-header {
    /* Tailwind handles most styling. Just keep sticky behavior if needed */
    position: sticky;
    top: 0;
    z-index: 10;
}
.student-info {
    display: flex;
    flex-direction: column;
}
.badge {
    background: #EEF2FF;
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.2rem;
    width: max-content;
}
.timer {
    background: #FEF2F2;
    color: var(--danger);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

/* Question Cards */
.question-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    box-shadow: none;
    border: none;
}
.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 0.8rem;
    gap: 12px;
}
.q-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    white-space: nowrap;
}
.q-exam-badge {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.q-exam-badge i {
    color: #1F7FAB;
    font-size: 0.95rem;
}
.q-exam-badge .exam-title {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 640px) {
    .q-exam-badge .exam-title {
        max-width: 400px;
    }
}
@media (max-width: 480px) {
    .q-exam-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    .q-exam-badge .exam-title {
        max-width: 140px;
    }
}
.q-points {
    background: #D1FAE5;
    color: #059669;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.q-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    color: var(--dark);
    font-weight: 500;
}

/* Options */
.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--light);
}
.option-label:hover {
    border-color: #A5B4FC;
    background: #EEF2FF;
}
.option-input {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}
/* Style when checked */
.option-input:checked + .option-text {
    font-weight: 600;
    color: var(--primary);
}
.option-label:has(> .option-input:checked) {
    border-color: var(--primary);
    background: #EEF2FF;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

/* Tipe Soal ANBK: PG Kompleks & Benar-Salah */
.complex-badge-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1rem;
    width: 100%;
}
.complex-option-label {
    position: relative;
    user-select: none;
}
.tf-statement-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}
.tf-statement-table th {
    background: #F3F4F6;
    color: var(--dark);
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    border-bottom: 2px solid var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tf-statement-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-light);
    font-size: 1rem;
}
.tf-statement-table tbody tr:last-child td {
    border-bottom: none;
}
.tf-statement-table tbody tr:hover {
    background: #F9FAFB;
}
.tf-radio-label {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 28px;
}
.tf-radio {
    width: 22px;
    height: 22px;
    cursor: pointer;
}
.tf-radio.radio-true {
    accent-color: #10B981;
}
.tf-radio.radio-false {
    accent-color: #EF4444;
}

.submit-btn {
    margin-top: 1rem;
    margin-bottom: 3rem;
}

/* Result Screen */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}
.score-display {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #EEF2FF;
    border-radius: 12px;
    color: var(--primary);
}
.score-display span {
    font-size: 2.5rem;
    display: block;
    margin-top: 0.5rem;
}

/* Pagination and Map Styles */
.exam-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    width: 100%;
}
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.4rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-nav i {
    font-size: 1.15rem;
    line-height: 1;
}

#btn-prev, #btn-next {
    background: linear-gradient(180deg, #1F7FAB 0%, #155675 100%);
    color: #ffffff;
    border: 1px solid #155675;
}
#btn-prev:hover:not(:disabled), #btn-next:hover:not(:disabled) {
    background: #155675;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(31, 127, 171, 0.3);
}

.btn-nav-finish {
    background: #10B981 !important;
}
.btn-nav-finish:hover:not(:disabled) {
    background: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35) !important;
}

/* Center Refresh Button */
.btn-nav-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    background: #FFC759;
    color: #333333;
    border: 1px solid #e5b350;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-nav-refresh:hover {
    background: #e5b350;
    color: #333333;
    border-color: #d1a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}
.btn-nav-refresh:active {
    transform: scale(0.96);
}
.btn-nav-refresh i {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

@keyframes spinRefresh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.spin-refresh-anim {
    display: inline-block;
    animation: spinRefresh 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    color: var(--primary, #4F46E5) !important;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-light) !important;
    color: var(--gray) !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-outline-small {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
}
.btn-outline-small:hover {
    background: rgba(79, 70, 229, 0.1);
}

.btn-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover {
    background: rgba(79, 70, 229, 0.1);
}

.btn-icon-danger {
    border-color: var(--danger);
    color: var(--danger);
}
.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

#question-map-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}
.map-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}
.map-content {
    position: relative;
    z-index: 101;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.map-content h3 {
    margin: 0 0 1.5rem 0;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}
.close-icon {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.2s;
}
.close-icon:hover {
    color: var(--danger);
}
.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 10px;
    margin-top: 1.5rem;
}
.map-btn {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.map-btn:hover {
    border-color: #cbd5e1;
}
.map-btn.answered {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
.map-btn.active {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Status Badges for Admin */
.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success { background: #D1FAE5; color: #059669; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-danger { background: #FEE2E2; color: #DC2626; }

/* AdminLTE Style Overrides */
body.admin-page {
    background: #f4f6f9;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212529;
    padding: 0;
    margin: 0;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.main-sidebar {
    width: 250px;
    background-color: #343a40;
    color: #c2c7d0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1038;
}

.brand-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem;
    padding: .8125rem .5rem;
    color: rgba(255,255,255,.8);
    border-bottom: 1px solid #4b545c;
    text-decoration: none;
    white-space: nowrap;
    gap: 0.5rem;
}
.brand-link:hover {
    color: #fff;
}
.brand-image {
    margin: 0 !important;
    float: none !important;
    font-size: 1.4rem;
    line-height: 1 !important;
    max-height: none !important;
}
.brand-text {
    line-height: 1 !important;
}

.user-panel {
    border-bottom: 1px solid #4f5962;
    padding: 1rem 0.5rem;
}
.user-panel .info {
    display: inline-block;
}

.nav-sidebar {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-item {
    margin: 0;
}
.nav-link {
    display: flex;
    align-items: center;
    padding: .5rem 1rem;
    color: #c2c7d0;
    text-decoration: none;
    border-radius: .25rem;
    margin: 0 .5rem .2rem .5rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out;
}
.nav-link .nav-icon {
    width: 1.6rem;
    text-align: center;
    margin-right: .5rem;
}
.nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,.1);
}
.nav-link.active {
    background-color: #007bff;
    color: #fff;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    margin-left: 250px;
    background-color: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    padding: 0 .5rem;
    min-height: 3.5rem;
    align-items: center;
}
.navbar-nav {
    display: flex;
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.navbar-nav .nav-item {
    margin: 0;
}
.navbar-nav .nav-link {
    padding: .5rem 1rem;
    color: #6c757d;
    text-decoration: none;
}
.navbar-nav .nav-link:hover {
    color: #343a40;
}
.text-danger {
    color: #dc3545 !important;
}

/* Dashboard Elements */
.content {
    padding: 1rem;
}
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -7.5px;
    margin-left: -7.5px;
}
.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 7.5px;
    padding-left: 7.5px;
}
.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 7.5px;
    padding-left: 7.5px;
}
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }

/* Info Boxes */
.info-box {
    background: #fff;
    border-radius: .25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    display: flex;
    margin-bottom: 1rem;
    min-height: 80px;
    padding: .5rem;
}
.info-box-icon {
    border-radius: .25rem;
    align-items: center;
    display: flex;
    font-size: 1.875rem;
    justify-content: center;
    text-align: center;
    width: 70px;
}
.info-box-icon.bg-info { background-color: #17a2b8; color: #fff; }
.info-box-icon.bg-success { background-color: #28a745; color: #fff; }
.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.8;
    flex: 1;
    padding: 0 10px;
}
.info-box-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.info-box-number {
    display: block;
    font-weight: 700;
}

/* AdminLTE Cards */
.card {
    background-color: #fff;
    border-radius: .25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    border: none; /* override previous glassmorphism */
    padding: 0;
}
.card-outline.card-primary { border-top: 3px solid #007bff; }
.card-outline.card-success { border-top: 3px solid #28a745; }
.card-outline.card-info { border-top: 3px solid #17a2b8; }
.card-outline.card-danger { border-top: 3px solid #dc3545; }

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: .75rem 1.25rem;
    position: relative;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
}
.card-title {
    float: left;
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
}
.card-body {
    padding: 1.25rem;
    flex: 1 1 auto;
}
.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0,0,0,.125);
    padding: .75rem 1.25rem;
}

/* Forms & Buttons */
.form-control {
    display: block;
    width: 100%;
    height: calc(2.25rem + 2px);
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: inset 0 0 0 transparent;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    cursor: pointer;
}
.btn-primary { color: #fff; background-color: #007bff; border-color: #007bff; }
.btn-primary:hover { background-color: #0069d9; border-color: #0062cc; }
.btn-success { color: #fff; background-color: #28a745; border-color: #28a745; }
.btn-success:hover { background-color: #218838; border-color: #1e7e34; }
.btn-block { display: block; width: 100%; }

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    background-color: transparent;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}
.text-center { text-align: center; }

/* Responsive layout adjustments */
@media (max-width: 768px) {
    .main-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    .content-wrapper {
        margin-left: 0;
    }
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Autocomplete for student search */
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}
.autocomplete-items div:hover {
    background-color: #e9e9e9;
}
.autocomplete-items div.disabled {
    color: #999;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

/* Anti-Cheat Overlay */
#anticheat-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 99999; /* Highest priority */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
#anticheat-overlay.hidden {
    display: none !important;
}
.overlay-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2);
    max-width: 600px;
    border: 2px solid #EF4444;
}

/* Clean Minimal Matching UI */
.match-clean-wrapper {
    margin-top: 15px;
}
.match-clean-hint {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.match-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.match-item:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.match-item.is-matched {
    border-color: var(--primary, #4F46E5);
    background: #FAF5FF;
}
.match-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}
.match-badge {
    background: #F1F5F9;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.match-item.is-matched .match-badge {
    background: var(--primary, #4F46E5);
    color: #FFFFFF;
}
.match-premise-text {
    font-size: 0.95rem;
    color: #1E293B;
    font-weight: 500;
    line-height: 1.45;
}
.match-connector {
    color: #94A3B8;
    font-size: 0.9rem;
    padding: 0 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.match-item.is-matched .match-connector {
    color: var(--primary, #4F46E5);
}
.match-right {
    flex: 1;
    min-width: 0;
}
.match-right .matching-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: #1E293B;
    background-color: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}
.match-right .matching-select:hover {
    border-color: #94A3B8;
}
.match-right .matching-select:focus {
    border-color: var(--primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.match-item.is-matched .match-right .matching-select {
    border-color: var(--primary, #4F46E5);
    background-color: #FFFFFF;
    font-weight: 600;
    color: var(--primary, #4F46E5);
}

@media (max-width: 640px) {
    .match-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 10px;
    }
    .match-left {
        padding-right: 0;
    }
    .match-connector {
        display: none;
    }
    .match-right {
        width: 100%;
    }
}

/* Konfirmasi Data Peserta Styling */
.confirm-data-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
.confirm-data-card .confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed #E2E8F0;
}
.confirm-data-card .confirm-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.confirm-data-card .confirm-row:first-child {
    padding-top: 0;
}
#confirm-token-input {
    border: 2px solid #CBD5E1;
    border-radius: 10px;
    transition: all 0.25s ease;
}
#confirm-token-input:focus {
    border-color: var(--primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ===================================================
   MOBILE EXAM RESPONSIVENESS (< 640px and < 420px)
   =================================================== */
@media (max-width: 640px) {

    .student-info {
        max-width: 135px;
    }
    .student-info #display-name {
        font-size: 0.86rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .student-info .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        margin-top: 1px;
    }
    .timer {
        font-size: 0.95rem;
        padding: 0.35rem 0.65rem;
        border-radius: 8px;
        letter-spacing: 0.5px;
    }
    .header-action-btns {
        display: flex;
        gap: 6px;
        align-items: center;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .btn-icon i {
        font-size: 1.1rem;
    }
    
    /* Question Card on Mobile */
    .question-card {
        padding: 1rem 0.85rem;
        border-radius: 12px;
        margin-bottom: 0.9rem;
    }
    .q-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    .q-number {
        font-size: 0.95rem;
    }
    .q-points {
        font-size: 0.72rem;
        padding: 0.15rem 0.45rem;
    }
    .q-text {
        font-size: 0.98rem;
        line-height: 1.6;
        margin-bottom: 1rem;
        word-break: break-word;
    }
    .q-text img, .option-text img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 6px;
        margin: 6px 0;
        display: block;
    }

    /* Options on Mobile */
    .option-label {
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.65rem;
        border-radius: 10px;
        gap: 8px;
        min-height: 48px;
    }
    .option-input {
        width: 20px;
        height: 20px;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    .option-text {
        font-size: 0.95rem;
        line-height: 1.5;
        word-break: break-word;
    }

    /* Table Benar Salah on Mobile */
    .tf-statement-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    .tf-statement-table th {
        padding: 0.55rem 0.5rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }
    .tf-statement-table td {
        padding: 0.65rem 0.5rem;
        font-size: 0.88rem;
    }
    .tf-radio-group {
        gap: 8px;
    }
    .tf-radio-label {
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
    }

    /* Navigation Bar on Mobile */
    .exam-navigation {
        gap: 8px;
        margin-top: 1rem;
        margin-bottom: 0;
    }
    .btn-nav, .btn-nav-refresh {
        padding: 0.65rem 0.6rem;
        border-radius: 10px;
        min-height: 44px;
        justify-content: center;
    }
    .nav-text, .refresh-text, .finish-text {
        display: none !important;
    }
    .btn-nav-prev, .btn-nav-next, .btn-nav-finish {
        flex: 1;
    }
    .btn-nav-refresh {
        flex: 1;
    }
    .btn-nav i, .btn-nav-refresh i {
        font-size: 1.1rem;
    }
    
    /* Map modal on Mobile */
    .map-content {
        width: 94%;
        padding: 1.25rem 1rem;
        border-radius: 12px;
        max-height: 85vh;
    }
    .map-grid {
        gap: 8px;
        margin-top: 1rem;
    }
    .map-btn {
        font-size: 0.85rem;
    }
}

@media (max-width: 420px) {
    .exam-navigation {
        gap: 6px;
    }
    .btn-nav, .btn-nav-refresh {
        padding: 0.6rem 0.4rem;
        font-size: 0.82rem;
        gap: 4px;
    }
    .btn-nav i, .btn-nav-refresh i {
        font-size: 1.05rem;
    }
    .student-info {
        max-width: 105px;
    }
    .student-info #display-name {
        font-size: 0.8rem;
    }
    .timer {
        font-size: 0.88rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Fix Tailwind CSS globally resetting image display to block, which breaks WYSIWYG center alignments */
.exam-screen-container img {
    display: inline-block;
}

/* Searchable Exam Dropdown Styles */
.exam-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    max-height: 220px;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: auto;
    z-index: 1050;
}

.exam-dropdown-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #333333;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.12s ease, color 0.12s ease;
    user-select: none;
    line-height: 1.35;
}

.exam-dropdown-item:last-child {
    border-bottom: none;
}

.exam-dropdown-item:hover,
.exam-dropdown-item.active {
    background-color: #f2f4f8;
    color: #1F7FAB;
}

.exam-dropdown-item.selected {
    background-color: #e8f0fe;
    font-weight: 600;
    color: #1F7FAB;
}

.custom-dropdown-scroll::-webkit-scrollbar {
    width: 10px;
}

.custom-dropdown-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 4px 0;
}

.custom-dropdown-scroll::-webkit-scrollbar-thumb {
    background: #707070;
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

.custom-dropdown-scroll::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

