/* Animations and Background Effects */

/* Keyframe Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(1deg);
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

@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(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Background Effects */
.hero-background-animation {
    background: linear-gradient(45deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 25%, 
        rgba(245, 158, 11, 0.1) 50%, 
        rgba(37, 99, 235, 0.1) 75%, 
        rgba(124, 58, 237, 0.1) 100%);
    background-size: 400% 400%;
    animation: shimmer 15s ease-in-out infinite;
}

/* Animated Background Pattern */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 25s ease-in-out infinite;
    pointer-events: none;
}

/* Floating Elements Animation */
.floating-element {
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    animation-delay: -2s;
}

.floating-element:nth-child(3) {
    animation-delay: -4s;
}

/* Entrance Animations */
.hero-content {
    animation: slideInFromLeft 1s ease-out;
}

.hero-image {
    animation: slideInFromRight 1s ease-out 0.3s both;
}

.login-section {
    animation: slideInFromBottom 1s ease-out 0.5s both;
}

.register-section {
    animation: slideInFromBottom 1s ease-out 0.7s both;
}

.games-showcase {
    animation: slideInFromBottom 1s ease-out 0.9s both;
}

/* Card Hover Effects */
.game-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Button Hover Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.2);
}

/* Step Number Animation */
.step-number {
    animation: scaleIn 0.6s ease-out;
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

/* Feature Item Animation */
.feature-item {
    animation: fadeIn 0.8s ease-out;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Navigation Menu Animation */
.nav-menu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu.active {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Logo Animation */
.nav-logo img {
    transition: transform 0.3s ease;
}

.nav-logo:hover img {
    transform: scale(1.05);
}

/* Footer Link Hover Effects */
.footer-section ul li a {
    position: relative;
    transition: all 0.3s ease;
}

.footer-section ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-section ul li a:hover::after {
    width: 100%;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: rotate 1s ease-in-out infinite;
}

/* Scroll-triggered Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

/* Pulse Animation for Important Elements */
.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Rotating Elements */
.rotating {
    animation: rotate 10s linear infinite;
}

/* Staggered Animation for Lists */
.staggered-list li {
    opacity: 0;
    animation: slideInFromLeft 0.6s ease-out forwards;
}

.staggered-list li:nth-child(1) { animation-delay: 0.1s; }
.staggered-list li:nth-child(2) { animation-delay: 0.2s; }
.staggered-list li:nth-child(3) { animation-delay: 0.3s; }
.staggered-list li:nth-child(4) { animation-delay: 0.4s; }
.staggered-list li:nth-child(5) { animation-delay: 0.5s; }

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-background-animation,
    .hero::before {
        animation: none;
    }
}

@media (max-width: 768px) {
    .hero-content,
    .hero-image {
        animation: slideInFromBottom 0.8s ease-out;
    }
    
    .hero-image {
        animation-delay: 0.2s;
    }
}

/* Performance Optimizations */
.will-change {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
