/* 🎓 INTERAKTÍV TUTORIAL RENDSZER */

/* Tutorial Overlay - Világos háttér a jobb kontraszthoz */
#tutorialOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.75); /* ✅ Világos overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999; /* ✅ ALACSONY - header (1000) alatt */
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* ✅ Ne takarja el a kiemelt elemet */
}

#tutorialOverlay.active {
    display: block;
    opacity: 1;
}

/* Fókuszált elem kiemelése - ERŐS KONTRASZT */
.tutorial-spotlight {
    position: relative !important; /* ✅ Pozíció kényszerítése */
    z-index: 1000001 !important; /* ✅ Header (1000) felett */
    box-shadow: 
        0 0 0 5px #ff8a00,                    /* Narancs border */
        0 0 0 10px rgba(0, 0, 0, 0.3),        /* Fekete outer border */
        0 0 60px 20px rgba(255, 138, 0, 0.9), /* Narancs glow */
        inset 0 0 30px rgba(255, 255, 255, 0.3) !important; /* Belső világítás */
    border-radius: 12px !important;
    animation: tutorialPulse 2s ease-in-out infinite;
    outline: none !important;
    background-color: rgba(255, 255, 255, 0.95) !important; /* Világos háttér */
    pointer-events: auto !important; /* ✅ Kiemelt elem kattintható */
}

/* Kiemelt gomb a headerben - még magasabbra */
.header .tutorial-spotlight,
.header-actions .tutorial-spotlight {
    z-index: 1000002 !important; /* ✅ Header gyerekként is látható */
}

/* ✅ Kosár gomb (#exportButton) - NE LEGYEN FEHÉR HÁTTÉR */
#exportButton.tutorial-spotlight,
button#exportButton.tutorial-spotlight,
.mobile-action-bar #exportButton.tutorial-spotlight {
    background-color: #1515156e !important; /* ✅ Átlátszó - megtartja saját színét */
    z-index: 1000003 !important; /* ✅ Legmagasabb */
    /* ✅ Box-shadow felülírása - NEM használja a pulzáló animációt */
    box-shadow: 
        0 0 0 5px #ff8a00,                    /* Narancs border */
        0 0 0 10px rgba(0, 0, 0, 0.3),        /* Fekete outer border */
        0 0 60px 20px rgba(255, 138, 0, 0.9) !important; /* Narancs glow - NINCS inset */
    animation: tutorialPulseButton 2s ease-in-out infinite !important; /* Külön animáció */
}

/* ✅ Mobile action bar is emelni kell */
.mobile-action-bar.tutorial-spotlight,
.mobile-action-bar:has(.tutorial-spotlight) {
    z-index: 1000003 !important;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 5px #ff8a00,
            0 0 0 10px rgba(0, 0, 0, 0.3),
            0 0 60px 20px rgba(255, 138, 0, 0.9),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 0 7px #ff8a00,
            0 0 0 12px rgba(0, 0, 0, 0.4),
            0 0 80px 30px rgba(255, 138, 0, 1),
            inset 0 0 40px rgba(255, 255, 255, 0.5);
    }
}

/* ✅ Külön animáció exportButton-nek - NINCS inset shadow */
@keyframes tutorialPulseButton {
    0%, 100% {
        box-shadow: 
            0 0 0 5px #ff8a00,
            0 0 0 10px rgba(0, 0, 0, 0.3),
            0 0 60px 20px rgba(255, 138, 0, 0.9);
    }
    50% {
        box-shadow: 
            0 0 0 7px #ff8a00,
            0 0 0 12px rgba(0, 0, 0, 0.4),
            0 0 80px 30px rgba(255, 138, 0, 1);
    }
}

/* Tutorial kártya - KÖZÉPEN */
#tutorialCard {
    position: fixed;
    top: 50%; /* ✅ Középen vertikálisan */
    left: 50%;
    transform: translate(-50%, -50%); /* ✅ Mindkét irányban középre */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: auto; /* ✅ Modal kattintható */
}

#tutorialCard.active {
    opacity: 1;
}

/* Tutorial Header */
.tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tutorial-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff8a00 0%, #ff6600 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.3);
}

.tutorial-badge svg {
    width: 20px;
    height: 20px;
}

.tutorial-close {
    background: #f8f9fa;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 20px;
    color: #6c757d;
}

.tutorial-close:hover {
    background: #ff4444;
    color: white;
    transform: scale(1.1);
}

/* Tutorial tartalom */
.tutorial-content {
    margin-bottom: 30px;
}

.tutorial-step-counter {
    display: inline-block;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.tutorial-title {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.tutorial-description {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Tutorial gombok */
.tutorial-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tutorial-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tutorial-btn-primary {
    background: linear-gradient(135deg, #ff8a00 0%, #ff6600 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.3);
}

.tutorial-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 138, 0, 0.4);
}

.tutorial-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.tutorial-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress bar */
.tutorial-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e9ecef;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
}

.tutorial-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff8a00 0%, #ff6600 100%);
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(255, 138, 0, 0.5);
}

/* Skip tutorial link */
.tutorial-skip {
    text-align: center;
    margin-top: 15px;
}

.tutorial-skip a {
    color: #6c757d;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.tutorial-skip a:hover {
    color: #ff8a00;
    text-decoration: underline;
}

/* Mobilra optimalizálás */
@media (max-width: 768px) {
    #tutorialCard {
        padding: 25px 20px;
        max-width: 95%;
        top: 20px; /* ✅ Felül fix pozíció mobilon */
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
    }
    
    .tutorial-title {
        font-size: 18px;
    }
    
    .tutorial-description {
        font-size: 13px;
    }
    
    .tutorial-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .tutorial-header {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    
    .tutorial-content {
        margin-bottom: 20px;
    }
}

/* Arrow pointer */
.tutorial-arrow {
    position: fixed;
    width: 0;
    height: 0;
    z-index: 999999;
    animation: tutorialArrowBounce 1.5s ease-in-out infinite;
    pointer-events: none; /* ✅ Nyíl ne takarja el az elemeket */
}

.tutorial-arrow-down {
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #ff8a00;
    filter: drop-shadow(0 4px 8px rgba(255, 138, 0, 0.4));
}

.tutorial-arrow-up {
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 30px solid #ff8a00;
    filter: drop-shadow(0 -4px 8px rgba(255, 138, 0, 0.4));
}

.tutorial-arrow-left {
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-right: 30px solid #ff8a00;
    filter: drop-shadow(-4px 0 8px rgba(255, 138, 0, 0.4));
}

.tutorial-arrow-right {
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid #ff8a00;
    filter: drop-shadow(4px 0 8px rgba(255, 138, 0, 0.4));
}

@keyframes tutorialArrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
