/* Enhanced Animations and Effects for RoboReklama */

/* Base animation classes */
[data-animate] {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animated {
    opacity: 1;
}

/* Fade animations */
[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-up"].animated {
    transform: translateY(0);
}

[data-animate="fade-down"] {
    transform: translateY(-30px);
}

[data-animate="fade-down"].animated {
    transform: translateY(0);
}

[data-animate="fade-left"] {
    transform: translateX(-30px);
}

[data-animate="fade-left"].animated {
    transform: translateX(0);
}

[data-animate="fade-right"] {
    transform: translateX(30px);
}

[data-animate="fade-right"].animated {
    transform: translateX(0);
}

/* Scale animations */
[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="scale"].animated {
    transform: scale(1);
}

[data-animate="scale-up"] {
    transform: scale(0.8);
}

[data-animate="scale-up"].animated {
    transform: scale(1);
}

/* Rotate animations */
[data-animate="rotate"] {
    transform: rotate(-10deg);
}

[data-animate="rotate"].animated {
    transform: rotate(0);
}

/* Flip animations */
[data-animate="flip"] {
    transform: perspective(1000px) rotateY(-90deg);
}

[data-animate="flip"].animated {
    transform: perspective(1000px) rotateY(0);
}

/* Reveal animations */
[data-reveal] {
    position: relative;
    overflow: hidden;
}

[data-reveal]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%);
    transform: translateX(-100%);
    transition: transform 1s ease;
}

[data-reveal].revealed::before {
    transform: translateX(100%);
}

/* Button ripple effect */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-ripple {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Enhanced hover effects for cards */
.feature-card,
.robot-card,
.price-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.feature-card:hover,
.robot-card:hover,
.price-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Magnetic button effect - disabled */
[data-magnetic] {
    /* transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Typing effect */
.typing-text {
    border-right: 3px solid var(--primary-color);
    animation: blink-cursor 1s infinite;
}

@keyframes blink-cursor {
    0%, 50% {
        border-color: var(--primary-color);
    }
    51%, 100% {
        border-color: transparent;
    }
}

/* Particle effect */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.5;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    from {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Smooth section transitions */
.section-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced loading state */
body:not(.loaded) {
    overflow: hidden;
}

body:not(.loaded)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.loaded::before {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Glow effects */
.glow-on-hover {
    transition: all 0.3s ease;
}

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

/* Text reveal animation */
.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: text-reveal-animation 0.8s ease forwards;
}

.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; }

@keyframes text-reveal-animation {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Morph animation */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-animation {
    animation: morph 8s ease-in-out infinite;
}

/* Glitch effect */
.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;
    color: var(--primary-color);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite;
    color: var(--secondary-color);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% {
        clip: rect(0, 900px, 0, 0);
        transform: translate(0);
    }
    20% {
        clip: rect(20px, 900px, 40px, 0);
        transform: translate(-2px, 2px);
    }
    40% {
        clip: rect(40px, 900px, 60px, 0);
        transform: translate(2px, -2px);
    }
    60% {
        clip: rect(60px, 900px, 80px, 0);
        transform: translate(-2px, 2px);
    }
    80% {
        clip: rect(80px, 900px, 100px, 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        clip: rect(0, 900px, 0, 0);
        transform: translate(0);
    }
    20% {
        clip: rect(25px, 900px, 45px, 0);
        transform: translate(2px, -2px);
    }
    40% {
        clip: rect(45px, 900px, 65px, 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip: rect(65px, 900px, 85px, 0);
        transform: translate(2px, -2px);
    }
    80% {
        clip: rect(85px, 900px, 105px, 0);
        transform: translate(-2px, 2px);
    }
}

/* Smooth parallax */
[data-parallax] {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* Counter animation */
[data-counter] {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* Stagger animation for lists */
.stagger-list > * {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-fade 0.6s ease forwards;
}

.stagger-list > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-list > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-list > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-list > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-list > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-list > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes stagger-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Perspective hover effect */
.perspective-hover {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.perspective-hover:hover {
    transform: perspective(1000px) rotateX(10deg) translateZ(50px);
}

/* Liquid button effect */
.liquid-button {
    position: relative;
    overflow: hidden;
}

.liquid-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.liquid-button:hover::before {
    width: 300%;
    height: 300%;
}

/* Smooth color transitions */
.color-transition {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Breathing animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

/* Responsive animations */
@media (max-width: 768px) {
    [data-animate] {
        transition-duration: 0.6s;
    }
    
    .particle {
        width: 2px;
        height: 2px;
    }
    
    /* Disable complex animations on mobile for performance */
    .perspective-hover:hover {
        transform: none;
    }
    
    [data-parallax] {
        transform: none !important;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    [data-parallax] {
        transform: none !important;
    }
}