/* ========================================
   PROJECTFADE - TUTORIAL MODAL
   Адаптировано под единую дизайн-систему
   ======================================== */

/* Tutorial Modal Styles */
.tutorial-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto; /* ← Скролл если не влезает */
}

.tutorial-modal {
    /* СТИЛЬ КАК У КАРТОЧЕК ТУРНИРОВ */
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.5), rgba(30, 30, 47, 0.5)) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 15px !important;
    max-width: 900px;
    width: 100%;
    max-height: 90vh; /* ← Максимум 90% высоты экрана */
    box-shadow: 0 1px 20px 0px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.tutorial-header {
    flex-shrink: 0; /* ← Не сжимается */
    padding: 30px 40px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background-color: transparent !important;
}

.tutorial-logo {
    font-family: 'Inter', sans-serif !important;
    font-size: 28px;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    /* ← ИСПРАВЛЕНО: Белый цвет вместо градиента */
    color: #fff !important;
    margin-bottom: 8px;
}

.tutorial-tagline {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* Content - SCROLLABLE */
.tutorial-content {
    flex: 1;
    overflow-y: auto; /* ← Скролл внутри контента */
    padding: 40px;
    display: flex;
    gap: 40px;
    align-items: center;
}

/* Custom scrollbar */
.tutorial-content::-webkit-scrollbar {
    width: 6px;
}

.tutorial-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.tutorial-content::-webkit-scrollbar-thumb {
    background: rgba(233, 30, 99, 0.5);
    border-radius: 3px;
}

.tutorial-content::-webkit-scrollbar-thumb:hover {
    background: rgba(233, 30, 99, 0.7);
}

.tutorial-text {
    flex: 1;
    min-width: 0;
}

.tutorial-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 24px;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.8) !important;
}

.tutorial-description {
    font-family: 'Inter', sans-serif !important;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Image container with FIXED size (prevents jumping) */
.tutorial-image-container {
    flex: 1;
    position: relative;
    border-radius: 15px !important;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(30, 30, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    
    /* УВЕЛИЧЕНО - больше места для скриншотов */
    height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Картинка полностью влезает без обрезки */
    display: block;
}

/* Gradient overlays (ваш стиль) */
.tutorial-image-container::before,
.tutorial-image-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 1;
}

.tutorial-image-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(30, 30, 46, 0.8) 0%, transparent 100%);
}

.tutorial-image-container::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(30, 30, 46, 0.8) 0%, transparent 100%);
}

/* Footer */
.tutorial-footer {
    flex-shrink: 0; /* ← Не сжимается */
    padding: 25px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    background-color: transparent !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Progress dots */
.tutorial-progress {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease !important;
}

.progress-dot.active {
    /* Ваш розово-фиолетовый градиент */
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.9), rgba(156, 39, 176, 0.9)) !important;
    width: 24px;
    border-radius: 4px;
}

/* Buttons - используем вашу систему */
.tutorial-buttons {
    display: flex;
    gap: 12px;
}

.tutorial-modal .btn {
    font-family: 'Inter', sans-serif !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    border: none;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.3s ease !important;
}

.tutorial-modal .btn:focus,
.tutorial-modal .btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Skip button - серый (ваш .btn-secondary стиль) */
.tutorial-modal .btn-skip {
    background: rgba(136, 152, 170, 0.15) !important;
    border: 1px solid rgba(136, 152, 170, 0.3) !important;
    color: #8898aa !important;
}

.tutorial-modal .btn-skip:hover {
    background: rgba(136, 152, 170, 0.25) !important;
    border-color: rgba(136, 152, 170, 0.5) !important;
    color: #8898aa !important;
    transform: translateY(-2px) !important;
}

/* Prev button - серый outline */
.tutorial-modal .btn-prev {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.tutorial-modal .btn-prev:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
}

/* Next button - розово-фиолетовый градиент (ваш .btn-primary) */
.tutorial-modal .btn-next {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.9), rgba(156, 39, 176, 0.9)) !important;
    border: 1px solid rgba(233, 30, 99, 0.4) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4) !important;
}

.tutorial-modal .btn-next:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 1), rgba(156, 39, 176, 1)) !important;
    border-color: rgba(233, 30, 99, 0.6) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.5) !important;
}

/* ===== ПЕРВЫЙ ЭКРАН - ЛОГОТИП БЕЗ КОНТЕЙНЕРА ===== */
.tutorial-image-container.welcome-logo {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
}

.tutorial-image-container.welcome-logo::before,
.tutorial-image-container.welcome-logo::after {
    display: none !important; /* Убираем градиенты */
}

.tutorial-image-container.welcome-logo img {
    max-width: 300px;
    max-height: 300px;
    filter: drop-shadow(0 10px 30px rgba(233, 30, 99, 0.3));
}

/* ===== АНИМАЦИИ ===== */

/* Плавное появление контента при переключении слайдов */
.tutorial-content {
    transition: opacity 0.2s ease; /* ← Быстрее, без transform */
}

/* Анимация progress dots */
.progress-dot {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Анимация появления модалки */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Пульсация активной точки */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(233, 30, 99, 0);
    }
}

.progress-dot.active {
    animation: pulse 2s ease-in-out infinite;
}

/* Hover эффект на картинку */
.tutorial-image-container:not(.welcome-logo) {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-image-container:not(.welcome-logo):hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Плавное появление логотипа на первом экране */
.tutorial-image-container.welcome-logo img {
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Градиенты плавно появляются */
.tutorial-image-container::before,
.tutorial-image-container::after {
    transition: opacity 0.3s ease;
}

/* Кнопки - дополнительная анимация */
.tutorial-modal .btn {
    position: relative;
    overflow: hidden;
}

.tutorial-modal .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tutorial-modal .btn:active::before {
    width: 300px;
    height: 300px;
}

/* Плавное появление текста */
.tutorial-title {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.tutorial-description {
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Backdrop fade-in */
.tutorial-backdrop {
    animation: backdropFadeIn 0.3s ease-out;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tutorial-backdrop {
        padding: 10px;
    }

    .tutorial-modal {
        max-height: 95vh; /* ← На мобилке 95% экрана */
    }

    .tutorial-content {
        flex-direction: column;
        padding: 30px 20px;
        gap: 24px;
    }
    
    .tutorial-header {
        padding: 24px 20px 16px;
    }
    
    .tutorial-logo {
        font-size: 24px;
    }
    
    .tutorial-title {
        font-size: 20px;
    }
    
    .tutorial-description {
        font-size: 14px;
    }
    
    /* Smaller fixed height on mobile - ПРЕДОТВРАЩАЕТ ПРЫЖКИ */
    .tutorial-image-container {
    height: 400px; /* ← УВЕЛИЧЕНО */
    width: 100%;
}

.tutorial-image-container.welcome-logo {
    height: auto !important;
}

.tutorial-image-container.welcome-logo img {
    max-width: 200px;
    max-height: 200px;
}
    
    .tutorial-footer {
        padding: 20px;
        flex-direction: column-reverse;
        gap: 16px;
    }
    
    .tutorial-buttons {
        width: 100%;
    }
    
    .tutorial-modal .btn {
        flex: 1;
        font-size: 0.875rem !important;
        padding: 8px 16px !important;
    }
    
    .tutorial-progress {
        justify-content: center;
    }
}