/* 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(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 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;
    }
}

/* Apply Animations to Elements */
.hero-title {
    animation: slideInFromLeft 1s ease-out;
}

.hero-subtitle {
    animation: slideInFromLeft 1s ease-out 0.3s 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;
    transition: all 0.3s ease;
}

.feature-card:hover {
    animation: pulse 2s infinite;
}

.step {
    animation: fadeIn 0.8s ease-out;
    transition: all 0.3s ease;
}

.step:hover {
    animation: float 3s ease-in-out infinite;
}

.game-card {
    animation: fadeIn 0.8s ease-out;
    transition: all 0.3s ease;
}

.game-card:hover {
    animation: glow 2s infinite;
}

/* Background Effects */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(15, 52, 96, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(83, 52, 131, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 1;
}

/* Floating Particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 215, 0, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 15s linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 18s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 22s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 6s;
    animation-duration: 16s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 8s;
    animation-duration: 24s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 10s;
    animation-duration: 19s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 12s;
    animation-duration: 21s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 14s;
    animation-duration: 17s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 16s;
    animation-duration: 23s;
}

/* Interactive Hover Effects */
.btn:hover {
    transform: translateY(-3px);
    transition: all 0.3s ease;
}

.btn:active {
    transform: translateY(-1px);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--gold-color);
    animation: rotate 1s ease-in-out infinite;
}

/* Stagger Animation for Feature Cards */
.features-grid .feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.features-grid .feature-card:nth-child(2) {
    animation-delay: 0.3s;
}

.features-grid .feature-card:nth-child(3) {
    animation-delay: 0.5s;
}

/* Stagger Animation for Steps */
.steps-container .step:nth-child(1) {
    animation-delay: 0.1s;
}

.steps-container .step:nth-child(2) {
    animation-delay: 0.3s;
}

.steps-container .step:nth-child(3) {
    animation-delay: 0.5s;
}

.steps-container .step:nth-child(4) {
    animation-delay: 0.7s;
}

/* Stagger Animation for Game Cards */
.games-grid .game-card:nth-child(1) {
    animation-delay: 0.1s;
}

.games-grid .game-card:nth-child(2) {
    animation-delay: 0.3s;
}

.games-grid .game-card:nth-child(3) {
    animation-delay: 0.5s;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Parallax Effect for Background */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(45deg, var(--gold-color), #ffed4e, var(--gold-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Responsive Animations */
@media (max-width: 768px) {
    .hero-title,
    .hero-subtitle,
    .hero-buttons,
    .hero-image {
        animation: fadeIn 0.8s ease-out;
    }
    
    .particle {
        display: none;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    .particle {
        display: none;
    }
}

/* Performance Optimizations */
.feature-card,
.step,
.game-card {
    will-change: transform;
}

.btn {
    will-change: transform;
}

/* Smooth Transitions for All Interactive Elements */
a,
button,
input,
textarea,
select {
    transition: all 0.3s ease;
}

/* Focus Animations */
.nav-link:focus,
.btn:focus {
    animation: pulse 0.3s ease-in-out;
}

/* Hover State Transitions */
.nav-link:hover,
.footer-section a:hover {
    transition: color 0.3s ease;
}

/* Card Hover Effects */
.feature-card:hover,
.step:hover,
.game-card:hover {
    transition: all 0.3s ease;
}
