/* ============================================================================
   COSMIC FLOCKING BOIDS - FULL PAGE IMMERSIVE EXPERIENCE
   Unearthly, galaxy-like aesthetic with glass morphism UI
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================================
   COSMIC BACKGROUND - Deep space with nebula effects and animated stars
   ============================================================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #000000;

    /* Deep space gradient background */
    background: radial-gradient(ellipse at 20% 50%, rgba(50, 20, 80, 0.8) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 30%, rgba(20, 40, 80, 0.6) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(80, 30, 60, 0.5) 0%, transparent 50%),
                linear-gradient(135deg, #0a0015 0%, #1a0033 25%, #0d001a 50%, #1a0033 75%, #0a0015 100%);

    background-attachment: fixed;
}

/* Large nebula clouds moving slowly */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(ellipse 800px 400px at 10% 20%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 600px 300px at 60% 70%, rgba(100, 150, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 700px 350px at 80% 10%, rgba(200, 100, 255, 0.08) 0%, transparent 50%);
    animation: nebulaDrift 60s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes nebulaDrift {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(50px) translateY(-30px);
    }
}

/* Animated stars and particles */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(220, 200, 255, 0.9), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(150, 200, 255, 0.8), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 50%, rgba(200, 200, 255, 0.85), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 150, 200, 0.75), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 30% 60%, rgba(150, 220, 255, 0.7), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 90% 50%, rgba(200, 150, 255, 0.8), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 15% 80%, rgba(180, 200, 255, 0.75), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 75% 75%, rgba(220, 190, 255, 0.8), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 45% 15%, rgba(150, 180, 255, 0.85), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 70% 40%, rgba(200, 180, 255, 0.7), rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 200px 200px, 250px 250px, 300px 300px, 200px 200px, 280px 280px, 250px 250px, 220px 220px, 280px 280px, 240px 240px, 210px 210px;
    animation: twinkleCosmic 8s ease-in-out infinite, starShimmer 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes twinkleCosmic {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

@keyframes starShimmer {
    0%, 100% {
        filter: brightness(0.8);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* ============================================================================
   COSMIC TITLE - Large, bold, floating with glass effect on text only
   ============================================================================ */

.title-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90vw;
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

.cosmic-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 5vw;
    font-weight: 900;
    font-stretch: expanded;
    letter-spacing: -0.02em;
    color: #e0d5ff;

    /* Glass morphism effect on text only */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(200, 150, 255, 0.25);
    border-radius: 25px;
    padding: 25px 50px;
    display: inline-block;
    white-space: nowrap;

    /* Subtle glow on text */
    text-shadow:
        0 0 20px rgba(138, 43, 226, 0.7),
        0 0 40px rgba(138, 43, 226, 0.4),
        0 0 60px rgba(100, 150, 255, 0.25);

    /* Glow on container */
    box-shadow:
        inset 0 0 25px rgba(200, 150, 255, 0.15),
        0 0 40px rgba(138, 43, 226, 0.25),
        0 0 80px rgba(100, 150, 255, 0.1);

    animation: cosmicPulse 4s ease-in-out infinite;
}

@keyframes cosmicPulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(138, 43, 226, 0.7),
            0 0 40px rgba(138, 43, 226, 0.4),
            0 0 60px rgba(100, 150, 255, 0.25);
        box-shadow:
            inset 0 0 25px rgba(200, 150, 255, 0.15),
            0 0 40px rgba(138, 43, 226, 0.25),
            0 0 80px rgba(100, 150, 255, 0.1);
    }
    50% {
        text-shadow:
            0 0 30px rgba(138, 43, 226, 0.9),
            0 0 50px rgba(138, 43, 226, 0.6),
            0 0 80px rgba(100, 150, 255, 0.35);
        box-shadow:
            inset 0 0 30px rgba(200, 150, 255, 0.2),
            0 0 60px rgba(138, 43, 226, 0.4),
            0 0 100px rgba(100, 150, 255, 0.15);
    }
}

/* ============================================================================
   CANVAS CONTAINER - Full screen
   ============================================================================ */

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ============================================================================
   FLOATING GLASS CONTROL PANEL - Bottom with glass morphism
   ============================================================================ */

.control-panel {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    padding: 25px 35px;
    z-index: 200;

    /* Glass morphism effect */
    background: rgba(15, 15, 30, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 20px;

    /* Subtle glow */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(138, 43, 226, 0.05);

    /* Grid layout for sliders */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-weight: 700;
    color: #d8d8ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.9;
}

/* ============================================================================
   SLIDER STYLING - Cosmic vibes
   ============================================================================ */

.slider {
    width: 100%;
    height: 6px;
    background: rgba(138, 43, 226, 0.2);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

/* Webkit browsers (Chrome, Safari, Edge) */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #8a2be2 0%, #6a0dad 100%);
    border: 2px solid rgba(200, 150, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 0 10px rgba(138, 43, 226, 0.8),
        0 0 20px rgba(138, 43, 226, 0.4);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow:
        0 0 15px rgba(138, 43, 226, 1),
        0 0 30px rgba(138, 43, 226, 0.6);
}

/* Firefox */
.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #8a2be2 0%, #6a0dad 100%);
    border: 2px solid rgba(200, 150, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 0 10px rgba(138, 43, 226, 0.8),
        0 0 20px rgba(138, 43, 226, 0.4);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.25);
    box-shadow:
        0 0 15px rgba(138, 43, 226, 1),
        0 0 30px rgba(138, 43, 226, 0.6);
}

.slider::-moz-range-track {
    background: transparent;
    border: none;
}

/* ============================================================================
   VALUE DISPLAY
   ============================================================================ */

.control-group span {
    font-size: 11px;
    color: #b08aff;
    font-weight: 600;
    text-align: center;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

/* ============================================================================
   FOCUS STATES & ACCESSIBILITY
   ============================================================================ */

.slider:focus {
    outline: 2px solid rgba(138, 43, 226, 0.5);
    outline-offset: 2px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1200px) {
    .control-panel {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        padding: 20px 25px;
    }

    .cosmic-title {
        font-size: 4vw;
        padding: 15px 30px;
    }
}

@media (max-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 15px 20px;
        bottom: 15px;
        width: 95%;
    }

    .cosmic-title {
        font-size: 3vw;
        padding: 10px 20px;
        top: 20px;
    }

    label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .control-panel {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 15px;
    }

    .cosmic-title {
        font-size: 2.5vw;
        padding: 8px 15px;
    }
}
