/* Courselord CBT - Main Stylesheet */
:root {
    --primary: #491d54;
    --primary-dark: #3a1744;
    --secondary: #d170e1;
    --secondary-light: #e8a5f2;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============ ADMIN LAYOUT ============ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.admin-sidebar::-webkit-scrollbar {
    display: none;
}

.admin-sidebar .sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.admin-sidebar .sidebar-nav a:hover,
.admin-sidebar .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-sidebar .sidebar-nav a.active {
    border-right: 3px solid var(--secondary);
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============ EXAM INTERFACE ============ */
.exam-body {
    background: #fff;
}

.exam-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.exam-topbar {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.exam-body-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.exam-nav-panel {
    width: 260px;
    background: #f8f9fa;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.exam-question-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.question-card {
    display: none;
}

.question-card.active {
    display: block;
}

.question-nav-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
}

.question-nav-btn.answered {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.question-nav-btn.unanswered {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.question-nav-btn.current {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(73,29,84,0.2);
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.option-item:hover {
    border-color: var(--secondary);
    background: #fdf5ff;
}

.option-item.selected {
    border-color: var(--primary);
    background: rgba(73,29,84,0.05);
}

.option-item.selected .option-radio input[type="radio"]:checked {
    background: var(--primary);
}

.option-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.option-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    pointer-events: none;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.option-text {
    padding-top: 3px;
    line-height: 1.4;
}

/* ============ BUTTONS ============ */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: white !important;
}

/* ============ CARDS ============ */
.card {
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

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

    .admin-main {
        margin-left: 0;
    }

    .exam-nav-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 280px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }

    .exam-nav-panel.show {
        transform: translateX(0);
    }

    .exam-question-area {
        padding-bottom: 6rem;
    }

    .option-item {
        padding: 0.75rem;
    }
}

@media (min-width: 768px) {
    .admin-topbar {
        display: none;
    }
}

/* ============ MISC ============ */
.progress-bar {
    transition: width 0.5s ease;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(209,112,225,0.25);
}

/* Print styles */
@media print {
    .exam-topbar, .exam-nav-panel, .admin-sidebar, .admin-topbar, .btn, .d-grid, .no-print {
        display: none !important;
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
