/**
 * Cosmic Deep Space Background Widget - CSS
 * Palette:
 *  #00F0FF (Primary Cyan)
 *  #2EE6FF (Electric Cyan)
 *  #3A7BFF (Electric Blue)
 *  #7B3CFF (Electric Violet)
 *  #C03DFF (Pink Purple)
 *  #A8F3FF (Ice Cyan Glow)
 *  #0B1431 (Navy Background)
 *  #050913 (Deep Space Dark)
 */

/* Container wrapper */
.cap-cosmic-bg-wrap {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    pointer-events: none;
    user-select: none;
    background-color: #050913;
}

/* Fixed site mode: covers entire viewport behind all sections */
.cap-cosmic-bg-wrap.cap-mode-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--cap-bg-z-index, -1);
    overflow: hidden;
}

/* Section mode: covers current Elementor section/container */
.cap-cosmic-bg-wrap.cap-mode-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: var(--cap-bg-z-index, 0);
    overflow: hidden;
}

/* Ensure parent section handles absolute positioning gracefully */
.elementor-widget-cosmic_background_widget {
    pointer-events: none;
}
.elementor-widget-cosmic_background_widget .cap-cosmic-bg-wrap.cap-mode-section {
    position: absolute;
}

/* HTML5 Canvas */
.cap-cosmic-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Ambient Pulsing Nebulas */
.cap-cosmic-nebula {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.85;
    will-change: transform, opacity;
}

.cap-nebula-1 {
    animation: capNebulaPulse1 18s ease-in-out infinite alternate;
}

.cap-nebula-2 {
    animation: capNebulaPulse2 22s ease-in-out infinite alternate;
}

.cap-nebula-3 {
    animation: capNebulaPulse3 16s ease-in-out infinite alternate;
}

@keyframes capNebulaPulse1 {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15) translate(3%, -2%);
        opacity: 0.95;
    }
    100% {
        transform: scale(0.95) translate(-2%, 4%);
        opacity: 0.65;
    }
}

@keyframes capNebulaPulse2 {
    0% {
        transform: scale(1.1) translate(0, 0);
        opacity: 0.6;
    }
    50% {
        transform: scale(0.9) translate(-4%, 3%);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.2) translate(2%, -3%);
        opacity: 0.7;
    }
}

@keyframes capNebulaPulse3 {
    0% {
        transform: scale(0.95) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(-4deg);
        opacity: 0.55;
    }
}

/* Elementor Editor Badge */
.cap-cosmic-editor-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px;
    padding: 8px 16px;
    background: rgba(11, 20, 49, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 9999px;
    color: #A8F3FF;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
    pointer-events: auto;
    z-index: 10;
}

.cap-badge-icon {
    font-size: 14px;
}
