/* =====================
   Gradient Background - Modern Wave Style
   ===================== */
.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: visible;
    background: var(--bg-color);
    pointer-events: none;
}

/* Animated gradient spheres */
.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: screen;
}

.sphere-1 {
    width: 80vmax;
    height: 80vmax;
    background: linear-gradient(180deg,
            rgba(255, 140, 50, 0.8) 0%,
            rgba(255, 80, 50, 0.4) 50%,
            rgba(255, 180, 50, 0.2) 100%);
    top: -20%;
    left: -20%;
    animation: moveShape1 25s ease-in-out infinite;
}

.sphere-2 {
    width: 70vmax;
    height: 70vmax;
    background: linear-gradient(180deg,
            rgba(255, 200, 100, 0.6) 0%,
            rgba(255, 150, 50, 0.3) 50%,
            rgba(255, 100, 50, 0.15) 100%);
    bottom: -20%;
    right: -20%;
    animation: moveShape2 30s ease-in-out infinite;
}

.sphere-3 {
    width: 60vmax;
    height: 60vmax;
    background: linear-gradient(180deg,
            rgba(255, 180, 80, 0.5) 0%,
            rgba(255, 120, 50, 0.25) 50%,
            rgba(200, 100, 50, 0.1) 100%);
    top: 30%;
    left: 40%;
    animation: moveShape3 20s ease-in-out infinite;
}

/* Dark theme adjustments for spheres - Space with warm tint */
[data-theme="dark"] .gradient-sphere {
    mix-blend-mode: normal;
    opacity: 0.4;
}

[data-theme="dark"] .sphere-1 {
    background: linear-gradient(180deg,
            rgba(255, 140, 50, 0.25) 0%,
            rgba(255, 80, 30, 0.12) 50%,
            rgba(200, 100, 40, 0.06) 100%);
}

[data-theme="dark"] .sphere-2 {
    background: linear-gradient(180deg,
            rgba(255, 180, 80, 0.18) 0%,
            rgba(255, 120, 40, 0.1) 50%,
            rgba(220, 100, 50, 0.05) 100%);
}

[data-theme="dark"] .sphere-3 {
    background: linear-gradient(180deg,
            rgba(255, 160, 60, 0.15) 0%,
            rgba(255, 100, 40, 0.08) 50%,
            rgba(200, 80, 40, 0.04) 100%);
}

/* Enable additional spheres for full page coverage */
.sphere-4 {
    display: block;
    width: 50vmax;
    height: 50vmax;
    background: linear-gradient(180deg,
            rgba(255, 160, 60, 0.6) 0%,
            rgba(255, 100, 50, 0.3) 50%,
            rgba(255, 140, 50, 0.15) 100%);
    top: 60%;
    left: -10%;
    animation: moveShape4 22s ease-in-out infinite;
}

.sphere-5 {
    display: block;
    width: 55vmax;
    height: 55vmax;
    background: linear-gradient(180deg,
            rgba(255, 180, 80, 0.5) 0%,
            rgba(255, 120, 50, 0.25) 50%,
            rgba(255, 100, 50, 0.1) 100%);
    top: 150%;
    right: 5%;
    animation: moveShape5 28s ease-in-out infinite;
}

.sphere-6 {
    display: block;
    width: 45vmax;
    height: 45vmax;
    background: linear-gradient(180deg,
            rgba(255, 200, 100, 0.5) 0%,
            rgba(255, 150, 50, 0.25) 50%,
            rgba(255, 80, 50, 0.1) 100%);
    top: 200%;
    left: 30%;
    animation: moveShape6 25s ease-in-out infinite;
}

[data-theme="dark"] .sphere-4 {
    background: linear-gradient(180deg,
            rgba(255, 150, 50, 0.2) 0%,
            rgba(255, 90, 30, 0.1) 50%,
            rgba(200, 80, 40, 0.05) 100%);
    opacity: 0.35;
}

[data-theme="dark"] .sphere-5 {
    background: linear-gradient(180deg,
            rgba(255, 170, 70, 0.18) 0%,
            rgba(255, 110, 40, 0.09) 50%,
            rgba(220, 90, 40, 0.04) 100%);
    opacity: 0.3;
}

[data-theme="dark"] .sphere-6 {
    background: linear-gradient(180deg,
            rgba(255, 190, 90, 0.18) 0%,
            rgba(255, 130, 50, 0.09) 50%,
            rgba(200, 100, 50, 0.04) 100%);
    opacity: 0.3;
}

