/* ========================================
   PlanningHUB Background System
   Mesh gradients, grain, decorations
   ======================================== */

/* --- Animated Gradient Mesh (Mint/Purple unified) --- */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-mesh::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(139, 111, 168, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(92, 198, 195, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 60% 80%, rgba(139, 111, 168, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 70% 40% at 10% 90%, rgba(92, 198, 195, 0.08) 0%, transparent 50%);
    animation: meshMove 25s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 1%) rotate(1deg); }
    50% { transform: translate(-1%, 2%) rotate(-1deg); }
    75% { transform: translate(1%, -1%) rotate(0.5deg); }
}

/* --- Grain Overlay --- */
.grain {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --- Decorative Bokeh Circles --- */
.bg-bokeh {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: bokehFloat 20s ease-in-out infinite;
}

.bg-bokeh-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--ph-mint);
    top: 10%;
    right: -5%;
    animation-delay: 0s;
}

.bg-bokeh-circle:nth-child(2) {
    width: 250px;
    height: 250px;
    background: var(--ph-purple);
    bottom: 20%;
    left: -5%;
    animation-delay: -7s;
}

.bg-bokeh-circle:nth-child(3) {
    width: 200px;
    height: 200px;
    background: var(--ph-mint);
    top: 50%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes bokehFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -20px); }
    66% { transform: translate(-20px, 30px); }
}

/* --- Dot Pattern --- */
.bg-dots {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* ========================================
   Aurora Background
   ======================================== */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    will-change: transform;
}

.aurora-orb:nth-child(1) {
    width: 600px;
    height: 600px;
    top: -15%;
    left: -10%;
    background: radial-gradient(circle, rgba(92, 198, 195, 0.18) 0%, transparent 70%);
    filter: blur(60px);
    animation: auroraMove1 20s ease-in-out infinite;
}

.aurora-orb:nth-child(2) {
    width: 500px;
    height: 500px;
    top: 30%;
    right: -15%;
    background: radial-gradient(circle, rgba(139, 111, 168, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    animation: auroraMove2 25s ease-in-out infinite;
}

.aurora-orb:nth-child(3) {
    width: 450px;
    height: 450px;
    bottom: -10%;
    left: 30%;
    background: radial-gradient(circle, rgba(92, 198, 195, 0.12) 0%, transparent 70%);
    filter: blur(70px);
    animation: auroraMove3 22s ease-in-out infinite;
}

@keyframes auroraMove1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(80px, 40px) scale(1.1); }
    50% { transform: translate(30px, 80px) scale(0.95); }
    75% { transform: translate(-40px, 20px) scale(1.05); }
}

@keyframes auroraMove2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, -30px) scale(1.08); }
    66% { transform: translate(40px, 60px) scale(0.92); }
}

@keyframes auroraMove3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, -40px) rotate(5deg); }
    50% { transform: translate(-30px, -60px) rotate(-3deg); }
    75% { transform: translate(-60px, 20px) rotate(2deg); }
}

/* ========================================
   Floating Particles
   ======================================== */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    --drift: 0px;
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 6px 1px rgba(92, 198, 195, 0.3);
    animation: floatUp var(--dur, 12s) var(--delay, 0s) linear infinite;
    opacity: 0;
}

.particle:nth-child(1)  { left: 5%;  --dur: 14s; --delay: 0s;   --drift: 30px;  }
.particle:nth-child(2)  { left: 15%; --dur: 11s; --delay: 2s;   --drift: -20px; }
.particle:nth-child(3)  { left: 25%; --dur: 16s; --delay: 4s;   --drift: 40px;  }
.particle:nth-child(4)  { left: 35%; --dur: 13s; --delay: 1s;   --drift: -35px; }
.particle:nth-child(5)  { left: 45%; --dur: 15s; --delay: 3s;   --drift: 25px;  }
.particle:nth-child(6)  { left: 55%; --dur: 12s; --delay: 5s;   --drift: -15px; }
.particle:nth-child(7)  { left: 65%; --dur: 17s; --delay: 2.5s; --drift: 35px;  }
.particle:nth-child(8)  { left: 75%; --dur: 14s; --delay: 0.5s; --drift: -40px; }
.particle:nth-child(9)  { left: 85%; --dur: 11s; --delay: 3.5s; --drift: 20px;  }
.particle:nth-child(10) { left: 95%; --dur: 16s; --delay: 1.5s; --drift: -25px; }

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift));
        opacity: 0;
    }
}

/* ========================================
   Morphing Blob
   ======================================== */
.bg-blob {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(40px);
    opacity: 0.25;
    pointer-events: none;
    will-change: border-radius, transform;
}

.bg-blob--mint {
    background: var(--ph-mint);
    animation: blobMorph1 18s ease-in-out infinite;
}

.bg-blob--purple {
    background: var(--ph-purple);
    animation: blobMorph2 20s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(0deg) scale(1); }
    25% { border-radius: 58% 42% 36% 64% / 56% 28% 72% 44%; transform: rotate(45deg) scale(1.05); }
    50% { border-radius: 40% 60% 54% 46% / 62% 48% 52% 38%; transform: rotate(90deg) scale(0.95); }
    75% { border-radius: 64% 36% 42% 58% / 36% 68% 32% 64%; transform: rotate(135deg) scale(1.02); }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; transform: rotate(0deg) scale(1); }
    33% { border-radius: 42% 58% 64% 36% / 44% 56% 44% 56%; transform: rotate(-60deg) scale(1.08); }
    66% { border-radius: 56% 44% 38% 62% / 52% 38% 62% 48%; transform: rotate(-120deg) scale(0.94); }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .aurora-orb,
    .particle,
    .bg-blob,
    .bg-mesh::before,
    .bg-bokeh-circle {
        animation: none !important;
    }
    .particle {
        display: none;
    }
}

/* ========================================
   Grid Pattern Overlay
   ======================================== */
.bg-grid-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}
