/* ================================================
   Theme Transition: Ripple & Pop Effect
   ================================================ */

/* Overlay Container - Covers entire screen */
.theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    visibility: hidden;
    /* Hidden by default */
    opacity: 0;
    /* Ensure it's fully transparent when hidden */
    transition: none;
    /* No transition by default to prevent cleanup flashes */
}

.theme-transition-overlay.active {
    visibility: visible;
    pointer-events: all;
    opacity: 1;
}

/* Prevent ghosting: Disable transitions when overlay is not active */
.theme-transition-overlay:not(.active) * {
    transition: none !important;
    animation: none !important;
    opacity: 0 !important;
}

/* The Ripple Circle (The Background) */
.transition-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 150vmax;
    /* Ensure it covers corners */
    height: 150vmax;
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Colors for Ripple */
.theme-transition-overlay.to-light .transition-ripple {
    background-color: #fff;
    /* Light circle expanding */
}

.theme-transition-overlay.to-dark .transition-ripple {
    background-color: #111;
    /* Dark circle expanding */
}

/* The Lightbulb Container */
.transition-bulb {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy pop */
}

/* Bulb Icon (SVG) */
.transition-bulb svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Bulb Colors */
.theme-transition-overlay.to-light .transition-bulb {
    color: #333;
    /* Dark bulb on light ripple */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
}

.theme-transition-overlay.to-dark .transition-bulb {
    color: #fff;
    /* White bulb on dark ripple */
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

/* Animation States */

/* 1. Pop In */
.theme-transition-overlay.pop-in .transition-bulb {
    opacity: 1;
    transform: scale(1);
}

/* 2. Expand Ripple */
.theme-transition-overlay.expanding .transition-ripple {
    transform: translate(-50%, -50%) scale(1);
}

/* 3. Fade Out Overlay */
.theme-transition-overlay.fading-out {
    opacity: 0;
    transition: opacity 0.8s ease !important;
}

/* Accessibility */

/* ===========================================
   RESPONSIVE BREAKPOINTS
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    .theme-transition-overlay {
        display: none !important;
    }
}