/* 🌌 HYPNOTIC.CSS – The Most Beautiful, Hypnotic Website on the Internet
 * Cosmic Workshop visual enchantment layer
 * Pulsing with 66‑band resonance, flowing gradients, parallax depth
 */

/* ============================================================================
   1. COSMIC PULSE – 0.66Hz Heartbeat (66 Bands)
   ============================================================================ */

@keyframes cosmic-pulse {
    0%, 100% { 
        opacity: 0.8;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes wavelength-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes celestial-orbit {
    0% { transform: rotate(0deg) translateX(150px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(150px) rotate(-360deg); }
}

@keyframes breathing-glow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(79, 195, 247, 0.3),
            0 0 40px rgba(168, 85, 247, 0.2),
            0 0 60px rgba(38, 162, 105, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(79, 195, 247, 0.5),
            0 0 80px rgba(168, 85, 247, 0.3),
            0 0 120px rgba(38, 162, 105, 0.2);
    }
}

/* ============================================================================
   2. LAYERED PARALLAX COSMOS
   ============================================================================ */

/* Base cosmic background */
.cosmic-parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 30%, rgba(79, 195, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(38, 162, 105, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a1a 0%, #1a0033 100%);
    animation: wavelength-flow 60s ease-in-out infinite;
    background-size: 400% 400%;
}

/* Nebula particle layer */
.particle-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle-float 15s infinite linear;
}

.particle:nth-child(2n) {
    width: 1px;
    height: 1px;
    animation-duration: 20s;
    animation-delay: -5s;
}

.particle:nth-child(3n) {
    width: 3px;
    height: 3px;
    animation-duration: 25s;
    animation-delay: -10s;
}

/* Foreground UI layer */
body {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================================
   3. HYPNOTIC TRANSITIONS & INTERACTIONS
   ============================================================================ */

/* Page transition overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--cosmic-purple), var(--cosmic-teal));
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    opacity: 1;
}

/* Harmonic wave on click/tap */
.wave-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.3) 0%, transparent 70%);
    transform: scale(0);
    pointer-events: none;
    z-index: 100;
}

.wave-ripple.active {
    animation: ripple-expand 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ripple-expand {
    0% { transform: scale(0); opacity: 0.8; }
    100% { transform: scale(4); opacity: 0; }
}

/* Breathing focus elements */
.breathing-element {
    animation: breathing-glow 4s ease-in-out infinite;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover wave emission */
.hover-wave {
    position: relative;
    overflow: hidden;
}

.hover-wave::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hover-wave:hover::after {
    width: 300px;
    height: 300px;
}

/* ============================================================================
   4. DYNAMIC COLOR HARMONICS
   ============================================================================ */

/* Celestial hour theme system */
.celestial-theme-mercury {
    --cosmic-primary-h: 200;
    --cosmic-primary-s: 80%;
    --cosmic-primary-l: 60%;
    --theme-accent: hsl(200, 80%, 60%);
}

.celestial-theme-venus {
    --cosmic-primary-h: 330;
    --cosmic-primary-s: 70%;
    --cosmic-primary-l: 60%;
    --theme-accent: hsl(330, 70%, 60%);
}

.celestial-theme-mars {
    --cosmic-primary-h: 10;
    --cosmic-primary-s: 80%;
    --cosmic-primary-l: 55%;
    --theme-accent: hsl(10, 80%, 55%);
}

.celestial-theme-jupiter {
    --cosmic-primary-h: 45;
    --cosmic-primary-s: 90%;
    --cosmic-primary-l: 60%;
    --theme-accent: hsl(45, 90%, 60%);
}

/* Real‑time wavelength color adjustment */
.wavelength-responsive {
    transition: 
        background-color 3s ease,
        border-color 3s ease,
        box-shadow 3s ease;
}

/* Band‑dominance indicators */
.band-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 2px;
    animation: cosmic-pulse 2s infinite;
    animation-delay: calc(var(--band-index) * -0.2s);
}

.band-indicator.band-1 { background: hsl(0, 70%, 50%); }
.band-indicator.band-12 { background: hsl(60, 70%, 50%); }
.band-indicator.band-24 { background: hsl(130, 70%, 50%); }
.band-indicator.band-33 { background: hsl(180, 70%, 50%); }
.band-indicator.band-45 { background: hsl(245, 70%, 50%); }
.band-indicator.band-66 { background: hsl(330, 70%, 50%); }

/* ============================================================================
   5. ENHANCED UI COMPONENTS
   ============================================================================ */

/* Hypnotic cards */
.hypnotic-card {
    background: rgba(30, 30, 60, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 100, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cosmic-pulse 6s infinite;
}

.hypnotic-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(79, 195, 247, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(30deg);
    animation: wavelength-flow 20s infinite linear;
    z-index: -1;
}

.hypnotic-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--cosmic-teal);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(79, 195, 247, 0.3);
}

