/* === ANIMATIONS.CSS - ЕДИНЫЙ ИСТОЧНИК ВСЕХ АНИМАЦИЙ СИСТЕМЫ === */
/* ✅ МОДУЛЬНЫЙ ФАЙЛ: ВСЕ @keyframes + ВСЕ анимационные классы */
/* ✅ ОПТИМИЗИРОВАННЫЕ анимации для производительности */
/* ✅ ЦЕНТРАЛИЗОВАННОЕ управление всеми эффектами */

/* === БАЗОВЫЕ АНИМАЦИИ ПОЯВЛЕНИЯ === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* === АНИМАЦИИ СЧЕТЧИКОВ === */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: var(--color-orange);
    }
}

/* === АНИМАЦИИ ЗАГРУЗКИ === */
@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* ✅ ОПТИМИЗИРОВАННАЯ пульсация (легкая) */
@keyframes gentlePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

/* === АНИМАЦИИ КНОПОК === */
@keyframes buttonPress {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(2px);
    }
    100% {
        transform: translateY(0);
    }
}

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

/* === АНИМАЦИИ КАРТОЧЕК === */
@keyframes cardHover {
    0% {
        transform: translateY(0);
        box-shadow: var(--shadow-md);
    }
    100% {
        transform: translateY(-8px);
        box-shadow: var(--shadow-2xl);
    }
}

@keyframes shake {
    0%, 100% { 
        transform: translateX(0); 
    }
    25% { 
        transform: translateX(-5px); 
    }
    75% { 
        transform: translateX(5px); 
    }
}

/* === ✅ ОПТИМИЗИРОВАННЫЕ АНИМАЦИИ ДЛЯ OFFERS === */

/* Каскадное появление карточек offers (легкое) */
@keyframes offerCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px); /* Уменьшено с 40px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✅ УПРОЩЕННАЯ анимация для featured карточки */
@keyframes featuredGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(247, 147, 22, 0.2);
    }
    50% {
        box-shadow: 0 12px 35px rgba(247, 147, 22, 0.3);
    }
}

/* ✅ ПРОСТАЯ анимация для значков */
@keyframes badgeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* ✅ ОПТИМИЗИРОВАННАЯ анимация цен (без gradient) */
@keyframes priceHighlight {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02); /* Уменьшено с 1.05 */
        filter: brightness(1.1); /* Уменьшено с 1.2 */
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* ✅ ПРОСТАЯ анимация для иконок offers */
@keyframes offerIconHover {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05); /* Упрощено - убран rotate */
    }
}

/* ✅ ЛЕГКАЯ анимация для кнопок offers */
@keyframes offerButtonGlow {
    0%, 100% {
        transform: translateY(0);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-1px);
        filter: brightness(1.1);
    }
}

/* === ✅ АНИМАЦИИ ДЛЯ CHAT-DEMO === */

