/* Мощная анимация пульсации */
@keyframes pulseScale {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0.2), 0 0 0 30px rgba(99, 102, 241, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Яркое переливание градиента */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
        background-image: linear-gradient(135deg, #3b82f6, #4f46e5, #3b82f6);
        filter: brightness(1);
    }
    50% {
        background-position: 100% 50%;
        background-image: linear-gradient(135deg, #60a5fa, #818cf8, #60a5fa);
        filter: brightness(1.2);
        text-shadow: 0 0 5px rgba(255,255,255,0.5);
    }
    100% {
        background-position: 0% 50%;
        background-image: linear-gradient(135deg, #3b82f6, #4f46e5, #3b82f6);
        filter: brightness(1);
    }
}

/* Анимация свечения */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5), 0 0 10px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 40px rgba(99, 102, 241, 0.5), 0 0 60px rgba(139, 92, 246, 0.3);
    }
    100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5), 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

/* Применение анимаций к кнопке */
.animate-pulse-scale {
    animation: pulseScale 1s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 2s ease infinite;
}

.animate-glow {
    animation: glow 1.5s ease-in-out infinite;
}

/* ========== СКРЫТИЕ КНОПОК ПРИ ЗАГРУЗКЕ ========== */
#back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Кнопка вверх остается скрытой до прокрутки */
body.loaded #back-to-top {
    opacity: 0;
    visibility: hidden;
}

/* Показываем кнопку вверх при прокрутке */
body.loaded #back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Дополнительные анимации для загрузки */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 2s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

/* Paragraph spacing */
.prose p + p {
    margin-top: 1rem;
}

/* Hero section text spacing */
.hero-text p {
    margin-bottom: 1.5rem;
}

.hero-text p:last-child {
    margin-bottom: 0;
}

/* Content section text spacing */
.content-section p {
    margin-bottom: 1.25rem;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* List styling */
.content-section ul li {
    margin-bottom: 0.5rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.mobile-menu.open {
    max-height: 300px;
    opacity: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-in forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

/* Cookie кнопки активное состояние */
#cookieAccept.active,
#cookieReject.active {
    transform: scale(0.95);
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    #cookieConsent .text-sm {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    #cookieAccept,
    #cookieReject {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Утилиты */
@media (min-width: 768px) {
    .md\:animate-none {
        animation: none !important;
    }
}

@media (max-width: 480px) {
    #cookieConsent .xs\:flex-row {
        flex-direction: row;
    }
    
    #cookieConsent .xs\:flex-none {
        flex: none;
    }
}