/**
 * Astro Loader - Horoscope Generation Preloader
 * Стильный прелоадер с астрологической тематикой
 */

/* Основной overlay */
.astro-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 26, 0.98) 0%, rgba(25, 15, 45, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.astro-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Контейнер контента */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

/* Основная орбита */
.loader-orbit-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 40px;
}

/* Внешнее кольцо */
.loader-orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top: 2px solid #8b5cf6;
    border-right: 2px solid #a78bfa;
    border-radius: 50%;
    animation: spin 3s linear infinite;
}

/* Внутреннее кольцо */
.loader-orbit-inner {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-bottom: 2px solid #fbbf24;
    border-left: 2px solid #f59e0b;
    border-radius: 50%;
    animation: spin-reverse 2.5s linear infinite;
}

/* Центральная звезда/солнце */
.loader-sun {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-radius: 50%;
    box-shadow:
        0 0 20px rgba(251, 191, 36, 0.6),
        0 0 40px rgba(251, 191, 36, 0.4),
        0 0 60px rgba(251, 191, 36, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Планета на орбите */
.loader-planet {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

/* Звёзды вокруг */
.loader-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.loader-stars span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 1.5s ease-in-out infinite;
}

.loader-stars span:nth-child(1) { top: -20px; left: 30%; animation-delay: 0s; }
.loader-stars span:nth-child(2) { top: 10%; right: -15px; animation-delay: 0.3s; }
.loader-stars span:nth-child(3) { bottom: -20px; left: 60%; animation-delay: 0.6s; }
.loader-stars span:nth-child(4) { top: 40%; left: -20px; animation-delay: 0.9s; }
.loader-stars span:nth-child(5) { top: 20%; right: -25px; animation-delay: 1.2s; }
.loader-stars span:nth-child(6) { bottom: 10%; left: -15px; animation-delay: 0.4s; }
.loader-stars span:nth-child(7) { top: -15px; right: 20%; animation-delay: 0.7s; }
.loader-stars span:nth-child(8) { bottom: -25px; right: 30%; animation-delay: 1s; }

/* Текст загрузки */
.loader-text {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Подтекст */
.loader-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* Анимированные точки */
.loader-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dots span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) { animation-delay: 0s; }
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Прогресс-бар (опционально) */
.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 50%, #8b5cf6 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progress-shimmer 2s linear infinite;
    width: 0%;
    transition: width 0.3s ease;
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 20px rgba(251, 191, 36, 0.6),
            0 0 40px rgba(251, 191, 36, 0.4),
            0 0 60px rgba(251, 191, 36, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow:
            0 0 30px rgba(251, 191, 36, 0.8),
            0 0 60px rgba(251, 191, 36, 0.5),
            0 0 90px rgba(251, 191, 36, 0.3);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Адаптивность */
@media (max-width: 480px) {
    .loader-orbit-container {
        width: 120px;
        height: 120px;
    }

    .loader-orbit {
        width: 120px;
        height: 120px;
    }

    .loader-orbit-inner {
        top: 15px;
        left: 15px;
        width: 90px;
        height: 90px;
    }

    .loader-sun {
        width: 36px;
        height: 36px;
    }

    .loader-planet {
        width: 12px;
        height: 12px;
        top: -6px;
    }

    .loader-text {
        font-size: 1.1rem;
    }

    .loader-subtext {
        font-size: 0.85rem;
    }
}
