:root {
    --primary-color: #1b3a2f;
    --primary-color-hover: #2e5c4c;
    --light-bg: #f9f9f9;
    --subtle-border-color: #e2e8f0;
    --text-color-primary: #333;
    --text-color-secondary: #6b7280;
    --page-bg: #f9f9f9;
    --card-bg: #ffffff;
    --header-bg: #1b3a2f;
    --header-text: white;
    --hover-bg: #f8f9fa;
    --active-item-bg: #dcfce7;
    --active-item-text: #10b981;
    --shadow-color: rgba(0,0,0,0.1);
    --answered-neutral-border: #2e5c4c;
    --warning-color: #f59e0b;
    --success-color: #10b981;
}

/* --- GLOBAL & SECURITY STYLES --- */

* {
    -webkit-user-select: none !important; -moz-user-select: none !important; -ms-user-select: none !important; user-select: none !important;
    -webkit-touch-callout: none !important; -webkit-tap-highlight-color: transparent !important;
    -webkit-user-drag: none !important; -khtml-user-drag: none !important; -moz-user-drag: none !important; -o-user-drag: none !important;
}

body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background-color: var(--page-bg); 
    color: var(--text-color-primary); 
    height: 100vh; 
    overflow-y: auto; 
    -webkit-print-color-adjust: exact; 
    print-color-adjust: exact; 
}

body.exam-mode { overflow: hidden; }

::selection { background: transparent !important; color: inherit !important; }
::-moz-selection { background: transparent !important; color: inherit !important; }

.hidden { display: none !important; }

/* --- OVERLAYS & PROMPTS --- */

#security-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.95)); 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    z-index: 9999; color: white; font-size: 24px; text-align: center; 
    padding: 20px; box-sizing: border-box; backdrop-filter: blur(10px); 
}
#security-overlay h1 { margin-bottom: 20px; font-size: 32px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
#security-overlay .warning-details { background: rgba(0,0,0,0.4); padding: 25px; border-radius: 15px; margin: 20px 0; max-width: 600px; border: 2px solid rgba(255,255,255,0.2); }
#security-overlay button {
    padding: 15px 30px; font-size: 18px; background: white; color: #e74c3c; 
    border: none; border-radius: 8px; cursor: pointer; margin-top: 25px; font-weight: 600;
}

.fullscreen-prompt { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); display: flex; flex-direction: column; 
    justify-content: center; align-items: center; z-index: 10000; 
    color: white; text-align: center; padding: 20px; 
}

/* --- SETUP SCREEN --- */

.screen-container { 
    display: flex; flex-direction: column; justify-content: center; 
    align-items: center; min-height: 100vh; padding: 20px; 
    box-sizing: border-box; background: linear-gradient(135deg, var(--page-bg), #e8f4f8); 
}

.card { 
    background-color: #ffffff; border-radius: 8px; padding: 2.5rem; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); border: 1px solid #e2e8f0;  
    width: 100%; max-width: 600px; text-align: center; 
}
.card h1 { font-size: 28px; color: var(--primary-color); margin-bottom: 15px; }
.card p { color: var(--text-color-secondary); margin-bottom: 30px; line-height: 1.6; }

.form-group { margin-bottom: 25px; text-align: left; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-color-primary); }
.form-group select, .form-group input { width: 100%; padding: 15px; border-radius: 8px; border: 2px solid var(--subtle-border-color); font-size: 16px; transition: border-color 0.3s ease; background: white; box-sizing: border-box; }
.form-group input[type="checkbox"] { width: auto; margin-right: 10px; vertical-align: middle; }
.form-group select:focus, .form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(27, 58, 47, 0.1); }
.form-group input, .form-group select { -webkit-user-select: text !important; -moz-user-select: text !important; -ms-user-select: text !important; user-select: text !important; }

