* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.score-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #e8eeff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    gap: 40px;
    border: 2px solid #667eea;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.score-label {
    color: #666;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    color: #667eea;
    font-size: 28px;
    font-weight: bold;
}

.intro-section {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.intro-section.active {
    display: block;
}

.intro-section h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.intro-section p {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 30px;
}

.scenario-section {
    display: none;
}

.scenario-section.active {
    display: block;
}

.step-indicator {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.scenario-content {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.scenario-content h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scenario-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 15px;
}

.patient-list {
    margin-top: 15px;
    padding-left: 20px;
}

.patient-list li {
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.question {
    background: #fffbf0;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.question h4 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    padding: 15px 20px;
    background: white;
    border: 2px solid #ffc107;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    text-align: left;
}

.answer-option:hover {
    background: #fffbf0;
    border-color: #ff9800;
}

.answer-option.selected {
    border-color: #667eea;
    background: #e8eeff;
}

.answer-option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.answer-option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
    font-weight: 600;
}

.feedback-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    display: none;
    font-weight: 500;
}

.feedback-message.show {
    display: block;
}

.feedback-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.nav-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start-button {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.completion-section {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.completion-section.active {
    display: block;
}

.completion-section h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.final-score {
    font-size: 48px;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.final-accuracy {
    font-size: 24px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 30px;
}

.results-card {
    background: #f5f5f5;
    border-left: 4px solid #667eea;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: left;
}

.results-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.results-card p {
    color: #555;
    line-height: 1.6;
    font-size: 16px;
    margin-bottom: 10px;
}

.completion-message {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.performance-badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 16px;
}

.performance-badge.mastery {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.performance-badge.excellent {
    background: #cfe2ff;
    color: #084298;
    border: 2px solid #0d6efd;
}

.performance-badge.good {
    background: #fff3cd;
    color: #664d03;
    border: 2px solid #ffc107;
}

.performance-badge.improving {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popover-overlay.show {
    opacity: 1;
    visibility: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popover-overlay.critical .popover-box {
    border-left: 6px solid #f44336;
    background: #fff5f5;
}

.popover-overlay.critical .popover-icon {
    color: #f44336;
    font-size: 48px;
}

.popover-overlay.critical .popover-title {
    color: #f44336;
    font-weight: bold;
}

.popover-overlay.critical .popover-message {
    color: #d32f2f;
    white-space: pre-wrap;
    line-height: 1.6;
}

.popover-overlay:not(.critical) .popover-box {
    border-left: 6px solid #4CAF50;
}

.popover-overlay:not(.critical) .popover-icon {
    color: #4CAF50;
}

.popover-overlay:not(.critical) .popover-title {
    color: #4CAF50;
}

.popover-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: popoverSlide 0.4s ease-out;
}

@keyframes popoverSlide {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popover-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.popover-title {
    font-size: 24px;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}

.popover-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.popover-button {
    padding: 10px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popover-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .score-bar {
        flex-direction: column;
        gap: 15px;
    }
}

/* Final Quiz Section Styling - SAME AS TRAINING */
.final-quiz-section {
    display: none;
}

.final-quiz-section.active {
    display: block;
}

#finalQuizContainer {
    margin-bottom: 20px;
}

#finalQuizContainer .question {
    margin: 0;
}

#finalQuizContainer .question h4 {
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 18px;
}

#finalQuizContainer .answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

#finalQuizContainer .answer-option {
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #333;
}

#finalQuizContainer .answer-option:hover {
    background: #e8e8e8;
}

#finalQuizContainer .answer-option.selected {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Navigation Buttons */
.nav-button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-button:hover:not(:disabled) {
    background: #764ba2;
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}