/* Animated buttons */
.hypnotic-btn {
    background: linear-gradient(90deg, 
        var(--cosmic-blue), 
        var(--cosmic-purple), 
        var(--cosmic-teal)
    );
    background-size: 300% 100%;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s;
    animation: wavelength-flow 8s infinite linear;
}

.hypnotic-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 10px 25px rgba(145, 65, 172, 0.4),
        0 0 40px rgba(79, 195, 247, 0.3);
}

.hypnotic-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Flowing gradient headers */
.hypnotic-header {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(
        90deg,
        var(--cosmic-blue),
        var(--cosmic-purple),
        var(--cosmic-teal),
        var(--cosmic-success),
        var(--cosmic-blue)
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wavelength-flow 15s infinite linear;
    text-shadow: 0 0 40px rgba(79, 195, 247, 0.3);
    margin-bottom: 1rem;
}

/* ============================================================================
   6. WAVELENGTH VISUALIZATION
   ============================================================================ */

/* Real‑time 66‑band spectrum visualizer */
.wavelength-spectrum {
    display: flex;
    height: 100px;
    align-items: flex-end;
    gap: 1px;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0, 0, 20, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

.spectrum-bar {
    flex: 1;
    background: linear-gradient(to top, 
        var(--cosmic-blue),
        var(--cosmic-purple)
    );
    border-radius: 2px 2px 0 0;
    min-height: 1px;
    animation: spectrum-pulse 3s infinite;
    animation-delay: calc(var(--band-index) * 0.05s);
}

@keyframes spectrum-pulse {
    0%, 100% { height: var(--base-height); }
    50% { height: calc(var(--base-height) * 1.5); }
}

/* Orbiting planets (celestial transformers) */
.celestial-orbit-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 3rem auto;
}

.orbiting-planet {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border-radius: 50%;
    animation: celestial-orbit 20s infinite linear;
    animation-delay: calc(var(--planet-index) * -2s);
}

.orbiting-planet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================================
   7. RESPONSIVE & ACCESSIBILITY
   ============================================================================ */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hypnotic-card,
    .hypnotic-btn,
    .hypnotic-header,
    .particle,
    .band-indicator,
    .spectrum-bar,
    .orbiting-planet,
    .hover-wave::after,
    .wave-ripple {
        animation: none !important;
        transition: none !important;
    }
    
    .cosmic-parallax-bg {
        animation: none;
        background: #0a0a1a;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .hypnotic-header {
        font-size: 2.5rem;
    }
    
    .celestial-orbit-container {
        width: 300px;
        height: 300px;
    }
    
    .wavelength-spectrum {
        height: 60px;
    }
}

/* Dark mode enhancement */
@media (prefers-color-scheme: dark) {
    .hypnotic-card {
        background: rgba(20, 20, 40, 0.8);
    }
    
    .cosmic-parallax-bg {
        background: 
            radial-gradient(circle at 20% 30%, rgba(79, 195, 247, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.05) 0%, transparent 50%),
            linear-gradient(135deg, #050510 0%, #0f0022 100%);
    }
}

/* ============================================================================
   8. INITIALIZATION SCRIPT (to be added to base.html)
   ============================================================================ */

/*
<script>
// Initialize hypnotic effects
document.addEventListener('DOMContentLoaded', function() {
    // Create particle layer
    const particleLayer = document.createElement('div');
    particleLayer.className = 'particle-layer';
    for (let i = 0; i < 100; i++) {
        const particle = document.createElement('div');
        particle.className = 'particle';
        particle.style.left = `${Math.random() * 100}%`;
        particle.style.top = `${Math.random() * 100}%`;
        particle.style.animationDelay = `${Math.random() * -20}s`;
        particleLayer.appendChild(particle);
    }
    document.body.appendChild(particleLayer);
    
    // Create parallax background
    const parallaxBg = document.createElement('div');
    parallaxBg.className = 'cosmic-parallax-bg';
    document.body.insertBefore(parallaxBg, document.body.firstChild);
    
    // Click ripple effect
    document.addEventListener('click', function(e) {
        const ripple = document.createElement('div');
        ripple.className = 'wave-ripple';
        ripple.style.left = `${e.clientX}px`;
        ripple.style.top = `${e.clientY}px`;
        document.body.appendChild(ripple);
        setTimeout(() => ripple.classList.add('active'), 10);
        setTimeout(() => ripple.remove(), 1600);
    });
    
    // Set celestial theme based on hour
    const hour = new Date().getHours();
    const themes = ['mercury', 'venus', 'mars', 'jupiter'];
    const themeIndex = hour % 4;
    document.body.classList.add(`celestial-theme-${themes[themeIndex]}`);
});
</script>
*/