/*
 * workflow_indicator.css
 * LumiScan 바코드 스캔 워크플로우 진행 상태 인디케이터 스타일
 */

/* 워크플로우 컨테이너 */
.workflow-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 32px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 600px;
    max-width: 90vw;
    z-index: 9999;
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 헤더 */
.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.workflow-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* 타이머 */
.workflow-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f3f4f6;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.workflow-timer.warning {
    background: #fef3c7;
    color: #92400e;
    animation: pulse-warning 2s infinite;
}

.workflow-timer.danger {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

.timer-icon {
    font-size: 22px;
}

/* 진행 단계 컨테이너 */
.workflow-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    position: relative;
    padding: 0 20px;
}

/* 진행 단계 아이템 */
.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

/* 단계 아이콘 */
.step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 대기 상태 */
.step-icon.pending {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #9ca3af;
}

/* 진행중 상태 */
.step-icon.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2),
                0 0 0 8px rgba(251, 191, 36, 0.1);
    animation: rotate-pulse 2s ease-in-out infinite;
}

@keyframes rotate-pulse {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-5deg) scale(1.05);
    }
    75% {
        transform: rotate(5deg) scale(1.05);
    }
}

/* 완료 상태 */
.step-icon.completed {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    animation: success-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-bounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 오류 상태 */
.step-icon.error {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    animation: error-shake 0.5s ease;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* 체크마크 애니메이션 */
.step-icon.completed::after {
    content: '✓';
    position: absolute;
    font-size: 40px;
    animation: draw-check 0.5s ease-out 0.1s both;
}

@keyframes draw-check {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 단계 라벨 */
.step-label {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    min-width: 100px;
    transition: all 0.3s ease;
}

.step-label.active {
    color: #f59e0b;
    font-size: 18px;
}

.step-label.completed {
    color: #10b981;
}

.step-label.error {
    color: #ef4444;
}

.step-status {
    margin-top: 4px;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

.step-status.active {
    color: #d97706;
}

.step-status.completed {
    color: #059669;
}

.step-status.error {
    color: #dc2626;
}

/* 연결선 */
.workflow-connector {
    position: absolute;
    top: 40px;
    height: 4px;
    background: #e5e7eb;
    z-index: 1;
    transition: all 0.5s ease;
    border-radius: 2px;
}

.workflow-connector.completed {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.workflow-connector.active {
    background: linear-gradient(90deg, #10b981 0%, #fbbf24 50%, #e5e7eb 100%);
    animation: progress-flow 2s linear infinite;
}

@keyframes progress-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* 메시지 */
.workflow-message {
    text-align: center;
    padding: 20px 24px;
    background: #f9fafb;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    color: #374151;
}

.workflow-message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.workflow-message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
    animation: shake-message 0.5s ease;
}

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

.workflow-message.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 2px solid #f59e0b;
}

.workflow-message.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* 진행률 바 */
.workflow-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 24px 0 16px;
    overflow: hidden;
}

.workflow-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .workflow-container {
        min-width: 90vw;
        padding: 24px;
    }

    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .step-label {
        font-size: 14px;
        min-width: 80px;
    }

    .workflow-header h3 {
        font-size: 20px;
    }

    .workflow-timer {
        font-size: 16px;
    }
}

/* 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
    .step-icon {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }

    .step-label {
        font-size: 18px;
    }

    .workflow-message {
        font-size: 19px;
        padding: 24px 28px;
    }
}

/* 다크모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    .workflow-container {
        background: #1f2937;
        color: #f9fafb;
    }

    .workflow-header h3 {
        color: #f9fafb;
    }

    .workflow-timer {
        background: #374151;
        color: #f9fafb;
    }

    .workflow-message {
        background: #374151;
        color: #f9fafb;
    }

    .step-label {
        color: #d1d5db;
    }
}
