/* ================================ */
/* Global Styles */
/* ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ================================ */
/* Login Page */
/* ================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    margin-bottom: 20px;
}

.login-box h1 {
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #6b7280;
    margin-bottom: 30px;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 12px;
    color: #4b5563;
    text-align: left;
}

.demo-credentials strong {
    display: block;
    margin-bottom: 5px;
    color: #1f2937;
}

/* ================================ */
/* Course Selection */
/* ================================ */
.courses-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 30px 0;
    max-height: 400px;
    overflow-y: auto;
}

.course-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s;
}

.course-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.course-card h3 {
    color: #1f2937;
    margin-bottom: 5px;
    font-size: 16px;
}

.course-card .course-code {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 8px;
}

.course-card p {
    color: #6b7280;
    font-size: 13px;
}

/* ================================ */
/* Form Elements */
/* ================================ */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ================================ */
/* Buttons */
/* ================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0 4px;
}

.btn-block {
    width: 100%;
    margin-top: 20px;
}

/* ================================ */
/* Admin Panel */
/* ================================ */
.admin-container {
    background: #f3f4f6;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 14px;
}

/* Tabs */
.tabs {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.tab {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
}

.tab:hover {
    background: #f9fafb;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f9fafb;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Cards */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.card h2 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 20px;
}

.card h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.info-card h2 {
    color: white;
    margin-bottom: 15px;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.info-card li:last-child {
    border-bottom: none;
}

/* Question Banks */
.question-banks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.bank-count {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
}

.questions-list {
    max-height: 400px;
    overflow-y: auto;
}

.question-item {
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.question-item p {
    color: #374151;
    font-size: 14px;
    margin-bottom: 8px;
}

.question-item-options {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Tables */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.results-table th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
}

.no-data {
    text-align: center;
    color: #6b7280;
    padding: 40px !important;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

/* ================================ */
/* Student Exam Interface */
/* ================================ */
.exam-start-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.start-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 800px;
    width: 100%;
}

.start-card h1 {
    color: #1f2937;
    margin-bottom: 30px;
    text-align: center;
    font-size: 32px;
}

.exam-instructions {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.exam-instructions h2 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 20px;
}

.exam-instructions ul {
    list-style: none;
    color: #374151;
}

.exam-instructions li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.exam-instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Exam Interface */
.exam-interface {
    background: #f3f4f6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.exam-watermark {
    position: relative;
}

.exam-watermark::before {
    content: 'MOCK TEST';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 120px;
    font-weight: bold;
    color: rgba(79, 70, 229, 0.12);
    z-index: 1;
    pointer-events: none;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.exam-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 15;
}

.exam-header .header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-header h1 {
    font-size: 24px;
}

.exam-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.timer {
    background: rgba(255,255,255,0.2);
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    font-family: monospace;
}

/* Section Tabs */
.section-tabs {
    background: white;
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 20px;
    position: relative;
    z-index: 10;
}

.section-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.section-dropdown {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 280px;
}

.section-dropdown:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.section-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Exam Content */
.exam-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    position: relative;
    z-index: 5;
}

.section-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #92400e;
}

/* Question Panel */
.question-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 5;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.question-header h2 {
    color: #1f2937;
    font-size: 18px;
}

.marks-badge {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.question-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-box p {
    color: #1f2937;
    font-size: 16px;
    line-height: 1.6;
}

/* Options */
.options-container {
    margin-bottom: 30px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-item:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.option-item.selected {
    border-color: #667eea;
    background: #eff6ff;
}

.option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.option-item label {
    flex: 1;
    cursor: pointer;
    color: #374151;
    font-size: 15px;
}

/* Answer Container */
.answer-container textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
}

.answer-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Question Actions */
.question-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    padding-top: 25px;
    border-top: 2px solid #e5e7eb;
    gap: 12px;
    flex-wrap: wrap;
}

/* Question Palette */
.question-palette {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 5;
}

.question-palette h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 18px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.palette-item {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.palette-item:hover {
    transform: scale(1.1);
}

.palette-item.current {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.palette-item.answered {
    background: #10b981;
    color: white;
}

.palette-item.not-answered {
    background: #fca5a5;
    color: white;
}

.palette-item.not-visited {
    background: #e5e7eb;
    color: #6b7280;
}

.palette-item.marked {
    background: #c084fc;
    color: white;
}

.palette-item.answered-marked {
    background: #a855f7;
    color: white;
}

/* Palette Legend */
.palette-legend {
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #6b7280;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
}

/* Palette Summary */
.palette-summary {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.palette-summary h4 {
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 14px;
}

.palette-summary p {
    font-size: 13px;
    color: #6b7280;
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .exam-content {
        grid-template-columns: 1fr;
    }
    
    .question-palette {
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .question-banks {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .palette-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .section-tabs {
        flex-direction: column;
    }
}

/* ================================ */
/* Security Warning Modal */
/* ================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    text-align: center;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.security-warning {
    border-left: 5px solid #ef4444;
}

.security-warning h2 {
    color: #ef4444;
    margin-bottom: 15px;
    font-size: 24px;
}

.security-warning p {
    color: #374151;
    margin-bottom: 15px;
    font-size: 14px;
}

.warning-timer {
    background: #fee2e2;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.warning-timer p {
    font-size: 16px;
    color: #991b1b;
    font-weight: bold;
}

#warningCountdown {
    font-size: 24px;
    color: #dc2626;
    font-weight: bold;
}

.warning-buttons {
    margin-top: 25px;
}

.warning-buttons .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* ================================ */
/* Instructions Page */
/* ================================ */
.instructions-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
}

.instructions-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
}

/* Header */
.instructions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: none;
}

.header-logo {
    flex-shrink: 0;
}

.logo-circle {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.header-text {
    flex: 1;
}

.instructions-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

.instructions-header p {
    font-size: 13px;
    margin: 5px 0 0 0;
    opacity: 0.95;
    font-weight: 500;
}

/* Content Grid */
.instructions-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    padding: 30px 40px;
    min-height: 500px;
}

/* Left: Timeline */
.instructions-left {
    border-right: 1px solid #e5e7eb;
    padding-right: 40px;
    margin-right: 0;
}

.timeline {
    position: relative;
    margin: 0;
    padding: 0;
}

.instructions-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    display: flex;
    margin-bottom: 25px;
    position: relative;
    padding: 0;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: #667eea;
    border: 3px solid white;
    border-radius: 50%;
    position: relative;
    margin-top: 2px;
    margin-right: 20px;
    box-shadow: 0 0 0 2px #667eea;
    z-index: 2;
}

.timeline-item.critical .timeline-marker {
    background: #dc2626;
    box-shadow: 0 0 0 2px #dc2626;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 25px;
    width: 2px;
    height: calc(100% + 25px);
    background: #e5e7eb;
    z-index: 1;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    flex: 1;
    padding-top: 2px;
    color: #374151;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.timeline-content strong {
    color: #1f2937;
    font-weight: 600;
}

.timeline-item.critical .timeline-content {
    color: #dc2626;
    font-weight: 500;
}

.choice-item {
    background: #f3f4f6;
    border-left: 3px solid #667eea;
    padding: 10px 12px;
    margin: 10px 0 0 0;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}

/* Right: Note Section */
.instructions-right {
    padding-left: 0;
    margin-left: 0;
}

.note-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    margin: 0;
}

.note-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.note-list {
    list-style: decimal;
    padding-left: 20px;
    margin: 0;
    color: #374151;
}

.note-list li {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #1f2937;
}

.note-list li:last-child {
    margin-bottom: 0;
}

/* Footer */
.instructions-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 300px;
    margin: 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.checkbox-wrapper label {
    color: #1f2937;
    font-size: 12px;
    cursor: pointer;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.btn-next {
    padding: 11px 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.btn-next:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-next:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.4);
}

.btn-next:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.arrow {
    font-weight: 700;
    font-size: 16px;
}

/* ================================ */
/* Confirmation Modal */
/* ================================ */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    display: none;
}

