/**
 * HOT PC - Animations
 * Все анимации и переходы
 */

/* ========== Loader Animation ========== */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-black);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.loader-circle {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 30, 30, 0.1);
    border-top-color: var(--color-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 900;
    color: var(--color-red);
    text-shadow: 0 0 20px rgba(255, 30, 30, 0.5);
    animation: pulse-glow 2s ease-in-out infinite;
}

.loader-text {
    margin-top: 30px;
    font-family: var(--font-secondary);
    font-size: 16px;
    color: var(--color-white);
    opacity: 0.7;
    animation: fade-in-out 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 1;
        text-shadow: 0 0 20px rgba(255, 30, 30, 0.5);
    }
    50% { 
        opacity: 0.8;
        text-shadow: 0 0 30px rgba(255, 30, 30, 0.8);
    }
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========== Page Load Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== Slide Animations ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== Bounce Animations ========== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0);
    }
    40% { 
        transform: translateY(-10px);
    }
    60% { 
        transform: translateY(-5px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== Glow Animations ========== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 30, 30, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 30, 30, 0.5);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 30, 30, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 30, 30, 0.6);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 30, 30, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 30, 30, 0.6);
    }
}

/* ========== Rotate Animations ========== */
@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ========== Shake Animation ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes shakeY {
    0%, 100% { transform: translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateY(-3px); }
    20%, 40%, 60%, 80% { transform: translateY(3px); }
}

/* ========== Pulse Animations ========== */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes pulseSubtle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========== Background Animations ========== */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes waveMove {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-25px) translateY(-10px); }
    100% { transform: translateX(0) translateY(0); }
}

/* ========== Hover Effects ========== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 30, 30, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 30, 30, 0.4);
    border-color: var(--color-red);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ========== Component Animations ========== */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.6s ease forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.6s ease forwards;
}

/* ========== Stagger Delays ========== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ========== Card Flip Animation ========== */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* ========== Progress Bar Animation ========== */
@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

.progress-bar-fill {
    animation: progressFill 2s ease forwards;
}

/* ========== Typewriter Effect ========== */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-red);
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40) 1s forwards,
        blinkCursor 0.75s step-end infinite;
}

/* ========== Ripple Effect ========== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 30, 30, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* ========== Skeleton Loading ========== */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-dark) 0px,
        var(--color-gray) 40px,
        var(--color-gray-dark) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ========== Shimmer Effect ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 30, 30, 0.2),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========== Floating Animation ========== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* ========== Notification Slide ========== */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100px);
    }
}

.notification-enter {
    animation: slideInBottom 0.4s ease forwards;
}

.notification-exit {
    animation: slideOutBottom 0.4s ease forwards;
}

/* ========== Border Animation ========== */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--color-gray-light);
        box-shadow: 0 0 5px rgba(255, 30, 30, 0);
    }
    50% {
        border-color: var(--color-red);
        box-shadow: 0 0 20px rgba(255, 30, 30, 0.5);
    }
}

.border-animate {
    animation: borderGlow 2s ease-in-out infinite;
}

/* ========== Text Reveal ========== */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    opacity: 0;
    animation: textReveal 0.8s ease forwards;
}

/* ========== Neon Glow ========== */
@keyframes neonGlow {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(255, 30, 30, 0.5),
            0 0 10px rgba(255, 30, 30, 0.5),
            0 0 20px rgba(255, 30, 30, 0.5);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(255, 30, 30, 0.8),
            0 0 20px rgba(255, 30, 30, 0.8),
            0 0 40px rgba(255, 30, 30, 0.8);
    }
}

.neon-text {
    animation: neonGlow 2s ease-in-out infinite;
}

/* ========== Performance Optimizations ========== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.smooth-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ========== Reduced Motion Support ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

