/* ============================================
   MediaFlow - Animations CSS
   ============================================ */

/* Keyframe Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

@keyframes floatNote {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.1;
    }

    90% {
        opacity: 0.1;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.2;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

@keyframes waveform {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Staggered Animations */
.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;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: var(--glow-primary);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-tertiary) 50%, var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-thumbnail {
    aspect-ratio: 16/9;
    width: 100%;
}

/* Waveform Animation */
.waveform-bar {
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    animation: waveform 0.5s ease infinite;
}

.waveform-bar:nth-child(1) {
    animation-delay: 0s;
}

.waveform-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.waveform-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.waveform-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.waveform-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.waveform-bar:nth-child(6) {
    animation-delay: 0.5s;
}

.waveform-bar:nth-child(7) {
    animation-delay: 0.6s;
}

.waveform-bar:nth-child(8) {
    animation-delay: 0.7s;
}

.waveform-bar:nth-child(9) {
    animation-delay: 0.8s;
}

.waveform-bar:nth-child(10) {
    animation-delay: 0.9s;
}

/* 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.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
    opacity: 1;
    transition: 0s;
}

/* Neon Glow Effect */
.neon-glow {
    position: relative;
}

.neon-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--primary-gradient);
    border-radius: inherit;
    filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.neon-glow:hover::before {
    opacity: 0.5;
}

/* Floating Animation for Cards */
.float-card {
    animation: floatCard 6s ease-in-out infinite;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Typing Animation */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Progress Animation */
.progress-animate {
    animation: progressGrow 0.5s ease forwards;
}

@keyframes progressGrow {
    from {
        width: 0;
    }
}

/* Particle Effect Background */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.1;
    animation: floatParticle 20s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
    }

    100% {
        transform: translateY(-100vh) translateX(100px) rotate(720deg);
    }
}

/* Smooth Transitions on Theme Change */
body,
.header,
.footer,
.result-card,
.trending-card,
.feature-card {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}