/* Дополнительные космические эффекты для нижнего меню */

/* Мерцающие звёзды для основного фона - используем другой селектор */
main .twinkling-stars {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 15% 25%, #fff, transparent),
        radial-gradient(1px 1px at 85% 35%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 45% 65%, #fff, transparent),
        radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 25% 85%, #fff, transparent),
        radial-gradient(1px 1px at 65% 45%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 35% 5%, #fff, transparent),
        radial-gradient(1px 1px at 95% 75%, rgba(255,255,255,0.7), transparent);
    background-size: 
        400px 400px, 
        300px 300px, 
        500px 500px, 
        250px 250px,
        450px 450px,
        350px 350px,
        600px 600px,
        280px 280px;
    animation: sparkle 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

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

/* Контейнер для динамических метеоров */
.shooting-stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Стили для динамических метеоров */
.shooting-star {
    position: absolute;
    pointer-events: none;
}

.shooting-star-tail {
    position: absolute;
    top: 0;
    left: 50%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.6), rgba(255,255,255,0.9), transparent);
    transform: translateX(-100%);
    transform-origin: right center;
}

/* Вариации метеоров для разнообразия */
.shooting-star.bright {
    box-shadow: 0 0 8px #fff, 0 0 16px #fff, 0 0 24px rgba(135, 206, 250, 0.8) !important;
}

.shooting-star.bright .shooting-star-tail {
    width: 80px !important;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.6), rgba(255,255,255,0.9), rgba(135, 206, 250, 0.8), transparent) !important;
}

.shooting-star.small {
    width: 1px !important;
    height: 1px !important;
    box-shadow: 0 0 4px #fff, 0 0 8px #fff !important;
}

.shooting-star.small .shooting-star-tail {
    width: 40px !important;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.4), rgba(255,255,255,0.7), transparent) !important;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .shooting-star-tail {
        width: 40px !important;
    }
    
    .shooting-star.bright .shooting-star-tail {
        width: 60px !important;
    }
    
    .shooting-star.small .shooting-star-tail {
        width: 30px !important;
    }
}

/* Отключение анимаций при настройке "уменьшить движение" */
@media (prefers-reduced-motion: reduce) {
    .shooting-stars-container {
        display: none;
    }
}

/* Космический фон для всего footer */
footer {
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(153, 51, 204, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(102, 51, 153, 0.4) 0%, transparent 30%);
    animation: cosmicRotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes cosmicRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Улучшенные эффекты для нижней навигации */
.bottom-navbar {
    position: relative;
    z-index: 2;
    border: 1px solid rgba(153, 51, 204, 0.3);
}

.bottom-navbar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(153, 51, 204, 0.8) 25%, 
        rgba(255, 107, 107, 0.8) 50%, 
        rgba(153, 51, 204, 0.8) 75%, 
        transparent 100%);
    animation: cosmicGlow 3s ease-in-out infinite alternate;
}

@keyframes cosmicGlow {
    0% { opacity: 0.5; transform: scaleX(0.8); }
    100% { opacity: 1; transform: scaleX(1); }
}

/* Космические эффекты для активных элементов */
.bottom-navbar-item.active::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff 0%, rgba(153, 51, 204, 0.8) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(153, 51, 204, 0.8),
        0 0 20px rgba(153, 51, 204, 0.6),
        0 0 30px rgba(153, 51, 204, 0.4);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateX(-50%) scale(1.3);
        opacity: 0.7;
    }
}

/* Галактический эффект для заголовков модального окна */
.modal-title {
    background: linear-gradient(45deg, #fff, #9933cc, #ff6b6b, #fff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: galaxyText 4s ease-in-out infinite;
}

@keyframes galaxyText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Межзвездная пыль для модального окна */
.modal-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 60% 40%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 80% 90%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 95% 10%, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px, 220px 220px;
    background-position: 0 0, 50px 100px, 120px 30px, 200px 150px, 300px 50px;
    animation: starField 15s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes starField {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-50px); }
}

/* Космические частицы для hover эффектов */
.menu-item:hover::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: cosmicExplosion 0.6s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes cosmicExplosion {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        width: 100px;
        height: 100px;
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Орбитальное движение для иконок */
.bottom-navbar-item .image {
    position: relative;
}

.bottom-navbar-item.active .image::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid rgba(153, 51, 204, 0.5);
    border-radius: 50%;
    animation: orbit 3s linear infinite;
}

@keyframes orbit {
    0% { transform: rotate(0deg); border-color: rgba(153, 51, 204, 0.5); }
    25% { border-color: rgba(255, 107, 107, 0.5); }
    50% { border-color: rgba(102, 51, 153, 0.5); }
    75% { border-color: rgba(255, 107, 107, 0.5); }
    100% { transform: rotate(360deg); border-color: rgba(153, 51, 204, 0.5); }
}

/* Квантовые эффекты для кнопки закрытия */
.close {
    position: relative;
    overflow: hidden;
}

.close::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.close:hover::before {
    left: 100%;
}

/* Голографический эффект для разделителей */
.menu-section-title::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(153, 51, 204, 0.8), transparent);
    animation: hologramLine 2s ease-in-out infinite;
}

@keyframes hologramLine {
    0%, 100% { width: 30px; opacity: 0.5; }
    50% { width: 70px; opacity: 1; }
}

/* Многомерные тени для элементов меню */
.menu-item {
    position: relative;
}

.menu-item::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: inherit;
    border-radius: inherit;
    filter: blur(4px);
    opacity: 0.3;
    z-index: -1;
    transition: all 0.3s ease;
}

.menu-item:hover::before {
    filter: blur(8px);
    opacity: 0.6;
    transform: scale(1.05);
}