/* animations.css - Профессиональные анимации для POPUTI */

/* Глобальные анимации */
@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 79, 1, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 79, 1, 0.6);
    }
}

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

/* Классы для применения анимаций */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

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

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

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

.animate-slide-in-bottom {
    animation: slideInFromBottom 0.7s ease-out forwards;
}

.animate-slide-in-top {
    animation: slideInFromTop 0.7s ease-out forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

.animate-flip-in-x {
    animation: flipInX 0.6s ease-out forwards;
}

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

.animate-bounce {
    animation: bounce 1s infinite;
}

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

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

/* Анимации при наведении */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 79, 1, 0.4);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

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

.hover-slide-right {
    transition: transform 0.3s ease;
}

.hover-slide-right:hover {
    transform: translateX(10px);
}

/* Анимации для кнопок */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::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 0.5s;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Анимации для карточек */
.card-animated {
    transition: all 0.3s ease;
    transform-origin: center;
}

.card-animated:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Анимации для таблиц */
.table-row-animated {
    transition: all 0.3s ease;
}

.table-row-animated:hover {
    background-color: rgba(255, 79, 1, 0.05);
    transform: scale(1.01);
}

/* Анимации для сайдбара */
.sidebar-item-animated {
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-item-animated::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-item-animated:hover::before,
.sidebar-item-animated.active::before {
    transform: scaleY(1);
}

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

.modal-backdrop-animated {
    animation: fadeInUp 0.3s ease-out;
}

/* Анимации для форм */
.form-input-animated {
    transition: all 0.3s ease;
    position: relative;
}

.form-input-animated:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(255, 79, 1, 0.1);
}

/* Анимации для статистических карточек */
.stat-card-animated {
    transition: all 0.4s ease;
    transform-origin: center;
}

.stat-card-animated:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Анимации для иконок */
.icon-animated {
    transition: all 0.3s ease;
}

.icon-animated:hover {
    transform: rotate(360deg) scale(1.2);
    color: var(--accent-color);
}

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

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0),
                     .5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: black;
        text-shadow: .25em 0 0 rgba(0, 0, 0, 0),
                     .5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow: .25em 0 0 black,
                     .5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 black,
                     .5em 0 0 black;
    }
}

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

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

/* Анимации для прогресс-баров */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Задержки для последовательных анимаций */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }
.animate-delay-700 { animation-delay: 0.7s; }
.animate-delay-800 { animation-delay: 0.8s; }

/* Утилиты для управления анимациями */
.animate-paused {
    animation-play-state: paused;
}

.animate-running {
    animation-play-state: running;
}

/* Респонсивные анимации */
@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-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .card-animated:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

