/* ============================================================================
   ОПТИМИЗИРОВАННЫЕ CSS АНИМАЦИИ для сайта Олеси Звягин
.animated {
    opacity: 0;
    animation-duration: 1s;
    animation-fill-mode: both;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

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

.animated.fadeIn {
    animation-name: fadeIn;
    opacity: 1;
}

/* FADE IN UP */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInUp {
    animation-name: fadeInUp;
    opacity: 1;
}

/* FADE IN DOWN */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInDown {
    animation-name: fadeInDown;
    opacity: 1;
}

/* FADE IN LEFT */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-50px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInLeft {
    animation-name: fadeInLeft;
    opacity: 1;
}

/* FADE IN RIGHT */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(50px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInRight {
    animation-name: fadeInRight;
    opacity: 1;
}

/* ============================================================================
   БОЛЬШИЕ АНИМАЦИИ (упрощенные версии)
============================================================================ */

/* FADE IN UP BIG */
@keyframes fadeInUpBig {
    from {
        opacity: 0;
        transform: translate3d(0, 100px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInUpBig {
    animation-name: fadeInUpBig;
    opacity: 1;
}

/* FADE IN DOWN BIG */
@keyframes fadeInDownBig {
    from {
        opacity: 0;
        transform: translate3d(0, -100px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInDownBig {
    animation-name: fadeInDownBig;
    opacity: 1;
}

/* FADE IN LEFT BIG */
@keyframes fadeInLeftBig {
    from {
        opacity: 0;
        transform: translate3d(-100px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInLeftBig {
    animation-name: fadeInLeftBig;
    opacity: 1;
}

/* FADE IN RIGHT BIG */
@keyframes fadeInRightBig {
    from {
        opacity: 0;
        transform: translate3d(100px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated.fadeInRightBig {
    animation-name: fadeInRightBig;
    opacity: 1;
}

/* ============================================================================
   СПЕЦИАЛЬНЫЕ АНИМАЦИИ ДЛЯ САЙТА
============================================================================ */

/* Анимация для заголовков модулей (белый текст на бирюзовом) */
@keyframes moduleTitleAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        text-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

.title-animated {
    animation: moduleTitleAppear 0.7s ease-out 0.2s both;
    color: #ffffff !important;
}

/* Анимация логотипа (бирюзовый) */
@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        color: rgba(38, 142, 145, 0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        color: #268e91;
    }
}

.logo-animated {
    animation: logoEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Пульсация для CTA элементов */
@keyframes ctaPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(38, 142, 145, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(38, 142, 145, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(38, 142, 145, 0);
    }
}

.cta-pulse {
    animation: ctaPulse 2s infinite;
}

/* Анимация для кнопок сайта */
@keyframes buttonGlow {
    0%, 100% {
        background-color: #268e91;
        transform: translateY(0);
    }
    50% {
        background-color: #4fb3b6;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(38, 142, 145, 0.4);
    }
}

.button-animated:hover {
    animation: buttonGlow 0.6s ease;
}

/* ============================================================================
   УТИЛИТАРНЫЕ КЛАССЫ
============================================================================ */

/* Задержки */
.delay-1 { animation-delay: 0.1s !important; }
.delay-2 { animation-delay: 0.2s !important; }
.delay-3 { animation-delay: 0.3s !important; }
.delay-4 { animation-delay: 0.4s !important; }
.delay-5 { animation-delay: 0.5s !important; }
.delay-6 { animation-delay: 0.6s !important; }
.delay-7 { animation-delay: 0.7s !important; }
.delay-8 { animation-delay: 0.8s !important; }
.delay-9 { animation-delay: 0.9s !important; }
.delay-10 { animation-delay: 1s !important; }

/* Скорость */
.fast { animation-duration: 0.5s !important; }
.faster { animation-duration: 0.3s !important; }
.slow { animation-duration: 1.5s !important; }
.slower { animation-duration: 2s !important; }

/* Повторения */
.once { animation-iteration-count: 1 !important; }
.twice { animation-iteration-count: 2 !important; }
.infinite { animation-iteration-count: infinite !important; }

/* Управление */
.animation-paused { animation-play-state: paused !important; }
.animation-running { animation-play-state: running !important; }

/* ============================================================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
============================================================================ */

@media only screen and (max-width: 1024px) {
    .op0 {
        opacity: 1;
    }
    
    .animated {
        animation-duration: 0.8s !important;
    }
    
    .animated.fadeInUp,
    .animated.fadeInDown {
        animation-duration: 0.6s !important;
    }
}

@media only screen and (max-width: 768px) {
    .animated {
        animation-duration: 0.6s !important;
    }
    
    /* Упрощенные анимации для мобильных */
    @keyframes fadeInUpMobile {
        from {
            opacity: 0;
            transform: translate3d(0, 20px, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }
    
    .animated.fadeInUp,
    .animated.fadeInUpBig {
        animation-name: fadeInUpMobile;
    }
    
    /* Отключаем сложные анимации */
    .cta-pulse,
    .infinite {
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================================
   ДОСТУПНОСТЬ
============================================================================ */

/* Уважаем настройки пользователя */
@media (prefers-reduced-motion: reduce) {
    .animated,
    .title-animated,
    .logo-animated,
    .cta-pulse {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .op0 {
        opacity: 1 !important;
    }
}

/* Fallback для старых браузеров */
.no-js .animated,
.old-browser .animated {
    opacity: 1 !important;
    animation: none !important;
}

/* ============================================================================
   СОВМЕСТИМОСТЬ С СУЩЕСТВУЮЩИМ КОДОМ
============================================================================ */

/* Совместимость с data-атрибутами */
[data-animated="fadeIn"] {
    opacity: 0;
}

[data-animated="fadeIn"].animated {
    opacity: 1;
}

/* Существующий класс op0 */
.op0 {
    opacity: 0.01;
    pointer-events: none;
}

/* Плавные переходы для существующих элементов */
.fade-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
============================================================================ */

/* Pulse эффект */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Zoom in */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.9, 0.9, 0.9);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.zoomIn {
    animation-name: zoomIn;
}

/* Bounce in */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.bounceIn {
    animation-name: bounceIn;
    animation-duration: 0.75s;
}

/* ============================================================================
   ПОСЛЕДОВАТЕЛЬНОЕ ПОЯВЛЕНИЕ ЭЛЕМЕНТОВ
============================================================================ */

.staggered > *:nth-child(1) { animation-delay: 0.1s; }
.staggered > *:nth-child(2) { animation-delay: 0.2s; }
.staggered > *:nth-child(3) { animation-delay: 0.3s; }
.staggered > *:nth-child(4) { animation-delay: 0.4s; }
.staggered > *:nth-child(5) { animation-delay: 0.5s; }
.staggered > *:nth-child(6) { animation-delay: 0.6s; }
.staggered > *:nth-child(7) { animation-delay: 0.7s; }
.staggered > *:nth-child(8) { animation-delay: 0.8s; }
.staggered > *:nth-child(9) { animation-delay: 0.9s; }
.staggered > *:nth-child(10) { animation-delay: 1s; }

/* ============================================================================
   АНИМАЦИИ ДЛЯ ФОРМ
============================================================================ */

/* Появление формы */
@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-animated {
    animation: formSlideIn 0.6s ease-out;
}

/* Анимация фокуса для инпутов */
@keyframes inputFocus {
    from {
        box-shadow: 0 0 0 0 rgba(38, 142, 145, 0);
        border-color: #268e91;
    }
    to {
        box-shadow: 0 0 0 3px rgba(38, 142, 145, 0.2);
        border-color: #4fb3b6;
    }
}

.input-animated:focus {
    animation: inputFocus 0.3s ease-out forwards;
}

/* ============================================================================
   ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ
============================================================================ */

/* Отключаем анимации при скролле для старых устройств */
@media (max-width: 768px) and (max-height: 667px) {
    .reduce-animations .animated:not(.important-animation) {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* Оптимизация для печати */
@media print {
    .animated,
    .title-animated,
    .logo-animated,
    .cta-pulse,
    .pulse {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .op0 {
        opacity: 1 !important;
    }
}

/* ============================================================================
   ИНТЕГРАЦИЯ С ЦВЕТОВОЙ СХЕМОЙ САЙТА
============================================================================ */

/* Бирюзовые акценты в анимациях */
.turquoise-highlight {
    position: relative;
    overflow: hidden;
}

.turquoise-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(38, 142, 145, 0.1),
        transparent
    );
    animation: slideShine 3s infinite;
}

@keyframes slideShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Анимация для ссылок в меню */
@keyframes linkUnderline {
    from {
        transform: scaleX(0);
        background-color: rgba(38, 142, 145, 0);
    }
    to {
        transform: scaleX(1);
        background-color: #268e91;
    }
}

.menu-link-animated:hover::after {
    animation: linkUnderline 0.3s ease-out forwards;
}

/* ============================================================================
   ФИНАЛЬНЫЕ СТИЛИ И ОЧИСТКА
============================================================================ */

/* Сброс анимаций после выполнения */
.animation-complete {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Убеждаемся, что анимации не ломают верстку */
.animated {
    min-height: 1px; /* предотвращает схлопывание */
}

/* Для элементов с абсолютным позиционированием */
.animated.absolute-fix {
    transform: translate3d(0, 0, 0); /* фикс для Safari */
}

/* ============================================================================
   КОНЕЦ ФАЙЛА АНИМАЦИЙ
   Этот код полностью заменяет старый файл animate.css
   Сохраняет обратную совместимость с вашим сайтом
============================================================================ */