/* Global Styles */
:root {
    --primary-color: #0056b3; /* Medical Blue */
    --secondary-color: #f0f4f8;
    --accent-color: #e63946; /* Emergency Red */
    --success-color: #2a9d8f;
    --text-color: #333;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f7f9fc;
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    width: 150px;
    height: 10px;
    background: #e1e4e8;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    min-width: 80px;
}

/* Content Card */
.content-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
}

.primary-btn:hover {
    background-color: #004494;
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background-color: white;
    color: #666;
    border: 1px solid #ddd;
}

.secondary-btn:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Sections */
.hidden-section {
    display: none !important;
}

.active-section {
    display: flex !important;
    animation: slideUp 0.5s ease-out;
}

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

/* Intro Persona Box */
.persona-box {
    background: #f0f7ff;
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    text-align: left;
    margin-bottom: 30px;
    border-radius: 4px;
    max-width: 600px;
    width: 100%;
}

/* Training Steps */
.step-card {
    max-width: 600px;
    width: 100%;
}

.step-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 20px;
}

.step-visual {
    font-size: 5rem;
    margin: 20px 0;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

#step-title {
    color: #2c3e50;
    margin-bottom: 15px;
}

#step-description {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.step-rationale {
    background: #fff8e1;
    border: 1px solid #ffe0b2;
    padding: 15px;
    border-radius: 8px;
    color: #8d6e63;
    font-size: 0.95rem;
    display: inline-block;
    max-width: 100%;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
}

/* Assessment Drag & Drop */
.assessment-container {
    width: 100%;
    max-width: 600px;
}

.draggable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.draggable-item {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}

.draggable-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.draggable-item.selected {
    border: 2px solid var(--primary-color);
    background-color: #e3f2fd;
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
    z-index: 10;
}

.draggable-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
    background: #f0f7ff;
}

.draggable-item .step-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.draggable-item .step-text {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.draggable-item .drag-handle {
    color: #ccc;
    cursor: grab;
    padding: 0 10px;
}

/* Results & Feedback */
.score-display {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 20px 0;
}

.feedback-list {
    width: 100%;
    max-width: 700px;
    text-align: left;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.feedback-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 5px solid transparent;
}

.feedback-item.correct {
    background-color: #e6fffa;
    border-left-color: var(--success-color);
    color: #0d5f53;
}

.feedback-item.incorrect {
    background-color: #fff5f5;
    border-left-color: var(--accent-color);
    color: #9b2c2c;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.feedback-correction {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-top: 5px;
}

.feedback-rationale {
    display: block;
    margin-top: 4px;
    color: #555;
    font-style: italic;
}

.error-prevention-msg {
    color: var(--accent-color);
    background: #fff5f5;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 600;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 86, 179, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0); }
}

/* Responsive */
@media (max-width: 600px) {
    .content-card {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .step-visual {
        font-size: 4rem;
    }
    
    .navigation-controls {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
    }
}
