/* Advanced animations and micro-interactions */

/* Floating particles background effect */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 15px;
    height: 15px;
    left: 20%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 70%;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    width: 12px;
    height: 12px;
    left: 80%;
    animation-delay: 3s;
}

.particle:nth-child(5) {
    width: 6px;
    height: 6px;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced button hover effects */
.button-primary {
    position: relative;
    overflow: hidden;
}

.button-primary::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;
}

.button-primary:hover::before {
    left: 100%;
}

/* Smooth page transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: pageEnter 0.8s ease-out forwards;
}

@keyframes pageEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced result animation */
.result-appear {
    animation: resultSlideIn 0.6s ease-out;
}

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

/* Glowing border effect for upload area */
.upload-glow {
    position: relative;
}

.upload-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-glow:hover::before {
    opacity: 1;
    animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Ripple effect for buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    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;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Parallax scroll effect */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}