/* Animations and Background Effects */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Background Animation */
.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(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    opacity: 0.1;
    animation: float 8s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

.floating-element:nth-child(4) {
    bottom: 20%;
    right: 10%;
    animation-delay: 6s;
}

/* Animated Background Pattern */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 215, 0, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 215, 0, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 215, 0, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 215, 0, 0.03) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: float 20s linear infinite;
    z-index: -2;
}

/* Element Animations */
.hero-content {
    animation: fadeInLeft 1s ease-out;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.3s both;
}

.feature-card {
    animation: fadeInUp 0.8s ease-out;
}

.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-card {
    animation: fadeInUp 0.8s ease-out;
}

.game-card:nth-child(1) {
    animation-delay: 0.1s;
}

.game-card:nth-child(2) {
    animation-delay: 0.2s;
}

.game-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Button Hover Effects */
.btn-primary:hover {
    animation: pulse 0.6s ease-in-out;
}

.btn-secondary:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Logo Animation */
.nav-logo img {
    transition: transform 0.3s ease;
}

.nav-logo img:hover {
    transform: scale(1.1);
}

/* Navigation Link Hover */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transition: left 0.3s ease;
}

.nav-link:hover::before {
    left: 0;
}

/* Feature Card Hover Effects */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

/* Game Card Hover Effects */
.game-card img {
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.05);
}

/* Footer Link Hover */
.footer-section ul li a {
    position: relative;
}

.footer-section ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: 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, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: rotate 1s ease-in-out infinite;
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Intersection Observer Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Scale Effects */
.scale-hover {
    transition: transform 0.3s ease;
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: text-shadow 0.3s ease;
}

.text-glow:hover {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* Border Animation */
.animated-border {
    position: relative;
    overflow: hidden;
}

.animated-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transition: left 0.5s ease;
}

.animated-border:hover::before {
    left: 100%;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .hero-content, .hero-image {
        animation: fadeInUp 1s ease-out;
    }
    
    .feature-card, .game-card {
        animation: fadeInUp 0.6s ease-out;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .hero::after,
    .animated-bg,
    .floating-element {
        animation: none;
    }
    
    .hero-content,
    .hero-image,
    .feature-card,
    .game-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        animation: none;
    }
    
    .nav-logo img:hover {
        transform: none;
    }
    
    .game-card:hover img {
        transform: none;
    }
}
