:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
}

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

body {
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.logo h2 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-btn {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background-color: var(--bg);
    color: var(--text-main);
}

.menu-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 3rem 4rem;
    scroll-behavior: smooth;
}

header {
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-main);
}

.question-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(0,0,0,0.08);
}

.question-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.options {
    list-style: none;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options li {
    padding: 0.75rem 1rem;
    background-color: var(--bg);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.btn-answer {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-answer:hover {
    background-color: var(--primary);
    color: white;
}

.answer-box {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: #ECFDF5;
    border-left: 4px solid var(--success);
    border-radius: 0.5rem;
    color: #065F46;
    line-height: 1.6;
}

.answer-box.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.answer-box strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #047857;
}

.tips-card {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

.tips-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.tips-card ul {
    margin-left: 1.5rem;
    line-height: 1.8;
}

/* =========================================
   MODE UJIAN STYLES
   ========================================= */

.exam-control-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.exam-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-settings input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
}

.btn-start-exam, .btn-finish-exam {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-start-exam {
    background-color: var(--primary);
    color: white;
}
.btn-start-exam:hover { background-color: var(--primary-hover); }

.btn-finish-exam {
    background-color: #EF4444;
    color: white;
    display: none;
}
.btn-finish-exam:hover { background-color: #DC2626; }

.floating-timer {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: var(--surface);
    border: 2px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    transition: all 0.3s;
}

.floating-timer.warning {
    border-color: #EF4444;
    color: #EF4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Radio Button Styles */
.options-radio {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.options-radio label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.options-radio label:hover {
    background-color: var(--bg);
}

.options-radio input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

.options-radio label.selected {
    border-color: var(--primary);
    background-color: #EEF2FF;
}

.options-radio label.correct {
    border-color: var(--success);
    background-color: #ECFDF5;
}

.options-radio label.wrong {
    border-color: #EF4444;
    background-color: #FEF2F2;
}

/* Modal Result */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--surface);
    padding: 3rem;
    border-radius: 1.5rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 10px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 800;
    margin: 0 auto 2rem;
    color: var(--primary);
}

.score-details {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.score-details div {
    font-size: 1.25rem;
    font-weight: 600;
}

.score-details .correct { color: var(--success); }
.score-details .wrong { color: #EF4444; }
.score-details .empty { color: var(--text-muted); }

.btn-close-modal {
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================
   MODE SELECTOR STYLES
   ========================================= */

.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.btn-mode {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--border);
    background-color: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mode:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-mode.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
