/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(147, 51, 234, 0.6);
    }
}

/* Utility Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

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

/* Card Hover Effects */
.anime-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.anime-card:hover {
    transform: translateY(-8px);
}

.anime-card .play-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.anime-card:hover .play-overlay {
    opacity: 1;
}

.anime-card .card-image {
    transition: transform 0.5s ease;
}

.anime-card:hover .card-image {
    transform: scale(1.1);
}

/* Genre Card Hover */
.genre-card {
    transition: all 0.3s ease;
}

.genre-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(147, 51, 234, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Gradient Text Animation */
.gradient-text-animated {
    background-size: 200% auto;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Button Glow */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::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;
}

.btn-glow:hover::before {
    left: 100%;
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: #9333ea;
    color: white;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
}

/* Loading Skeleton Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background-color: #9333ea;
    color: white;
}

/* Focus Visible Styles */
:focus-visible {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
}

/* Navigation Blur */
.nav-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Image Loading Placeholder */
.img-loading {
    background: linear-gradient(110deg, #1e293b 8%, #334155 18%, #1e293b 33%);
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}