[data-theme="dark"] .sphere-3 {
    display: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    z-index: 2;
}

.glow-1 {
    width: 50vmax;
    height: 50vmax;
    background: radial-gradient(circle, rgba(255, 180, 50, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    animation: pulse 8s ease-in-out infinite;
}

/* Subtle grid overlay */
.grid-overlay {
    display: none;
}

[data-theme="dark"] .grid-overlay {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

.noise-overlay {
    display: none;
}

/* Particles Container */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 150, 50, 0.75);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 150, 50, 0.6), 0 0 20px rgba(255, 100, 50, 0.4);
}

[data-theme="dark"] .particle {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 20px rgba(200, 220, 255, 0.4);
}

/* Section Balls Container */
.section-balls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Ensure sections have relative positioning for balls */
#about,
#career,
#projects,
#contact {
    position: relative;
    overflow: hidden;
}

/* Random Balls */
.random-ball {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 200, 100, 0.8),
            rgba(255, 150, 50, 0.5) 50%,
            rgba(255, 100, 30, 0.3));
    pointer-events: none;
    box-shadow:
        0 0 15px rgba(255, 150, 50, 0.4),
        0 0 30px rgba(255, 100, 50, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
}

[data-theme="dark"] .random-ball {
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.6),
            rgba(200, 220, 255, 0.4) 50%,
            rgba(150, 180, 255, 0.2));
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(200, 220, 255, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Smooth flowing animations */
@keyframes moveShape1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(5%, 10%) rotate(5deg) scale(1.05);
    }

    50% {
        transform: translate(10%, 5%) rotate(-5deg) scale(0.95);
    }

    75% {
        transform: translate(-5%, 8%) rotate(3deg) scale(1.02);
    }
}

@keyframes moveShape2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(-8%, -5%) rotate(-5deg) scale(1.03);
    }

    50% {
        transform: translate(-5%, -10%) rotate(5deg) scale(0.97);
    }

    75% {
        transform: translate(5%, -8%) rotate(-3deg) scale(1.01);
    }
}

@keyframes moveShape3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(-45%, -55%) scale(1.1) rotate(120deg);
    }

    66% {
        transform: translate(-55%, -45%) scale(0.9) rotate(240deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes moveShape4 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(10%, -5%) rotate(8deg) scale(1.05);
    }

    50% {
        transform: translate(-5%, 10%) rotate(-5deg) scale(0.95);
    }

    75% {
        transform: translate(8%, 5%) rotate(3deg) scale(1.02);
    }
}

@keyframes moveShape5 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(-10%, 8%) rotate(-6deg) scale(1.04);
    }

    50% {
        transform: translate(8%, -8%) rotate(6deg) scale(0.96);
    }

    75% {
        transform: translate(-5%, -5%) rotate(-3deg) scale(1.01);
    }
}

@keyframes moveShape6 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(5%, 12%) rotate(5deg) scale(1.06);
    }

    50% {
        transform: translate(-8%, 5%) rotate(-8deg) scale(0.94);
    }

    75% {
        transform: translate(10%, -5%) rotate(4deg) scale(1.03);
    }
}

/* =====================
   Space Background - Stars (Dark Mode Only)
   ===================== */

/* Stars container - hidden in light mode */
.stars-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] .stars-container {
    display: block;
}

/* Star layers */
.stars-small,
.stars-medium,
.stars-large {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: opacity;
}

.stars-small {
    animation: twinkle 4s ease-in-out infinite;
}

.stars-medium {
    animation: twinkle 5s ease-in-out infinite 1.5s;
}

.stars-large {
    animation: twinkle 6s ease-in-out infinite 3s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* =====================
   Shooting Stars
   ===================== */
.shooting-stars-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* Removed shooting stars per user request */

/* =====================
   Dark-mode particle color override (space theme)
   ===================== */
[data-theme="dark"] .glow-1 {
    background: radial-gradient(circle, rgba(255, 160, 50, 0.06), transparent 70%);
}

[data-theme="dark"] .random-ball {
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 220, 180, 0.45),
            rgba(255, 160, 80, 0.25) 50%,
            rgba(200, 120, 60, 0.1));
    box-shadow:
        0 0 15px rgba(255, 160, 80, 0.2),
        0 0 30px rgba(200, 120, 60, 0.1),
        inset 0 0 10px rgba(255, 220, 180, 0.12);
}