/* ============================================
   ISKRA - Animations
   ============================================ */

/* Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@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.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.5);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    41%, 43% {
        opacity: 0.8;
    }
    45%, 47% {
        opacity: 1;
    }
    49% {
        opacity: 0.9;
    }
    80%, 82% {
        opacity: 0.8;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 69, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 69, 0, 0.5);
    }
}

@keyframes ember-rise {
    0% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(0.3);
    }
}

@keyframes scroll-bounce {
    0%, 100% {
        transform: rotate(45deg) translateY(0);
    }
    50% {
        transform: rotate(45deg) translateY(10px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes border-glow {
    0%, 100% {
        border-color: rgba(255, 69, 0, 0.2);
    }
    50% {
        border-color: rgba(255, 69, 0, 0.5);
    }
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(255, 69, 0, 0.8), 0 0 60px rgba(255, 69, 0, 0.5);
    }
}

/* Particle Styles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--fire-core);
    border-radius: 50%;
    filter: blur(1px);
    animation: particle-float linear infinite;
    pointer-events: none;
}

.particle:nth-child(1) { left: 5%; animation-duration: 15s; animation-delay: 0s; }
.particle:nth-child(2) { left: 10%; animation-duration: 18s; animation-delay: 2s; }
.particle:nth-child(3) { left: 15%; animation-duration: 12s; animation-delay: 4s; }
.particle:nth-child(4) { left: 20%; animation-duration: 20s; animation-delay: 1s; }
.particle:nth-child(5) { left: 25%; animation-duration: 14s; animation-delay: 3s; }
.particle:nth-child(6) { left: 30%; animation-duration: 16s; animation-delay: 5s; }
.particle:nth-child(7) { left: 35%; animation-duration: 19s; animation-delay: 0.5s; }
.particle:nth-child(8) { left: 40%; animation-duration: 13s; animation-delay: 2.5s; }
.particle:nth-child(9) { left: 45%; animation-duration: 17s; animation-delay: 4.5s; }
.particle:nth-child(10) { left: 50%; animation-duration: 11s; animation-delay: 1.5s; }
.particle:nth-child(11) { left: 55%; animation-duration: 15s; animation-delay: 3.5s; }
.particle:nth-child(12) { left: 60%; animation-duration: 18s; animation-delay: 0.2s; }
.particle:nth-child(13) { left: 65%; animation-duration: 14s; animation-delay: 2.2s; }
.particle:nth-child(14) { left: 70%; animation-duration: 20s; animation-delay: 4.2s; }
.particle:nth-child(15) { left: 75%; animation-duration: 12s; animation-delay: 1.2s; }
.particle:nth-child(16) { left: 80%; animation-duration: 16s; animation-delay: 3.2s; }
.particle:nth-child(17) { left: 85%; animation-duration: 19s; animation-delay: 5.2s; }
.particle:nth-child(18) { left: 90%; animation-duration: 13s; animation-delay: 0.8s; }
.particle:nth-child(19) { left: 95%; animation-duration: 17s; animation-delay: 2.8s; }
.particle:nth-child(20) { left: 98%; animation-duration: 15s; animation-delay: 4.8s; }

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger Animation 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; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Glitch Effect (for special elements) */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    color: #ff0000;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    color: #00ffff;
}

@keyframes glitch-1 {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

@keyframes glitch-2 {
    0% { transform: translateX(0); }
    20% { transform: translateX(2px); }
    40% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    80% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* Fire Border Effect */
.fire-border {
    position: relative;
}

.fire-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        #ff4500,
        #ff6b35,
        #ff8c42,
        #ff6b35,
        #ff4500
    );
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: gradient-shift 3s ease infinite;
    filter: blur(4px);
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--fire-core);
    animation: 
        typing 3s steps(30) forwards,
        blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Magnetic Button Effect (requires JS) */
.magnetic-btn {
    transition: transform 0.3s ease;
}

/* Card Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Neon Glow Text */
.neon-text {
    text-shadow:
        0 0 5px var(--fire-core),
        0 0 10px var(--fire-core),
        0 0 20px var(--fire-core),
        0 0 40px var(--fire-mid);
    animation: text-glow 2s infinite;
}

/* Breathing Animation */
.breathe {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Wave Effect */
.wave {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(10deg);
    }
    75% {
        transform: rotate(-10deg);
    }
}

/* Bounce */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shake on Error */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

