/* ==========================================================================
   SECOURSIM - EXERCISE MODE CSS (RCR + Naloxone Practical Exercise - LIGHT MODE)
   ========================================================================== */

.exercise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #f8fafc;
    color: #0f172a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.exercise-overlay.hidden {
    display: none !important;
}

/* Header & Timeline Bar */
.exercise-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.exercise-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exercise-mode-badge {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Timeline Horizontal Scrollable */
.exercise-timeline-wrapper {
    background: #f1f5f9;
    padding: 14px 10px;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
}

.exercise-timeline-container {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 0 10px;
}

.timeline-phase-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.45;
    transition: all 0.3s ease;
}

.timeline-phase-node.active {
    opacity: 1;
    transform: scale(1.08);
}

.timeline-phase-node.completed {
    opacity: 0.85;
}

.phase-node-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-phase-node.active .phase-node-icon {
    border-color: #0284c7;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
    background: #e0f2fe;
}

.timeline-phase-node.completed .phase-node-icon {
    border-color: #059669;
    background: #d1fae5;
}

.phase-node-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
}

/* Main Content Area */
.exercise-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
    gap: 20px;
}

/* Active Step Card */
.exercise-step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-phase-badge {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-critical-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
}

.step-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.step-description {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.6;
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

/* Timer & Metronome Panel */
.exercise-timer-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chrono-display {
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 2.4rem;
    font-weight: 900;
    color: #047857;
    letter-spacing: 2px;
}

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

.heart-pulse {
    font-size: 2rem;
    transition: transform 0.1s ease;
}

.heart-pulse.pulsing {
    transform: scale(1.35);
}

.bpm-live-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0284c7;
}

/* Action Controls */
.exercise-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-exercise-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-exercise-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-exercise-primary:disabled {
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-exercise-secondary {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-exercise-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Notice Mode Examen */
.exam-notice-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    text-align: center;
    font-weight: 700;
}

/* Modal Rapport Final */
.exercise-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.exercise-report-modal.hidden {
    display: none !important;
}

.report-content-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    color: #0f172a;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.report-metric-box {
    background: #f8fafc;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.report-metric-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #0284c7;
}

.report-metric-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.report-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.report-log-item {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.report-log-item.completed { border: 1px solid #a7f3d0; background: #f0fdf4; color: #065f46; font-weight: 600; }
.report-log-item.skipped { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; font-weight: 600; }
.report-log-item.rejected_by_instructor { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; font-weight: 600; }

/* ==========================================================================
   MOBILE & TOUCH ADAPTATIONS (SECOURSIM PRACTICAL EXERCISE)
   ========================================================================== */
@media (max-width: 768px) {
    .exercise-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .exercise-title {
        font-size: 1.05rem;
    }

    .exercise-mode-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .exercise-body {
        padding: 16px 12px;
        gap: 14px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .exercise-step-card {
        padding: 18px 14px;
        border-radius: 16px;
        gap: 12px;
    }

    .step-title {
        font-size: 1.15rem;
    }

    .step-description {
        padding: 12px 14px;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .exercise-timer-panel {
        padding: 12px 16px;
        border-radius: 14px;
    }

    .chrono-display {
        font-size: 1.85rem;
        letter-spacing: 1px;
    }

    .heart-pulse {
        font-size: 1.6rem;
    }

    .bpm-live-text {
        font-size: 0.85rem;
    }

    .btn-exercise-primary {
        padding: 14px;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-exercise-secondary {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .report-content-card {
        padding: 20px 16px;
        border-radius: 18px;
        max-height: 90vh;
        gap: 16px;
    }

    .report-metric-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 420px) {
    .exercise-timer-panel {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        text-align: center;
    }

    .chrono-display {
        font-size: 1.7rem;
    }

    .report-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .exercise-timeline-wrapper {
        padding: 10px 6px;
    }

    .timeline-phase-node {
        gap: 4px;
    }

    .phase-node-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .phase-node-label {
        font-size: 0.7rem;
    }
}