.confirmation-modal.show {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    position: relative;
    z-index: 1001;
    margin: auto;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 25px 20px;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.modal-body p {
    margin: 0 0 15px 0;
    font-weight: 500;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0 0 0 !important;
    font-size: 12px;
    color: #92400e;
}

.modal-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 0;
    flex-shrink: 0;
}

.btn-no,
.btn-yes {
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-no {
    background: #e5e7eb;
    color: #374151;
}

.btn-no:hover {
    background: #d1d5db;
}

.btn-yes {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-yes:hover {
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    transform: translateY(-1px);
}

/* ================================ */
/* Section Selection Page */
/* ================================ */
.section-selection-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.section-selection-container {
    width: 100%;
    max-width: 1200px;
}

.selection-header {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.selection-header h2 {
    color: #dc2626;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.selection-header p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.section-card-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-card-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.section-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.section-details {
    padding: 20px;
    flex: 1;
    background: #f9fafb;
}

.section-details p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.section-details p:last-child {
    margin-bottom: 0;
}

.section-details strong {
    color: #1f2937;
    font-weight: 600;
}

.timer-display {
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
}

.attempt-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    margin: 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.attempt-btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

.attempt-btn span {
    font-size: 18px;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }

    .section-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-badge {
        margin-top: 10px;
    }

    .selection-header {
        padding: 20px;
    }

    .selection-header h2 {
        font-size: 18px;
    }
}

/* Instructions Responsive */
@media (max-width: 768px) {
    .instructions-wrapper {
        border-radius: 0;
        margin: 0;
    }

    .instructions-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .instructions-header h1 {
        font-size: 24px;
    }

    .instructions-content-grid {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 20px;
        min-height: auto;
    }

    .instructions-left {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .instructions-right {
        padding-left: 0;
    }

    .instructions-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .checkbox-wrapper {
        min-width: 100%;
        order: 1;
    }

    .btn-next {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .timeline-content {
        font-size: 12px;
    }

    .modal-dialog {
        width: 95%;
        max-width: 450px;
    }
}