/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header-content {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

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

/* Scenario Selection */
.scenario-selection h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.scenario-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
}

.scenario-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.scenario-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.scenario-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.scenario-card p {
    color: #7f8c8d;
    line-height: 1.5;
}

/* Assessment Screen */
.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.scenario-title h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* Emergency Alert */
.emergency-alert {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    animation: pulse 2s infinite;
}

.emergency-alert.hidden {
    display: none;
}

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

.alert-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-content i {
    font-size: 2rem;
}

.alert-text h3 {
    margin-bottom: 5px;
}

/* ABCDE Assessment */
.assessment-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.assessment-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.abcde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.abcde-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.abcde-item.completed {
    background: #d4edda;
    border-color: #28a745;
}

.abcde-item.critical {
    background: #f8d7da;
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.abcde-letter {
    font-weight: bold;
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 5px;
}

.abcde-item.critical .abcde-letter {
    color: #dc3545;
}

/* Question Section */
.question-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.question-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.question-content p {
    color: #5a6c7d;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Question Types */
.question-type {
    display: none;
}

.question-type.active {
    display: block;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.options-list {
    display: grid;
    gap: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.option-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.text-input, .unit-select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.text-input:focus, .unit-select:focus {
    outline: none;
    border-color: #667eea;
}

.unit-select {
    width: auto;
    min-width: 120px;
}

/* Clinical Notes */
.clinical-notes {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.clinical-notes h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notes-content {
    max-height: 200px;
    overflow-y: auto;
}

.note-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
}

.note-item.emergency {
    border-left-color: #dc3545;
    background: #fff5f5;
}

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 2rem;
}

.results-content {
    display: grid;
    gap: 25px;
}

.result-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.result-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.abcde-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.abcde-result-item {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.abcde-result-item.normal {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.abcde-result-item.abnormal {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.red-flags-list, .differentials-list, .tests-list, .urgent-actions-list {
    display: grid;
    gap: 10px;
}

.flag-item, .differential-item, .test-item, .action-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #dc3545;
}

.flag-item.high-priority {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.flag-item.medium-priority {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.test-item {
    border-left-color: #28a745;
    background: #f8fff9;
}

.action-item {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.diagnosis-content, .treatment-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.footer p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .scenario-grid {
        grid-template-columns: 1fr;
    }
    
    .assessment-header {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-bar {
        width: 100%;
        max-width: 300px;
    }
    
    .abcde-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .scenario-card {
        padding: 20px;
    }
    
    .assessment-section,
    .question-section,
    .result-section {
        padding: 20px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.option-btn:focus,
.text-input:focus,
.unit-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .emergency-alert {
        display: none !important;
    }
    
    .results-content {
        display: block !important;
    }
    
    .result-section {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}