.exam-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.exam-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.exam-header h1 {
    font-size: 20px;
    margin: 0;
}

.exam-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.exam-time {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-time.warning {
    background: #ff6b6b;
    padding: 5px 15px;
    border-radius: 5px;
}

.exam-time.critical {
    background: #ff0000;
    padding: 5px 15px;
    border-radius: 5px;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.exam-progress {
    width: 150px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.exam-progress-bar {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.exam-body {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.exam-content {
    padding: 30px;
    overflow-y: auto;
    background: white;
}

.question-header {
    margin-bottom: 20px;
}

.question-number {
    color: #999;
    font-size: 14px;
}

.question-text {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option-item:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.option-item input[type="radio"] {
    margin: 3px 15px 0 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-item label {
    margin: 0;
    flex: 1;
    cursor: pointer;
    font-weight: normal;
}

.option-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.exam-navigation {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: space-between;
}

.btn-nav {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-prev {
    background: #e0e0e0;
    color: #333;
}

.btn-prev:hover:not(:disabled) {
    background: #d0d0d0;
}

.btn-next {
    background: #667eea;
    color: white;
}

.btn-next:hover:not(:disabled) {
    background: #764ba2;
}

.btn-submit {
    background: #4caf50;
    color: white;
    padding: 12px 40px;
    margin-top: 30px;
}

.btn-submit:hover {
    background: #45a049;
}

/* Sidebar */
.exam-sidebar {
    background: #f9f9f9;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    padding: 0 10px;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.question-btn {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.question-btn:hover {
    border-color: #667eea;
}

.question-btn.answered {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.question-btn.visited {
    background: #ffc107;
    color: white;
    border-color: #ffc107;
}

.question-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

.question-btn.unanswered {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.sidebar-legend {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Results Page */
.results-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.score-display {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

.score-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-card.success {
    border-left-color: #4caf50;
}

.stat-card.danger {
    border-left-color: #f44336;
}

.stat-card .number {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
}

.questions-review {
    margin-top: 40px;
}

.questions-review h2 {
    color: #333;
    margin-bottom: 20px;
}

.question-review {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fafafa;
}

.question-review.correct {
    border-left: 4px solid #4caf50;
}

.question-review.incorrect {
    border-left: 4px solid #f44336;
}

.review-question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.question-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.question-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.question-status.correct {
    background: #e8f5e9;
    color: #2e7d32;
}

.question-status.incorrect {
    background: #ffebee;
    color: #c62828;
}

.review-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.review-options {
    margin-bottom: 15px;
}

.review-option {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
    border-left: 3px solid #ddd;
    background: white;
    transition: all 0.2s ease;
}

.review-option.selected {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
}

.review-option.correct {
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.review-option.incorrect {
    background: #ffebee;
    border-left: 3px solid #f44336;
}

.review-option.selected.correct {
    background: linear-gradient(90deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 3px solid #4caf50;
}

.review-option.selected.incorrect {
    background: linear-gradient(90deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 3px solid #f44336;
}

.review-explanation {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
    line-height: 1.6;
}

.review-explanation strong {
    color: #667eea;
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

.review-explanation p {
    color: #333;
    margin: 0;
    font-size: 14px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.review-explanation-container {
    margin-top: 15px;
}

.btn-explanation-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-explanation-toggle:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-explanation-toggle:active {
    transform: translateY(0);
}

.btn-explanation-toggle.active {
    background: #764ba2;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

.results-actions .btn {
    flex: 1;
    max-width: 250px;
}
