/* Animations and Background Effects */

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

/* Enhanced Image Glow Animation */
@keyframes imageGlow {
    0%, 100% {
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
    }
    50% {
        filter: brightness(1.2) contrast(1.2) drop-shadow(0 0 20px rgba(0, 212, 255, 0.6));
    }
}

/* Slide In Animation */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotate Animation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Background Particle Animation */
@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Image Zoom Animation */
@keyframes imageZoom {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Image Shine Effect */
@keyframes imageShine {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

/* Apply animations to elements */
.hero-title {
    animation: slideInFromLeft 1s ease-out;
}

.hero-subtitle {
    animation: slideInFromLeft 1s ease-out 0.2s both;
}

.hero-description {
    animation: slideInFromLeft 1s ease-out 0.4s both;
}

.hero-buttons {
    animation: slideInFromLeft 1s ease-out 0.6s both;
}

.hero-image {
    animation: slideInFromRight 1s ease-out 0.3s both;
}

.feature-card {
    animation: fadeIn 0.8s ease-out both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

.game-category {
    animation: fadeIn 0.8s ease-out both;
}

.game-category:nth-child(1) { animation-delay: 0.1s; }
.game-category:nth-child(2) { animation-delay: 0.2s; }
.game-category:nth-child(3) { animation-delay: 0.3s; }

.step {
    animation: fadeIn 0.8s ease-out both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

/* Enhanced image hover effects */
.feature-card:hover .feature-icon img {
    animation: imageGlow 2s ease-in-out infinite;
}

.btn-primary:hover {
    animation: pulse 0.6s ease-in-out;
}

.nav-logo:hover img {
    animation: rotate 0.6s ease-in-out;
}

/* Background effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(0, 212, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 107, 107, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: float 15s ease-in-out infinite reverse;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(78, 205, 196, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: pulse 10s ease-in-out infinite;
}

/* Enhanced hero background */
.hero {
    position: relative;
    overflow: hidden;
}

/* Gradient shift animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    filter: blur(2px);
    transition: all 0.3s ease;
}

.loading.loaded {
    opacity: 1;
    filter: blur(0);
}

/* Scroll animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax effect for images */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Enhanced image animations */
.feature-icon img,
.game-category img,
.hero-image img {
    transition: all 0.3s ease;
}

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

/* Enhanced card effects */
.feature-card,
.game-category {
    position: relative;
    overflow: hidden;
}

.feature-card::before,
.game-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before,
.game-category:hover::before {
    left: 100%;
}

/* Enhanced text animations */
.hero-title,
.hero-subtitle,
.hero-description {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.hero-title { animation-delay: 0.2s; }
.hero-subtitle { animation-delay: 0.4s; }
.hero-description { animation-delay: 0.6s; }

/* Responsive animations */
@media (max-width: 768px) {
    .hero::after,
    .hero::before {
        display: none;
    }
    
    .hero {
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 107, 107, 0.1) 100%);
    }
}

/* 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;
    }
}

/* Enhanced focus states */
.feature-card,
.game-category {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:focus,
.nav-link:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Loading state animations */
.loading-state {
    position: relative;
    overflow: hidden;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: imageShine 1.5s ease-in-out infinite;
}

/* Enhanced image hover effects with shine */
.hero-image:hover::after,
.feature-card:hover .feature-icon::after,
.game-category:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: imageShine 0.8s ease-in-out;
}

/* Image zoom effect on hover */
.feature-card:hover .feature-icon img,
.game-category:hover img {
    animation: imageZoom 0.6s ease-in-out;
}

/* Smooth image transitions */
img {
    transition: all 0.3s ease;
}

/* Enhanced accessibility for images */
img:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image loading placeholder */
.image-placeholder {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 107, 107, 0.1));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
    min-height: 100px;
}

/* Enhanced image captions */
.image-caption {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.image-container:hover .image-caption {
    opacity: 1;
    transform: translateY(0);
}
