/* Навигационная панель - основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

nav > div {
    width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

/* Логотип */
nav a[href="https://ts.dapi3da.ru/"] {
    display: flex;
    align-items: center;
}

nav a[href="https://ts.dapi3da.ru/"] img {
    height: 40px;
    width: auto;
    display: block;
}

/* Контейнер навигационных ссылок */
nav > div > div {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Базовые стили для всех ссылок навигации */
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
    will-change: transform;
}

/* Стили для SVG иконок */
.nav-link svg {
    width: 20px;
    height: 20px;
}

.nav-link svg polygon,
.nav-link svg path,
.nav-link svg g {
    fill: #4a5568;
    transition: fill 0.2s ease;
}

/* Hover эффект */
.nav-link:hover {
    background: #f5f5f5 !important;
}

.nav-link:hover svg polygon,
.nav-link:hover svg path,
.nav-link:hover svg g {
    fill: #4a5568;
}

/* Активный пункт меню */
.nav-link.active {
    background: #f0f0f0;
    color: #2c3e50 !important;
    font-weight: 600;
}

.nav-link.active svg polygon,
.nav-link.active svg path,
.nav-link.active svg g {
    fill: #2c3e50;
}

/* Стили для кнопки Подписка с эффектом пыльцы */
.subscription-link {
    position: relative;
    overflow: visible;
}

/* Плавное золотое подчеркивание */
.subscription-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #FFE55C 20%, 
        #FFD700 50%, 
        #FFE55C 80%, 
        transparent 100%);
    border-radius: 2px;
    opacity: 0.7;
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

/* Эффект пульсации для подчеркивания */
@keyframes glowPulse {
    0% {
        opacity: 0.4;
        width: 60%;
        filter: blur(0px);
    }
    25% {
        opacity: 0.8;
        width: 75%;
        filter: blur(0.5px);
    }
    50% {
        opacity: 0.9;
        width: 70%;
        filter: blur(0px);
    }
    75% {
        opacity: 0.7;
        width: 65%;
        filter: blur(0.3px);
    }
    100% {
        opacity: 0.4;
        width: 60%;
        filter: blur(0px);
    }
}