/* Анимация появления блока chat-demo */
@keyframes chatDemoSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация сообщений чата */
@keyframes chatMessageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация быстрых ответов */
@keyframes chatQuickReplyShow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация появления статистики */
@keyframes chatStatsShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ✅ ОПТИМИЗИРОВАННАЯ пульсация статуса */
@keyframes statusDotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Ripple эффект для кнопок чата */
@keyframes chatRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Анимация печатания в чате */
@keyframes chatTyping {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* === АНИМАЦИИ МОДАЛЬНЫХ ОКОН === */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* === АНИМАЦИИ ФОРМ === */
@keyframes inputFocus {
    0% {
        border-color: var(--border-primary);
        box-shadow: none;
    }
    100% {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    }
}

@keyframes inputError {
    0%, 100% {
        transform: translateX(0);
        border-color: var(--system-error-500);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* === АНИМАЦИИ СОЦИАЛЬНЫХ СЕТЕЙ === */
@keyframes socialPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* === АНИМАЦИИ ЧАТА === */
@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingDots {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

@keyframes chatBubble {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === АНИМАЦИИ УВЕДОМЛЕНИЙ === */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* === СПЕЦИАЛЬНЫЕ АНИМАЦИИ ДЕНТАКЛИНИК === */
@keyframes logoGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(14, 165, 233, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
    }
}

@keyframes toothShine {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
    100% {
        filter: brightness(1);
    }
}

@keyframes treatmentSuccess {
    0% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.1);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: scale(1.2);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: scale(1.1);
        filter: hue-rotate(270deg);
    }
    100% {
        transform: scale(1);
        filter: hue-rotate(360deg);
    }
}

/* === ✅ СИСТЕМА АНИМАЦИЙ ДЛЯ SCROLL (БЕЗ СКРЫТИЯ КОНТЕНТА) === */
.animate-on-scroll {
    opacity: 1; /* ✅ ВИДИМЫЙ по умолчанию */
    transform: translateY(0); /* ✅ В нормальной позиции */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll:not(.animated) {
    opacity: 0; /* ✅ Скрываем ТОЛЬКО если еще не анимирован */
    transform: translateY(30px);
}

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

/* === ✅ СПЕЦИАЛЬНЫЕ КЛАССЫ ДЛЯ CHAT-DEMO === */

/* Базовые состояния для chat-demo элементов */
.chat-demo-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--duration-slow) var(--easing-enter);
}

.chat-demo-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анимация быстрых ответов */
.quick-replies-animate {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-out;
}

.quick-replies-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анимация статистики */
.stat-number-animate {
    transition: all 0.3s ease-out;
}

/* Пульсация статуса */
.status-dot {
    animation: statusDotPulse 2s infinite;
}

/* Анимация ripple для кнопок */
.chat-ripple-effect {
    position: relative;
    overflow: hidden;
}

.chat-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: chatRipple 0.6s linear;
    pointer-events: none;
}

