/* Анимации и эффекты */

/* Базовые анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        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 pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    }
}

/* Классы анимаций */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

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

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

/* Hover эффекты */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

/* Анимации для карточек */
.card-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.card-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

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

.btn-animate::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-animate:hover::before {
    left: 100%;
}

/* Анимации для изображений */
.image-hover {
    transition: transform var(--transition-normal);
}

.image-hover:hover {
    transform: scale(1.1);
}

/* Анимации для иконок */
.icon-bounce {
    transition: transform var(--transition-fast);
}

.icon-bounce:hover {
    transform: scale(1.2);
}

/* Анимации для текста */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: slideInUp 0.8s ease-out forwards;
    opacity: 0;
}

.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

/* Анимации для списков */
.list-item-animate {
    opacity: 0;
    transform: translateX(-20px);
    transition: all var(--transition-normal);
}

.list-item-animate.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Анимации для форм */
.form-input-animate {
    transition: all var(--transition-fast);
}

.form-input-animate:focus {
    transform: scale(1.02);
}

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

.modal-backdrop-animate {
    animation: fadeIn 0.3s ease-out;
}

/* Анимации для навигации */
.nav-item-animate {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
}

.nav-item-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для счетчиков */
.counter-animate {
    animation: countUp 2s ease-out forwards;
}

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

/* Анимации для прогресс-баров */
.progress-animate {
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width);
    }
}

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

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

/* Анимации для уведомлений */
.notification-slide-in {
    animation: slideInRight 0.5s ease-out;
}

.notification-slide-out {
    animation: slideOutRight 0.5s ease-out;
}

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

/* Анимации для параллакса */
.parallax-element {
    transition: transform var(--transition-slow);
}

/* Анимации для скролла */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all var(--transition-slow);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для мобильного меню */
.mobile-menu-slide {
    animation: slideInLeft 0.3s ease-out;
}

.mobile-menu-slide-out {
    animation: slideOutLeft 0.3s ease-out;
}

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

/* Анимации для FAQ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.faq-answer.expanded {
    max-height: 500px;
}

/* Анимации для галереи */
.gallery-item {
    transition: all var(--transition-normal);
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Анимации для слайдера */
.slider-slide {
    transition: transform var(--transition-slow);
}

.slider-slide.active {
    transform: translateX(0);
}

.slider-slide.prev {
    transform: translateX(-100%);
}

.slider-slide.next {
    transform: translateX(100%);
}

/* Анимации для табов */
.tab-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.tab-content.active {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для аккордеона */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.accordion-content.expanded {
    max-height: 1000px;
}

/* Анимации для тултипов */
.tooltip {
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для дропдаунов */
.dropdown-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для чекбоксов */
.custom-checkbox {
    transition: all var(--transition-fast);
}

.custom-checkbox:checked {
    transform: scale(1.1);
}

/* Анимации для радио-кнопок */
.custom-radio {
    transition: all var(--transition-fast);
}

.custom-radio:checked {
    transform: scale(1.1);
}

/* Анимации для переключателей */
.toggle-switch {
    transition: all var(--transition-fast);
}

.toggle-switch.active {
    transform: translateX(20px);
}

/* Анимации для звездного рейтинга */
.star-rating .star {
    transition: all var(--transition-fast);
}

.star-rating .star:hover {
    transform: scale(1.2);
}

/* Анимации для загрузки страницы */
.page-transition {
    animation: pageLoad 0.5s ease-out;
}

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

/* Анимации для ошибок */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

/* Анимации для успеха */
.success-bounce {
    animation: bounceIn 0.8s ease-out;
}

/* Анимации для предупреждений */
.warning-pulse {
    animation: pulse 2s infinite;
}

/* Анимации для информации */
.info-fade {
    animation: fadeIn 0.8s ease-out;
}

/* Медиа-запросы для анимаций */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.5s;
    }
}
