/**
 * Стили интерактивной обучалки
 */

/* Spotlight - создаёт затемнение вокруг элемента */
.tutorial-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: 8px;
    pointer-events: none;
    transition: all 0.3s ease;
    /* Прозрачный центр, тёмное всё вокруг */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                0 0 15px 5px rgba(0, 79, 158, 0.8);
    animation: spotlight-pulse 1.5s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                    0 0 10px 3px rgba(0, 79, 158, 0.6);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                    0 0 20px 8px rgba(0, 79, 158, 1);
    }
}

/* Overlay для шагов без элемента */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Welcome Modal */
.tutorial-modal {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s ease;
}

.tutorial-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.tutorial-welcome {
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.tutorial-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.tutorial-close:hover {
    background: #e0e0e0;
    color: #333;
}

.tutorial-welcome-image {
    width: 100%;
    height: 200px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tutorial-welcome-image img {
    max-width: 80%;
    max-height: 180px;
    object-fit: contain;
}

.tutorial-welcome h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 24px 24px 16px;
    text-align: center;
}

.tutorial-welcome-text {
    padding: 0 24px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
}

.tutorial-welcome-text ul {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.tutorial-welcome-text li {
    padding: 8px 0 8px 28px;
    position: relative;
}

.tutorial-welcome-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #004f9e;
    font-weight: bold;
}

/* Кнопки */
.tutorial-buttons {
    display: flex;
    gap: 12px;
    padding: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.tutorial-btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 140px;
}

.tutorial-btn-primary {
    background: linear-gradient(135deg, #004f9e 0%, #003366 100%);
    color: white;
}

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

.tutorial-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.tutorial-btn-secondary:hover {
    background: #e0e0e0;
}

.tutorial-btn-text {
    background: transparent;
    color: #888;
    min-width: auto;
    padding: 8px 16px;
}

.tutorial-btn-text:hover {
    color: #333;
}

/* Tooltip */
.tutorial-tooltip {
    position: fixed;
    z-index: 10001;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 420px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tutorial-tooltip.active {
    opacity: 1;
    visibility: visible;
}

.tutorial-tooltip-image {
    width: 100%;
    height: 120px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tutorial-tooltip-image img {
    max-width: 90%;
    max-height: 100px;
    object-fit: contain;
}

.tutorial-tooltip h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 16px 20px 10px;
}

.tutorial-tooltip p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
    margin: 0 20px 18px;
}

.tutorial-tooltip-progress {
    text-align: center;
    padding: 0 20px;
    margin-bottom: 12px;
}

.tutorial-tooltip-progress span {
    font-size: 0.8rem;
    color: #999;
}

.tutorial-tooltip-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 20px;
    border-top: 1px solid #f0f0f0;
}

.tutorial-tooltip-nav {
    display: flex;
    gap: 8px;
}

.tutorial-tooltip .tutorial-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    min-width: auto;
}

/* Мобильные стили */
@media (max-width: 600px) {
    .tutorial-welcome {
        width: 95%;
        max-height: 85vh;
    }

    .tutorial-welcome-image {
        height: 150px;
    }

    .tutorial-welcome h2 {
        font-size: 1.25rem;
        margin: 20px 16px 12px;
    }

    .tutorial-welcome-text {
        padding: 0 16px;
        font-size: 0.9rem;
    }

    .tutorial-buttons {
        padding: 20px 16px;
        flex-direction: column;
    }

    .tutorial-btn {
        width: 100%;
        padding: 16px;
    }

    .tutorial-tooltip {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
    }

    .tutorial-tooltip-image {
        height: 80px;
    }

    .tutorial-tooltip h3 {
        font-size: 1.05rem;
        margin: 12px 16px 8px;
    }

    .tutorial-tooltip p {
        font-size: 0.9rem;
        margin: 0 16px 14px;
        line-height: 1.6;
    }

    .tutorial-tooltip-buttons {
        padding: 10px 16px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .tutorial-tooltip-nav {
        width: 100%;
        justify-content: space-between;
    }

    .tutorial-tooltip .tutorial-btn-text {
        order: -1;
    }
}
