/**
 * NeuroCRM - Splash Page Styles (Minimal - Animation Only)
 */

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

body.splash-page {
    background: #000;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html,
body.splash-page {
    background: #000;
}

/* ============================================
   CONTAINER
   ============================================ */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CANVAS
   ============================================ */
#brain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ============================================
   STATIC FALLBACK (reduced motion)
   ============================================ */
.static-brain {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(ellipse at 35% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 65% 50%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(100, 100, 200, 0.15) 0%, transparent 70%);
    border-radius: 45% 45% 40% 40%;
    filter: blur(2px);
    z-index: 1;
}

/* ============================================
   TITLE (centered on brain)
   ============================================ */
.brain-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff 0%, #a0b0ff 50%, #c0a0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(102, 126, 234, 0.5);
}

/* ============================================
   ENTER BUTTON (bottom center)
   ============================================ */
.enter-button {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 16px 42px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 40px rgba(118, 75, 162, 0.2);
    animation: enterBtnPulse 3s ease-in-out infinite;
}

@keyframes enterBtnPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 40px rgba(118, 75, 162, 0.2);
        border-color: rgba(167, 139, 250, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.5), 0 0 60px rgba(118, 75, 162, 0.35), 0 0 80px rgba(167, 139, 250, 0.2);
        border-color: rgba(167, 139, 250, 0.6);
    }
}

.enter-button:hover {
    color: white;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.6), 0 0 80px rgba(118, 75, 162, 0.4), 0 0 100px rgba(167, 139, 250, 0.25);
    transform: translateX(-50%) scale(1.05);
    animation: none;
}

.enter-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.enter-button:active {
    transform: translateX(-50%) scale(0.98);
}

/* ============================================
   VIGNETTE OVERLAY
   ============================================ */
.vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* ============================================
   EXIT TRANSITION
   ============================================ */
.splash-container.is-leaving .vignette-overlay {
    opacity: 1;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 50%, #000 100%);
}

.splash-container.is-leaving .brain-title {
    animation: fadeOutTitle 0.5s ease forwards;
}

.splash-container.is-leaving .enter-button {
    pointer-events: none;
    animation: fadeOutBtn 0.5s ease forwards;
}

@keyframes fadeOutTitle {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

@keyframes fadeOutBtn {
    to {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

.splash-container.is-leaving {
    animation: finalFade 0.3s ease 0.8s forwards;
}

@keyframes finalFade {
    to {
        opacity: 0;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .enter-button {
        transition: none;
    }

    .splash-container.is-leaving .enter-button {
        animation: simpleFade 0.5s ease forwards;
    }

    @keyframes simpleFade {
        to { opacity: 0; }
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .brain-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
        letter-spacing: 0.1em;
    }

    .enter-button {
        bottom: 40px;
        padding: 14px 32px;
        font-size: 0.95rem;
    }

    .static-brain {
        width: 280px;
        height: 280px;
    }
}

/* ============================================
   MOBILE TOUCH OPTIMIZATION
   ============================================ */
@media (hover: none) {
    .enter-button:hover {
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.08);
    }

    .enter-button:active {
        transform: translateX(-50%) scale(0.9);
        background: rgba(102, 126, 234, 0.3);
    }
}
