/* ========================================
   Case Replay 모드 스타일
   교육용 케이스 복기 + What if 의사결정 분기
   ======================================== */

/* 재생 컨트롤 바 */
.replay-control-bar {
    position: sticky;
    top: 64px; /* 글로벌 헤더 아래 */
    left: 0;
    right: 0;
    z-index: 500;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid #ffc107;
}

.replay-controls-left,
.replay-controls-center,
.replay-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 모드 배지 */
.replay-mode-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* 진행 상태 */
.replay-progress-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* 재생 버튼 */
.replay-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.replay-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

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

.replay-play {
    padding: 10px 20px;
    background: #ffc107;
    color: #000000;
    border-color: #ffc107;
}

.replay-play:hover {
    background: #ffb300;
    border-color: #ffb300;
}

/* 재생 옵션 */
.replay-options {
    display: flex;
    gap: 16px;
}

.replay-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

.replay-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.replay-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
}

.replay-speed select {
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

/* ========================================
   재생 중 기록 카드 상태
   ======================================== */

/* 과거 기록 (이전 단계) */
.replay-past {
    opacity: 0.4;
    pointer-events: none;
}

/* 현재 기록 (재생 중) */
.replay-current {
    border-left-width: 5px !important;
    border-left-color: #ffc107 !important;
    background: linear-gradient(to right, #fff8e1 0%, #ffffff 5%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3) !important;
    animation: replayPulse 2s ease-in-out infinite;
}

@keyframes replayPulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
    }
}

/* 미래 기록 (숨김) */
.replay-future {
    display: none !important;
}

/* ========================================
   What if 모달 스타일
   ======================================== */

.whatif-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whatif-modal.show {
    opacity: 1;
}

.whatif-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.whatif-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.whatif-modal.show .whatif-modal-content {
    transform: scale(1);
}

/* What if 헤더 */
.whatif-header {
    background: linear-gradient(135deg, #ff6f00 0%, #ff5722 100%);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

.whatif-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.whatif-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatif-icon i {
    font-size: 28px;
    color: #ffffff;
}

.whatif-header-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.whatif-header-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.xabcde-badge {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 임상 상황 */
.whatif-context {
    padding: 24px;
    background: #f5f5f5;
    border-left: 4px solid #ff9800;
}

.context-label,
.question-label,
.feedback-label {
    font-size: 13px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-label i,
.question-label i,
.feedback-label i {
    color: #ff9800;
}

.context-content {
    font-size: 14px;
    line-height: 1.8;
    color: #212529;
}

/* 질문 */
.whatif-question {
    padding: 24px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    padding: 16px;
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
}

/* 선택지 */
.whatif-options {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatif-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.whatif-option:hover {
    background: #e9ecef;
    border-color: #0066cc;
}

.whatif-option.selected {
    background: #e3f2fd;
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.option-radio {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
}

.option-radio input[type="radio"] {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.option-content {
    flex-grow: 1;
}

.option-text {
    font-size: 15px;
    line-height: 1.6;
    color: #212529;
}

/* 근거 입력 */
.whatif-reasoning {
    padding: 0 24px 24px 24px;
}

.whatif-reasoning label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.whatif-reasoning textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.whatif-reasoning textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* 버튼 영역 */
.whatif-actions {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.whatif-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatif-btn-skip {
    background: #6c757d;
    color: #ffffff;
}

.whatif-btn-skip:hover {
    background: #5a6268;
}

.whatif-btn-submit {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #ffffff;
}

.whatif-btn-submit:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.whatif-btn-continue {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #ffffff;
}

.whatif-btn-continue:hover {
    background: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);
}

/* ========================================
   피드백 스타일
   ======================================== */

.whatif-feedback-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.whatif-feedback-header.correct {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #ffffff;
}

.whatif-feedback-header.incorrect {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: #ffffff;
}

.feedback-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-icon i {
    font-size: 32px;
    color: #ffffff;
}

.feedback-title h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.feedback-title p {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
}

/* 피드백 섹션 */
.feedback-section {
    padding: 20px 24px;
    border-bottom: 1px solid #dee2e6;
}

.feedback-content {
    padding: 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.7;
}

.feedback-content.user-choice {
    background: #e3f2fd;
    border-left: 4px solid #0066cc;
}

.feedback-content.actual-choice {
    background: #f3e5f5;
    border-left: 4px solid #7b1fa2;
}

.feedback-content.clinical-rationale {
    background: #f5f5f5;
    border-left: 4px solid #ff9800;
}

.choice-text {
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.choice-reasoning {
    font-size: 13px;
    color: #495057;
    margin-top: 8px;
}

/* 학습 포인트 */
.feedback-learning-points {
    padding: 20px 24px;
    background: #fff8e1;
    display: flex;
    gap: 16px;
}

.learning-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #ffc107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.learning-icon i {
    font-size: 24px;
    color: #ffffff;
}

.learning-text {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.7;
    color: #212529;
}

/* 반응형 */
@media (max-width: 1200px) {
    .replay-control-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .replay-controls-left,
    .replay-controls-center,
    .replay-controls-right {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .whatif-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .whatif-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .whatif-options {
        gap: 8px;
    }
    
    .whatif-option {
        padding: 12px;
    }
}