/* Частицы пыльцы - уменьшенный размер */
.pollen-dot {
    position: absolute;
    width: 2.5px;
    height: 2.5px;
    background: radial-gradient(circle, #FFE55C, #FFA500, #FFD700);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    filter: blur(0.8px);
    box-shadow: 0 0 3px #FFD700;
    will-change: transform, opacity;
    transition: none;
}

/* Индивидуальное позиционирование и анимация каждой частицы */
.pollen-1 {
    top: -5px;
    left: 10%;
    animation: pollenFloat1 8s ease-in-out infinite;
    animation-play-state: running;
}

.pollen-2 {
    bottom: -5px;
    right: 15%;
    animation: pollenFloat2 9s ease-in-out infinite;
    animation-delay: 1s;
    animation-play-state: running;
}

.pollen-3 {
    top: 20%;
    left: -8px;
    animation: pollenFloat3 10s ease-in-out infinite;
    animation-delay: 2s;
    animation-play-state: running;
}

.pollen-4 {
    top: 60%;
    right: -8px;
    animation: pollenFloat4 8.5s ease-in-out infinite;
    animation-delay: 3s;
    animation-play-state: running;
}

.pollen-5 {
    top: -8px;
    right: 20%;
    animation: pollenFloat5 9.5s ease-in-out infinite;
    animation-delay: 0.5s;
    animation-play-state: running;
}

.pollen-6 {
    bottom: 20%;
    left: -5px;
    animation: pollenFloat6 8s ease-in-out infinite;
    animation-delay: 2.5s;
    animation-play-state: running;
}

/* При наведении анимация продолжается без сброса */
.subscription-link:hover .pollen-dot {
    animation-play-state: running !important;
    filter: blur(1px);
    box-shadow: 0 0 5px #FFD700;
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

/* Подчеркивание при наведении */
.subscription-link:hover::after {
    animation: glowPulse 4s ease-in-out infinite; /* Та же анимация, без изменений */
    height: 2px; /* Без изменения высоты */
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* Медленные, плавные анимации для каждой частицы (оставляем как есть) */
@keyframes pollenFloat1 {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
    15% {
        transform: translate(15px, -10px) scale(1);
        opacity: 0.6;
    }
    30% {
        transform: translate(25px, -5px) scale(0.8);
        opacity: 0.4;
    }
    45% {
        transform: translate(35px, 5px) scale(1.2);
        opacity: 0.7;
    }
    60% {
        transform: translate(25px, 15px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translate(15px, 10px) scale(1.1);
        opacity: 0.6;
    }
    90% {
        transform: translate(5px, 5px) scale(0.7);
        opacity: 0.3;
    }
    100% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
}

@keyframes pollenFloat2 {
    0% {
        transform: translate(0, 0) scale(0.6);
        opacity: 0;
    }
    20% {
        transform: translate(-10px, -8px) scale(1.2);
        opacity: 0.7;
    }
    40% {
        transform: translate(-22px, -3px) scale(0.9);
        opacity: 0.5;
    }
    60% {
        transform: translate(-30px, 8px) scale(1.1);
        opacity: 0.8;
    }
    80% {
        transform: translate(-18px, 12px) scale(0.8);
        opacity: 0.4;
    }
    100% {
        transform: translate(0, 0) scale(0.6);
        opacity: 0;
    }
}

@keyframes pollenFloat3 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.7);
        opacity: 0;
    }
    25% {
        transform: translate(15px, -12px) rotate(45deg) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(28px, -5px) rotate(90deg) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translate(18px, 8px) rotate(135deg) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translate(0, 0) rotate(180deg) scale(0.7);
        opacity: 0;
    }
}

@keyframes pollenFloat4 {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
    15% {
        transform: translate(-12px, -6px) scale(1);
        opacity: 0.5;
    }
    30% {
        transform: translate(-20px, 2px) scale(1.3);
        opacity: 0.8;
    }
    45% {
        transform: translate(-25px, 12px) scale(0.9);
        opacity: 0.6;
    }
    60% {
        transform: translate(-18px, 18px) scale(1.1);
        opacity: 0.7;
    }
    75% {
        transform: translate(-8px, 12px) scale(0.8);
        opacity: 0.4;
    }
    90% {
        transform: translate(-3px, 5px) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
}

@keyframes pollenFloat5 {
    0% {
        transform: translate(0, 0) scale(0.6);
        opacity: 0;
    }
    18% {
        transform: translate(-8px, -15px) scale(1.2);
        opacity: 0.6;
    }
    36% {
        transform: translate(5px, -22px) scale(0.9);
        opacity: 0.4;
    }
    54% {
        transform: translate(15px, -12px) scale(1.3);
        opacity: 0.7;
    }
    72% {
        transform: translate(10px, -5px) scale(1);
        opacity: 0.5;
    }
    90% {
        transform: translate(3px, -2px) scale(0.7);
        opacity: 0.3;
    }
    100% {
        transform: translate(0, 0) scale(0.6);
        opacity: 0;
    }
}

@keyframes pollenFloat6 {
    0% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0;
    }
    20% {
        transform: translate(20px, 5px) scale(1.1);
        opacity: 0.5;
    }
    40% {
        transform: translate(35px, 12px) scale(0.7);
        opacity: 0.3;
    }
    60% {
        transform: translate(28px, 22px) scale(1.2);
        opacity: 0.6;
    }
    80% {
        transform: translate(12px, 15px) scale(0.9);
        opacity: 0.4;
    }
    100% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0;
    }
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    nav > div > div {
        gap: 5px;
    }
    
    .nav-link {
        padding: 8px !important;
    }
    
    .nav-link span:not(.pollen-dot) {
        display: none; /* Скрываем текст на мобильных, оставляем только иконки */
    }
    
    /* Корректировка позиции частиц на мобильных */
    .pollen-1 {
        left: 5%;
    }
    
    .pollen-2 {
        right: 10%;
    }
    
    .pollen-3 {
        left: -5px;
    }
    
    .pollen-4 {
        right: -5px;
    }
    
    .pollen-dot {
        width: 2px;
        height: 2px;
    }
}

@media (max-width: 480px) {
    nav > div {
        padding: 0 10px !important;
    }
    
    .pollen-dot {
        width: 1.8px;
        height: 1.8px;
        filter: blur(0.7px);
    }
}


/* Дополнительный стиль для логотипа */
nav a[href="https://ts.dapi3da.ru/"] img {
    transition: transform 0.3s ease;
}

nav a[href="https://ts.dapi3da.ru/"] img:hover {
    transform: scale(1.05);
}