/* ========== АНИМАЦИИ И ЭФФЕКТЫ ========== */

/* Плавное появление элементов при загрузке */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Применение анимаций к элементам */
.topbar {
    animation: fadeInUp 0.6s ease-out;
}

.hero-info-card {
    animation: slideInLeft 0.8s ease-out;
    animation-fill-mode: both;
}

.hero-info-card:nth-child(1) {
    animation-delay: 0.1s;
}

.hero-info-card:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-info-card:nth-child(3) {
    animation-delay: 0.3s;
}

.hero-portrait {
    animation: slideInRight 0.8s ease-out 0.2s;
    animation-fill-mode: both;
}

.pricing-card {
    animation: scaleIn 0.6s ease-out 0.4s;
    animation-fill-mode: both;
}

.program-row {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.program-row:nth-child(1) { animation-delay: 0.1s; }
.program-row:nth-child(2) { animation-delay: 0.2s; }
.program-row:nth-child(3) { animation-delay: 0.3s; }
.program-row:nth-child(4) { animation-delay: 0.4s; }
.program-row:nth-child(5) { animation-delay: 0.5s; }
.program-row:nth-child(6) { animation-delay: 0.6s; }
.program-row:nth-child(7) { animation-delay: 0.7s; }

.result-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }

/* Анимация при скролле */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Плавный скролл */
html {
    scroll-behavior: smooth;
}

/* Hover эффекты */
.btn-register {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-register:hover::before {
    width: 300px;
    height: 300px;
}

/* Пульсация для важных кнопок */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

.btn-action {
    animation: pulse 2s infinite;
}

/* Параллакс эффект для hero секции */
.hero {
    position: relative;
    overflow: hidden;
}

/* Плавное появление модального окна */
dialog[open] {
    animation: fadeIn 0.3s ease-out;
}

dialog[open] .modal-content {
    animation: scaleIn 0.3s ease-out;
}

/* Анимация для кнопки "Наверх" */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top.visible {
    animation: slideInFromBottom 0.3s ease-out;
}

/* Skeleton loading для изображений */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Transition для всех интерактивных элементов */
a, button, input, textarea {
    transition: all 0.3s ease;
}

/* Плавное изменение цвета при hover */
.footer-links a:hover,
.footer-legal-link:hover {
    color: var(--grass-green);
    transform: translateX(5px);
}

.social-link {
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    color: var(--grass-green);
}

/* Анимация для warning strip */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.warning-strip {
    animation: slideDown 0.5s ease-out 0.3s;
    animation-fill-mode: both;
}

/* Эффект ripple для кнопок */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Плавное появление footer */
.footer {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

/* Reduce motion для пользователей с настройками доступности */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
