/**************************************************************
 * GLOW.CSS (Effects Engine)
 * Defines the Neon Glow visual layer (.tt-glow & .tt-halo).
 **************************************************************/

#texttiles-widget .tt-glow {
    position: absolute;
    top: var(--amb-y);
    left: var(--amb-x);
    transform: translate(-50%, -50%);
    width: var(--amb-spread);
    height: 80px;
    background: radial-gradient(ellipse at center, rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), var(--amb-opac)) 0%, rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 0.1) 40%, transparent 70%);
    filter: blur(var(--amb-blur));
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}

#texttiles-widget .tt-halo {
    position: absolute;
    top: var(--ring-y);
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--ring-w);
    height: var(--ring-h);
    border: var(--ring-thick) solid rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 0.9);
    border-radius: 50%;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
    /* Apply max box-shadow statically so we don't have to recalculate it every frame */
    box-shadow: 0 0 var(--max-tight) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 1), 
                inset 0 0 var(--max-tight) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 1), 
                0 0 var(--max-wide) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), var(--max-opac));
    animation: pulseGlow var(--pulse-speed) ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
}

/* Glow Engine Disabled State */
#texttiles-widget.glow-disabled .tt-glow,
#texttiles-widget.glow-disabled .tt-halo {
    display: none !important;
}

/* Glow Lab Mode Isolation */
#texttiles-widget.glow-lab-mode .tt-top,
#texttiles-widget.glow-lab-mode .tt-bottom,
#texttiles-widget.glow-lab-mode .tt-bottom-grad,
#texttiles-widget.glow-lab-mode .tt-text,
#texttiles-widget.glow-lab-mode .tt-media-frame,
#texttiles-widget.glow-lab-mode .tt-placeholder {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s;
}

#texttiles-widget .tt-glow,
#texttiles-widget .tt-halo {
    transition: opacity 0.3s;
}

/* Mode: Ambient Only */
#texttiles-widget.layer-ambient .tt-halo {
    opacity: 0 !important;
}

/* Mode: Ring Only */
#texttiles-widget.layer-ring .tt-glow {
    opacity: 0 !important;
}

#texttiles-widget.layer-ring .tt-halo {
    animation: none !important;
    box-shadow: none !important;
    border-color: rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 0.9) !important;
}

/* Mode: Bloom Only */
#texttiles-widget.layer-bloom .tt-glow {
    opacity: 0 !important;
}

#texttiles-widget.layer-bloom .tt-halo {
    animation: none !important;
    border-color: transparent !important;
    box-shadow: 0 0 var(--max-tight) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 1), inset 0 0 var(--max-tight) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), 1), 0 0 var(--max-wide) rgba(var(--slide-highlight-rgb, var(--widget-accent-rgb)), var(--max-opac)) !important;
}
