/* ============================================
   BACKGROUND ANIMATION - Vision Global School
   Premium ambient gradient animation
   ============================================ */

/* Global Background Container */
body {
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg,
            var(--color-bg-white) 0%,
            var(--color-bg-light) 50%,
            var(--color-bg-white) 100%);
    pointer-events: none;
}

/* Animated Gradient Orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
    will-change: transform;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: float-orb-1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
    top: 40%;
    right: -5%;
    animation: float-orb-2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--color-accent-teal) 0%, transparent 70%);
    bottom: 10%;
    left: 20%;
    animation: float-orb-3 30s ease-in-out infinite;
}

/* Floating Animations */
@keyframes float-orb-1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(30px, 50px) scale(0.9);
    }

    75% {
        transform: translate(-40px, 20px) scale(1.05);
    }
}

@keyframes float-orb-2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-60px, 40px) scale(1.15);
    }

    66% {
        transform: translate(40px, -50px) scale(0.95);
    }
}

@keyframes float-orb-3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    40% {
        transform: translate(70px, -40px) scale(1.1);
    }

    80% {
        transform: translate(-50px, 30px) scale(0.9);
    }
}

/* Subtle Grid Pattern */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(26, 35, 50, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 35, 50, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.5;
}

/* Animated Light Sweep */
.bg-light-sweep {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background: linear-gradient(45deg,
            transparent 0%,
            transparent 45%,
            rgba(212, 175, 55, 0.03) 50%,
            transparent 55%,
            transparent 100%);
    animation: light-sweep 15s linear infinite;
    pointer-events: none;
}

@keyframes light-sweep {
    0% {
        transform: translate(-100%, -100%);
    }

    100% {
        transform: translate(100%, 100%);
    }
}

/* Particle Effect (Optional - Subtle) */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-secondary);
    border-radius: 50%;
    opacity: 0.2;
    animation: float-particle 20s linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.particle:nth-child(2) {
    left: 25%;
    animation-delay: 2s;
    animation-duration: 22s;
}

.particle:nth-child(3) {
    left: 40%;
    animation-delay: 4s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    left: 55%;
    animation-delay: 6s;
    animation-duration: 24s;
}

.particle:nth-child(5) {
    left: 70%;
    animation-delay: 8s;
    animation-duration: 19s;
}

.particle:nth-child(6) {
    left: 85%;
    animation-delay: 10s;
    animation-duration: 21s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.2;
    }

    90% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Dark Section Background Animation */
.bg-dark,
.stats-counter,
.why-choose-us {
    position: relative;
    overflow: hidden;
}

.bg-dark::after,
.stats-counter::after,
.why-choose-us::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%,
            rgba(212, 175, 55, 0.08) 0%,
            transparent 60%);
    animation: pulse-glow 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

    .bg-orb,
    .bg-light-sweep,
    .particle,
    .bg-dark::after,
    .stats-counter::after,
    .why-choose-us::after {
        animation: none !important;
    }

    .bg-orb {
        opacity: 0.05;
    }
}

/* Performance Optimization for Mobile */
@media (max-width: 767px) {
    .bg-orb {
        filter: blur(60px);
        opacity: 0.1;
    }

    .bg-orb-1 {
        width: 400px;
        height: 400px;
    }

    .bg-orb-2 {
        width: 350px;
        height: 350px;
    }

    .bg-orb-3 {
        width: 300px;
        height: 300px;
    }

    .bg-light-sweep,
    .bg-particles {
        display: none;
        /* Disable on mobile for performance */
    }
}

/* High Performance Mode - Disable heavy animations on low-end devices */
@media (max-width: 575px) {

    .bg-orb-2,
    .bg-orb-3 {
        display: none;
    }
}