/* Современный вейп-спиннер: облака пара */
.vape-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 30, 36, 0.95), rgba(0, 15, 20, 0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Защита от залипания: автоматическое скрытие через 10 секунд */
    animation: autoHide 10s linear forwards;
}

.vape-spinner-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.vape-spinner-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 300px;
    height: 300px;
}

/* Центральная кнопка вейпа */
.vape-button {
    position: relative;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #00ff88, #22d3aa, #1db584);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 
        0 0 30px rgba(34, 211, 170, 0.8),
        0 0 60px rgba(34, 211, 170, 0.4),
        0 0 90px rgba(0, 255, 136, 0.2),
        inset 0 3px 6px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    animation: vapePulse 1.8s ease-in-out infinite;
}

.vape-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent);
    border-radius: 50%;
    animation: innerGlow 1.8s ease-in-out infinite;
}

/* Облака пара */
.vape-clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cloud {
    position: absolute;
    border-radius: 50px;
    opacity: 0;
    filter: blur(1px);
    animation: cloudFloat 4s ease-in-out infinite;
}

.cloud:nth-child(1) {
    width: 85px;
    height: 42px;
    background: linear-gradient(45deg, rgba(225, 247, 251, 0.7), rgba(199, 242, 248, 0.85));
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
    animation-duration: 3.5s;
    box-shadow: 0 0 15px rgba(225, 247, 251, 0.3);
}

.cloud:nth-child(2) {
    width: 105px;
    height: 52px;
    background: linear-gradient(135deg, rgba(245, 252, 253, 0.6), rgba(225, 247, 251, 0.8));
    bottom: 50%;
    left: 30%;
    animation-delay: 0.8s;
    animation-duration: 4s;
    box-shadow: 0 0 12px rgba(245, 252, 253, 0.25);
}

.cloud:nth-child(3) {
    width: 95px;
    height: 47px;
    background: linear-gradient(225deg, rgba(199, 242, 248, 0.65), rgba(175, 235, 245, 0.75));
    bottom: 45%;
    right: 25%;
    animation-delay: 1.6s;
    animation-duration: 4.2s;
    box-shadow: 0 0 10px rgba(199, 242, 248, 0.2);
}

.cloud:nth-child(4) {
    width: 75px;
    height: 37px;
    background: linear-gradient(315deg, rgba(225, 247, 251, 0.5), rgba(245, 252, 253, 0.7));
    bottom: 60%;
    left: 60%;
    animation-delay: 2.4s;
    animation-duration: 3.8s;
    box-shadow: 0 0 8px rgba(225, 247, 251, 0.15);
}

.cloud:nth-child(5) {
    width: 115px;
    height: 57px;
    background: linear-gradient(45deg, rgba(175, 235, 245, 0.45), rgba(225, 247, 251, 0.65));
    bottom: 65%;
    left: 20%;
    animation-delay: 3.2s;
    animation-duration: 4.5s;
    box-shadow: 0 0 18px rgba(175, 235, 245, 0.2);
}

/* Частицы пара */
.vapor-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.9), rgba(225, 247, 251, 0.6), transparent);
    border-radius: 50%;
    opacity: 0;
    animation: particleRise 3s linear infinite;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.particle:nth-child(1) { left: 43%; animation-delay: 0s; animation-duration: 2.8s; }
.particle:nth-child(2) { left: 50%; animation-delay: 0.4s; animation-duration: 3.2s; }
.particle:nth-child(3) { left: 57%; animation-delay: 0.8s; animation-duration: 2.9s; }
.particle:nth-child(4) { left: 46%; animation-delay: 1.2s; animation-duration: 3.1s; }
.particle:nth-child(5) { left: 54%; animation-delay: 1.6s; animation-duration: 2.7s; }
.particle:nth-child(6) { left: 49%; animation-delay: 2.0s; animation-duration: 3.3s; }

/* Текст */
.vape-spinner-text {
    color: #e1f7fb;
    font-size: 16px;
    font-weight: 600;
    margin-top: 60px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    animation: textGlow 3s ease-in-out infinite;
    letter-spacing: 0.5px;
}

/* Анимации */
@keyframes vapePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 30px rgba(34, 211, 170, 0.8),
            0 0 60px rgba(34, 211, 170, 0.4),
            0 0 90px rgba(0, 255, 136, 0.2);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 
            0 0 45px rgba(34, 211, 170, 1),
            0 0 90px rgba(34, 211, 170, 0.7),
            0 0 120px rgba(0, 255, 136, 0.4);
    }
}

@keyframes innerGlow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4);
    }
}

@keyframes cloudFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(-30px) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateY(-120px) scale(1.4);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(2);
    }
}

@keyframes particleRise {
    0% {
        opacity: 0;
        bottom: 42%;
        transform: translateX(0) scale(0.3) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translateX(5px) scale(1) rotate(45deg);
    }
    30% {
        transform: translateX(-8px) scale(1.1) rotate(90deg);
    }
    60% {
        opacity: 0.8;
        transform: translateX(25px) scale(0.9) rotate(180deg);
    }
    85% {
        opacity: 0.4;
        transform: translateX(-15px) scale(0.6) rotate(270deg);
    }
    100% {
        opacity: 0;
        bottom: 88%;
        transform: translateX(35px) scale(0.1) rotate(360deg);
    }
}

@keyframes textGlow {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.7),
            0 0 20px rgba(34, 211, 170, 0.3);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .vape-spinner-container {
        width: 250px;
        height: 250px;
    }
    
    .vape-button {
        width: 16px;
        height: 16px;
    }
    
    .cloud {
        transform: scale(0.8);
    }
    
    .vape-spinner-text {
        font-size: 14px;
        margin-top: 50px;
    }
}

@media (max-width: 480px) {
    .vape-spinner-container {
        width: 200px;
        height: 200px;
    }
    
    .cloud {
        transform: scale(0.6);
    }
}

/* Высокопроизводительная анимация */
@media (prefers-reduced-motion: no-preference) {
    .cloud, .particle, .vape-button {
        will-change: transform, opacity;
    }
}

/* Для браузеров без поддержки backdrop-filter */
@supports not (backdrop-filter: blur(12px)) {
    .vape-spinner-overlay {
        background: rgba(0, 20, 24, 0.98);
    }
}

/* Защита от залипания спинера */
@keyframes autoHide {
    0%, 95% {
        /* Ничего не делаем первые 9.5 секунд */
    }
    100% {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
} 