/*
================================
--- Modern Animations & Effects ---
================================
*/

/* Smooth page entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(229, 9, 20, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(229, 9, 20, 0.6), 0 0 30px rgba(229, 9, 20, 0.4);
    }
}

/* Staggered animation delays for cards */
.video-item:nth-child(1) { animation-delay: 0.1s; }
.video-item:nth-child(2) { animation-delay: 0.2s; }
.video-item:nth-child(3) { animation-delay: 0.3s; }
.video-item:nth-child(4) { animation-delay: 0.4s; }
.video-item:nth-child(5) { animation-delay: 0.5s; }
.video-item:nth-child(6) { animation-delay: 0.6s; }
.video-item:nth-child(7) { animation-delay: 0.7s; }
.video-item:nth-child(8) { animation-delay: 0.8s; }

/* Page entrance animations */
.animate-page {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-header {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-cards {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced hover effects */
.modern-hover {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modern-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(229, 9, 20, 0.2);
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Loading improvements */
.modern-loader {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--color-primary) 90deg, transparent 360deg);
    animation: spin 1s linear infinite;
}

.modern-loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--color-background);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Skeleton loading with shimmer */
.skeleton {
    background: linear-gradient(90deg, 
        var(--color-surface) 25%, 
        #2a313a 50%, 
        var(--color-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Button modern effects */
.modern-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, var(--color-primary), #c7070f);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modern-button::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 ease;
}

.modern-button:hover::before {
    left: 100%;
}

.modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.4);
}

/* Search bar animations */
.search-focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
}

/* Category header animations */
.category-title {
    position: relative;
    overflow: hidden;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #ff6b35);
    transition: width 0.5s ease;
}

.category-title:hover::after {
    width: 100%;
}

/* Modal animations */
@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-enter {
    animation: modalShow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Notification improvements */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-modern {
    animation: slideInRight 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    background: rgba(25, 30, 36, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Parallax container */
.parallax-container {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.parallax-element {
    transform: translateZ(-1px) scale(2);
}

/* Glassmorphism effects */
.glass-effect {
    background: rgba(25, 30, 36, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Progress bar animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width, 100%);
    }
}

.progress-bar {
    animation: progressFill 2s ease-out;
}

/* Text typing effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--color-primary);
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-primary);
    }
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #ff6b35);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Enhanced transitions */
.smooth-transition {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Particle background effect */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.5;
    }
}

.particle {
    position: absolute;
    background: rgba(229, 9, 20, 0.1);
    border-radius: 50%;
    animation: particleFloat 8s infinite ease-in-out;
}

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
    .modern-hover:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