/* === СПЕЦИАЛЬНЫЕ КЛАССЫ ДЛЯ HERO === */
.hero-element-ready {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

.hero-animate-delayed {
    animation-delay: var(--animation-delay, 0s);
}

/* === УНИВЕРСАЛЬНЫЕ ЭФФЕКТЫ === */
.smooth-hover {
    transition: transform var(--transition-base);
}

.smooth-hover:hover {
    transform: translateY(-2px);
}

.gentle-pulse {
    animation: gentlePulse 3s ease-in-out infinite;
}

.card-hover-effect {
    transition: transform var(--transition-base);
}

.card-hover-effect:hover {
    transform: translateY(-8px);
}

.button-press-effect:active {
    animation: buttonPress 0.2s ease-out;
}

/* === ✅ СПЕЦИАЛЬНЫЕ КЛАССЫ ДЛЯ OFFERS === */
.offer-card-animated {
    animation: offerCardSlideIn var(--duration-slow) var(--easing-enter) forwards;
}

.featured-glow {
    animation: featuredGlow 4s ease-in-out infinite;
}

.badge-float {
    animation: badgeFloat 2s ease-in-out infinite;
}

.price-highlight {
    animation: priceHighlight 1s ease-in-out;
}

.offer-icon-hover:hover {
    animation: offerIconHover 0.4s ease-out;
}

.offer-btn-glow:hover {
    animation: offerButtonGlow 1.5s ease-in-out infinite;
}

/* === ПРИМЕНЕНИЕ АНИМАЦИЙ К КЛАССАМ === */

/* Базовые анимации появления */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ✅ АНИМАЦИИ ДЛЯ CHAT-DEMO БЛОКА */
.chat-demo-slide-in {
    animation: chatDemoSlideIn 0.6s ease-out;
}

.chat-message-animate {
    animation: chatMessageSlide 0.3s ease-out;
}

.chat-quick-reply-show {
    animation: chatQuickReplyShow 0.4s ease-out;
}

.chat-stats-show {
    animation: chatStatsShow 0.5s ease-out;
}

/* Анимации счетчиков */
.stat-number.animated {
    animation: countUp 0.6s ease-out;
}

.stat-number:hover {
    animation: numberPulse 0.6s ease-in-out;
}

/* Анимации загрузки */
.loading-spinner {
    animation: spin 1s linear infinite;
}

.pulse-element {
    animation: gentlePulse 2s infinite;
}

/* Анимации кнопок */
.btn:active {
    animation: buttonPress 0.2s ease-out;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    animation: buttonShine 0.6s ease-out;
}

/* Анимации карточек */
.card.shake {
    animation: shake 0.5s ease-in-out;
}

/* Анимации модальных окон */
.modal-backdrop {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.closing {
    animation: modalSlideOut 0.3s ease-out;
}

/* Анимации форм */
.form-input:focus {
    animation: inputFocus 0.2s ease-out;
}

.form-input.error {
    animation: inputError 0.5s ease-in-out;
}

/* Анимации чата */
.chat-message {
    animation: messageSlide 0.3s ease-out;
}

.chat-bubble {
    animation: chatBubble 0.4s ease-out;
}

.typing-indicator::after {
    content: '...';
    animation: typingDots 1.5s infinite;
}

/* Анимации уведомлений */
.notification {
    animation: notificationSlideIn 0.3s ease-out;
}

.notification.closing {
    animation: notificationSlideOut 0.3s ease-out;
}

/* Специальные анимации ДентаКлиник */
.logo-icon:hover {
    animation: logoGlow 2s ease-in-out infinite;
}

.tooth-icon {
    animation: toothShine 3s ease-in-out infinite;
}

.treatment-success {
    animation: treatmentSuccess 2s ease-in-out;
}

/* === АДАПТИВНЫЕ АНИМАЦИИ === */
@media (max-width: 768px) {
    .animate-on-scroll {
        transition: opacity 0.4s ease-out;
    }
    
    .smooth-hover:hover {
        transform: none;
    }
    
    .card-hover-effect:hover {
        transform: translateY(-4px);
    }
    
    .btn:hover::before {
        animation: none;
    }
    
    /* ✅ Упрощенные анимации для offers на мобильных */
    .offer-card-animated {
        animation-duration: 0.4s;
    }
    
    .featured-glow {
        animation: none; /* Отключаем на мобильных */
    }
    
    .offer-btn-glow:hover {
        animation: none;
    }
    
    /* ✅ Упрощенные анимации для chat-demo на мобильных */
    .chat-demo-slide-in {
        animation-duration: 0.4s;
    }
    
    .chat-quick-reply-show {
        animation-duration: 0.3s;
    }
    
    .status-dot {
        animation: none; /* Отключаем пульсацию на мобильных */
    }
}

/* === ОТКЛЮЧЕНИЕ АНИМАЦИЙ === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll,
    .smooth-hover,
    .gentle-pulse,
    .offer-card-animated,
    .featured-glow,
    .badge-float,
    .offer-btn-glow,
    .chat-demo-animate,
    .quick-replies-animate,
    .status-dot,
    .chat-demo-slide-in,
    .chat-message-animate {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* === ПРОИЗВОДИТЕЛЬНОСТЬ === */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.hardware-accelerated {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
/* === ДОПОЛНЕНИЯ К ANIMATIONS.CSS === */
/* ✅ НЕДОСТАЮЩИЕ АНИМАЦИИ ДЛЯ HERO БЛОКА */

/* Анимация успешной отправки формы */
@keyframes buttonSuccess {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
    75% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Анимация курсора для эффекта печатания */
@keyframes typewriterCursor {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Дополнительные анимации для hero элементов */
@keyframes heroElementShow {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes doctorAvatarGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
    }
}

@keyframes featureIconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ✅ ПРИМЕНЕНИЕ АНИМАЦИЙ */
.hero-element-animate {
    animation: heroElementShow 0.6s ease-out;
}

.doctor-avatar:hover {
    animation: doctorAvatarGlow 2s ease-in-out infinite;
}

.hero-feature.feature-hovered .feature-icon {
    animation: featureIconBounce 0.6s ease-in-out;
}