/* Tutorial Modal System - 전체 화면 하이라이트 튜토리얼 */

/* 전체 화면 반투명 검정 오버레이 */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tutorial-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* 하이라이트된 요소 스타일 */
.tutorial-highlight {
    position: relative;
    z-index: 9999 !important;
    border-radius: 12px;
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.8),
        0 0 0 8px rgba(0, 122, 255, 0.6),
        0 0 30px rgba(0, 122, 255, 0.4),
        0 0 60px rgba(0, 122, 255, 0.2) !important;
    animation: tutorialPulse 2s infinite;
    background: rgba(255, 255, 255, 0.95) !important;
}

@keyframes tutorialPulse {
    0% { 
        box-shadow: 
            0 0 0 4px rgba(255, 255, 255, 0.8),
            0 0 0 8px rgba(0, 122, 255, 0.6),
            0 0 30px rgba(0, 122, 255, 0.4),
            0 0 60px rgba(0, 122, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 0 0 4px rgba(255, 255, 255, 1),
            0 0 0 8px rgba(0, 122, 255, 0.8),
            0 0 40px rgba(0, 122, 255, 0.6),
            0 0 80px rgba(0, 122, 255, 0.3);
    }
    100% { 
        box-shadow: 
            0 0 0 4px rgba(255, 255, 255, 0.8),
            0 0 0 8px rgba(0, 122, 255, 0.6),
            0 0 30px rgba(0, 122, 255, 0.4),
            0 0 60px rgba(0, 122, 255, 0.2);
    }
}

/* 큰 툴팁 박스 */
.tutorial-tooltip {
    position: fixed;
    z-index: 10000;
    background: white;
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 360px;
    min-width: 320px;
    width: auto;
    height: auto;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
}

.tutorial-tooltip.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

/* 툴팁 내용 */
.tutorial-tooltip-content {
    padding: 0;
    color: #333;
}

.tutorial-tooltip-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.tutorial-tooltip-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-tooltip-title {
    flex: 1;
}

.tutorial-tooltip-title h3 {
    font-size: 19px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

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

.tutorial-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    background: #1428A0;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.tutorial-step-counter {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
}

.tutorial-tooltip-body {
    padding: 0 20px 16px;
}

.tutorial-tooltip-body p {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.8);
    margin: 0;
}

.tutorial-tooltip-footer {
    padding: 16px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 환영 화면 */
.tutorial-welcome {
    text-align: center;
    padding: 16px 20px 24px 20px;
    max-width: none;
    margin: 0 auto;
}

.tutorial-welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.tutorial-welcome h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 0 0 16px 0;
}

.tutorial-welcome p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.tutorial-welcome-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

/* 완료 화면 */
.tutorial-completion {
    text-align: center;
    padding: 40px 32px;
}

.tutorial-completion-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.tutorial-completion h2 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
}

.tutorial-completion p {
    font-size: 18px;
    color: rgba(0, 0, 0, 0.7);
    margin: 0 0 32px 0;
    line-height: 1.5;
}

/* 일주일 동안 숨기기 체크박스 */
#tutorial-hide-week {
    width: 16px;
    height: 16px;
    accent-color: #1428A0;
    cursor: pointer;
}

#tutorial-hide-week + span {
    user-select: none;
}

/* 일주일 숨기기 건너뛰기 버튼 */
#skipWithCheckbox {
    background: #1428A0 !important;
    color: white !important;
    border: 2px solid #1428A0 !important;
    transition: all 0.3s ease;
    animation: fadeInScale 0.3s ease;
    margin: 0 auto;
    display: block;
}

#skipWithCheckbox:hover {
    background: #1B3BB8 !important;
    border-color: #1B3BB8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 40, 160, 0.3);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 건너뛰기 버튼 */
.tutorial-skip-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.tutorial-skip-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 버튼 스타일 */
.tutorial-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    backdrop-filter: blur(10px);
}

.tutorial-btn.primary {
    background: #1428A0;
    color: white;
    box-shadow: 0 4px 15px rgba(20, 40, 160, 0.3);
}

.tutorial-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 40, 160, 0.4);
}

.tutorial-btn.primary.large {
    padding: 16px 32px;
    font-size: 18px;
    min-width: 200px;
}

.tutorial-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 90vw;
        min-width: 320px;
        width: auto;
        height: auto;
        max-height: none;
        overflow: visible;
        margin: 0 auto;
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .tutorial-tooltip-header {
        padding: 20px 20px 16px;
        gap: 12px;
    }
    
    .tutorial-tooltip-icon {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    
    .tutorial-tooltip-title h3 {
        font-size: 20px;
        margin: 0 0 10px 0;
    }
    
    .tutorial-tooltip-body {
        padding: 0 20px 16px;
    }
    
    .tutorial-tooltip-body p {
        font-size: 15px;
        line-height: 1.5;
    }
    
    .tutorial-tooltip-footer {
        padding: 16px 20px 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .tutorial-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .tutorial-welcome {
        padding: 16px 20px;
    }
    
    .tutorial-welcome h2 {
        font-size: 24px;
    }
    
    .tutorial-welcome p {
        font-size: 16px;
    }
    
    .tutorial-welcome-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .tutorial-completion {
        padding: 32px 24px;
    }
    
    .tutorial-completion h2 {
        font-size: 24px;
    }
    
    .tutorial-completion p {
        font-size: 16px;
    }
    
    .tutorial-skip-btn {
        top: 20px;
        right: 20px;
        padding: 8px 12px;
        font-size: 12px;
        z-index: 10002;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .tutorial-skip-btn:hover {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* 접근성 */
.tutorial-btn:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* 애니메이션 */
@keyframes tutorialSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-tooltip-content {
    animation: tutorialSlideUp 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* 화살표 포인터 (툴팁이 요소를 가리키는 효과) */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    z-index: -1;
}

/* 위쪽에 위치할 때 아래쪽 화살표 */
.tutorial-tooltip[data-position="top"]::before {
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: rgba(20, 20, 20, 0.95);
}

/* 아래쪽에 위치할 때 위쪽 화살표 */
.tutorial-tooltip[data-position="bottom"]::before {
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(20, 20, 20, 0.95);
}

/* 왼쪽에 위치할 때 오른쪽 화살표 */
.tutorial-tooltip[data-position="left"]::before {
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: rgba(20, 20, 20, 0.95);
}

/* 오른쪽에 위치할 때 왼쪽 화살표 */
.tutorial-tooltip[data-position="right"]::before {
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: rgba(20, 20, 20, 0.95);
}