/* 
   FSVR - Farming Simulator 25 VR Mod
   Animated Background Styles
*/

/* ===== Animated Background Variables ===== */
:root {
    --particle-color: rgba(76, 175, 80, 0.7);
    --particle-color-alt: rgba(255, 193, 7, 0.7);
    --bg-color-1: #1a2a3a;
    --bg-color-2: #2c3e50;
    --bg-color-3: #34495e;
}

/* ===== Animated Background for Hero Section ===== */
.hero {
    background-image: url('images/hero-bg.jpg') !important; /* Use the downloaded background image */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-size: 400% 400%;
    animation: gradient-bg 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradient-bg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Particle effect */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(var(--particle-color) 2px, transparent 2px),
        radial-gradient(var(--particle-color-alt) 2px, transparent 2px);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    animation: particle-animation 4s linear infinite;
}

@keyframes particle-animation {
    0% {
        background-position: 0 0, 30px 30px;
        opacity: 0.5;
    }
    25% {
        background-position: 30px 0, 60px 30px;
        opacity: 0.8;
    }
    50% {
        background-position: 60px 0, 90px 30px;
        opacity: 0.5;
    }
    75% {
        background-position: 90px 0, 120px 30px;
        opacity: 0.8;
    }
    100% {
        background-position: 120px 0, 150px 30px;
        opacity: 0.5;
    }
}

/* Floating elements animation */
.floating-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.floating-element:nth-child(1) {
    top: 10%;
    left: 10%;
    width: 120px;
    height: 120px;
    animation: float 8s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    top: 20%;
    right: 15%;
    width: 160px;
    height: 160px;
    animation: float 12s ease-in-out infinite;
    animation-delay: 1s;
}

.floating-element:nth-child(3) {
    bottom: 15%;
    left: 25%;
    width: 100px;
    height: 100px;
    animation: float 10s ease-in-out infinite;
    animation-delay: 2s;
}

.floating-element:nth-child(4) {
    bottom: 25%;
    right: 20%;
    width: 140px;
    height: 140px;
    animation: float 14s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* VR-themed animated elements */
.vr-element {
    position: absolute;
    width: 200px;
    height: 100px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(255, 193, 7, 0.2));
    border-radius: 10px;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 0;
}

.vr-element:nth-child(5) {
    top: 30%;
    left: 5%;
    animation: vr-float 15s ease-in-out infinite;
}

.vr-element:nth-child(6) {
    bottom: 30%;
    right: 5%;
    animation: vr-float 18s ease-in-out infinite reverse;
    animation-delay: 2s;
}

@keyframes vr-float {
    0% {
        transform: translateZ(-50px) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: translateZ(50px) rotateX(180deg) rotateY(180deg);
    }
    100% {
        transform: translateZ(-50px) rotateX(360deg) rotateY(360deg);
    }
}

/* Tractor silhouette animation */
.tractor-silhouette {
    position: absolute;
    bottom: 5%;
    left: -150px;
    width: 150px;
    height: 80px;
    background-color: rgba(76, 175, 80, 0.3);
    clip-path: polygon(0% 80%, 10% 80%, 15% 65%, 20% 65%, 25% 40%, 60% 40%, 70% 10%, 80% 10%, 85% 40%, 90% 40%, 100% 65%, 100% 80%);
    animation: tractor-move 20s linear infinite;
}

@keyframes tractor-move {
    0% {
        left: -150px;
    }
    100% {
        left: calc(100% + 150px);
    }
}

/* VR headset silhouette animation */
.vr-headset-silhouette {
    position: absolute;
    top: 10%;
    right: -100px;
    width: 100px;
    height: 60px;
    background-color: rgba(255, 193, 7, 0.3);
    clip-path: polygon(0% 50%, 10% 20%, 90% 20%, 100% 50%, 90% 80%, 10% 80%);
    animation: vr-headset-move 25s linear infinite;
}

@keyframes vr-headset-move {
    0% {
        right: -100px;
        transform: translateY(0) rotate(0deg);
    }
    50% {
        right: calc(50% - 50px);
        transform: translateY(20px) rotate(10deg);
    }
    100% {
        right: calc(100% + 100px);
        transform: translateY(0) rotate(0deg);
    }
}

/* Ensure content is above animations */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-overlay {
    background-color: rgba(0, 0, 0, 0.5); /* Slightly transparent overlay */
    z-index: 1;
}