.btn-primary { 
    padding: 15px 25px; font-size: 16px; border: none; border-radius: 8px; 
    cursor: pointer; background: linear-gradient(135deg, #1b3a2f 0%, #2e5c4c 100%); 
    color: white; width: 100%; text-decoration: none; display: inline-block; 
    text-align: center; transition: all 0.3s ease; font-weight: 600; 
    box-shadow: 0 4px 15px rgba(27, 58, 47, 0.3); 
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #2e5c4c 0%, #1b3a2f 100%); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(27, 58, 47, 0.4); }
.btn-primary:disabled { background: #cccccc; cursor: not-allowed; transform: none; box-shadow: none; }

.security-warning { background: linear-gradient(135deg, #fff3cd, #ffeaa7); border: 2px solid #f39c12; padding: 20px; border-radius: 12px; margin: 25px 0; text-align: left; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2); }
.security-warning h3 { color: #856404; margin-top: 0; font-size: 18px; font-weight: 700; }
.security-warning ul { color: #856404; margin: 15px 0; padding-left: 20px; }
.security-warning li { margin: 8px 0; font-weight: 500; }

/* --- EXAM SCREEN --- */

.lms-header {
    background: linear-gradient(135deg, #1b3a2f 0%, #2e5c4c 100%); 
    padding: 0 25px; display: flex; justify-content: space-between; 
    align-items: center; height: 70px; position: fixed; top: 0; left: 0; 
    right: 0; z-index: 1001; box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    border-bottom: 3px solid rgba(255,255,255,0.1); 
}
.header-title { font-size: 18px; color: var(--header-text); font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.timer { 
    font-size: 18px; font-weight: 600; color: var(--header-text); 
    background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.2)); 
    padding: 10px 20px; border-radius: 25px; border: 2px solid rgba(255,255,255,0.2); 
    min-width: 80px; text-align: center; font-family: 'Courier New', monospace; letter-spacing: 1px; 
}
.timer.warning { background: linear-gradient(135deg, var(--warning-color), #c0392b); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.finish-button { 
    font-size: 15px; font-weight: 600; background: linear-gradient(135deg, #e74c3c, #c0392b); 
    color: white; padding: 12px 25px; border-radius: 25px; border: none; 
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); 
}
.finish-button:hover { background: linear-gradient(135deg, #c0392b, #96281b); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4); }

.lms-wrapper { display: flex; padding-top: 70px; height: 100vh; box-sizing: border-box; }
.sidebar { 
    width: 280px; background: #ffffff; border-right: 1px solid #e2e8f0; 
    padding: 20px; border-right: 2px solid var(--subtle-border-color); 
    flex-shrink: 0; display: flex; flex-direction: column; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.05); 
}
.sidebar h3 { font-size: 18px; margin: 0 0 15px 0; color: var(--text-color-primary); padding: 0 5px; font-weight: 700; }
#question-list { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 5px; }
.question-box { padding: 15px 18px; font-size: 15px; color: var(--text-color-secondary); border-radius: 8px; cursor: pointer; border: 2px solid var(--subtle-border-color); transition: all 0.3s ease; background-color: var(--card-bg); font-weight: 500; }
.question-box:hover { border-color: var(--primary-color); background-color: var(--hover-bg); transform: translateX(3px); }
.question-box.answered { border-left: 5px solid var(--answered-neutral-border); font-weight: 600; background: linear-gradient(90deg, var(--active-item-bg), var(--card-bg)); }
.question-box.active { border-color: var(--primary-color); background: linear-gradient(135deg, var(--active-item-bg), #e0f2f1); color: var(--primary-color); font-weight: 700; box-shadow: 0 4px 15px rgba(27, 58, 47, 0.2); }

.main-content { flex-grow: 1; padding: 30px; overflow-y: auto; background: linear-gradient(135deg, #fafbfc, var(--page-bg)); }
#question-area { max-width: 900px; margin: 0 auto; background-color: var(--card-bg); border-radius: 15px; padding: 40px; box-shadow: 0 10px 30px var(--shadow-color); border: 1px solid var(--subtle-border-color); min-height: 75vh; }
#question-text { font-size: 22px; font-weight: 600; line-height: 1.6; margin: 0 0 40px 0; color: var(--text-color-primary); }
#options-container { display: flex; flex-direction: column; gap: 15px; }
.option-btn { display: flex; align-items: start; gap: 15px; width: 100%; margin: 0; padding: 20px; font-size: 16px; border: 2px solid var(--subtle-border-color); background-color: transparent; border-radius: 12px; cursor: pointer; text-align: left; transition: all 0.3s ease; color: var(--text-color-primary); line-height: 1.5; }
.option-btn:hover { border-color: var(--primary-color); background: linear-gradient(135deg, var(--light-bg), #e8f4f8); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(27, 58, 47, 0.15); }
.option-btn.selected { border-color: var(--primary-color); background: linear-gradient(135deg, var(--active-item-bg), #e0f2f1); font-weight: 600; box-shadow: 0 6px 20px rgba(27, 58, 47, 0.2); }
.option-letter { font-weight: 700; color: var(--primary-color); min-width: 25px; font-size: 18px; }

/* --- MODAL STYLES --- */

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1050; backdrop-filter: blur(5px); }
.modal-content { background: var(--card-bg); padding: 35px; border-radius: 15px; width: 90%; max-width: 450px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); }
.modal-content h2 { margin-top: 0; color: var(--primary-color); font-size: 24px; font-weight: 700; }
.modal-footer { display: flex; justify-content: center; gap: 15px; margin-top: 30px; }
.modal-btn { padding: 12px 25px; font-size: 15px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; font-weight: 600; transition: all 0.3s ease; }
.modal-btn.primary { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }
.modal-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4); }
.modal-btn.secondary { background-color: transparent; color: var(--text-color-secondary); border-color: var(--subtle-border-color); }
.modal-btn.secondary:hover { background-color: var(--light-bg); transform: translateY(-2px); }

/* --- PRINT & RESPONSIVE STYLES --- */

@media print {
    * { visibility: hidden !important; display: none !important; }
    body { background: white !important; }
    body::after { 
        content: "⚠️ EXAM SECURITY VIOLATION ⚠️\A\APRINTING IS STRICTLY PROHIBITED.\A\AThis violation has been recorded."; 
        visibility: visible !important; display: block !important; position: fixed !important; 
        top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; 
        font-size: 32px !important; color: red !important; font-weight: bold !important; 
        text-align: center !important; white-space: pre !important; z-index: 99999 !important; 
        background: white !important; padding: 40px !important; border: 5px solid red !important; 
    }
}

@media (max-width: 768px) {
    .lms-wrapper { flex-direction: column; }
    .sidebar { width: 100%; height: auto; max-height: 280px; border-right: none; border-bottom: 2px solid var(--subtle-border-color); }
    .main-content { padding: 20px; }
    #question-area { padding: 25px; }
    .card { padding: 30px 25px; max-width: 100%; }
    .lms-header { padding: 0 15px; height: 65px; }
    .header-title { font-size: 16px; }
    .timer { font-size: 16px; padding: 8px 15px; }
    .finish-button { padding: 10px 20px; font-size: 14px; }
}
