/* 7.6 Theme Switcher */
.ka_thmSwtchr {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 4px;
    background: var(--n3d-clr-surf-8);
    padding: 8px;
    border-radius: var(--n3d-radius-xl);
    box-shadow: var(--n3d-shadow-lg);
    border: 1px solid var(--n3d-brdr-clr-def);
    z-index: 90;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display:none;visibility: hidden;
}


.ka_thmSwtchr button {
    background: transparent;
    border: none;
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: var(--n3d-radius-base);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--n3d-trans-fast);
    position: relative;
    overflow: hidden;
}

.ka_thmSwtchr button:hover {
    background: var(--n3d-brdr-clr-hov);
    transform: scale(1.1);
}

.ka_thmSwtchr button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ka_thmSwtchr button:active {
    transform: scale(0.95);
}

.ka_thmSwtchr button:active::before {
    width: 100px;
    height: 100px;
}

.ka_thmSwtchr button:focus-visible {
    outline: 2px solid var(--n3d-clr-ui-p);
    outline-offset: 2px;
}

/* Pulse animation when theme is changed */
.ka_thmSwtchr button.theme-changing {
    animation: themePulse 0.6s ease-out;
}

/* Active theme indicator */
[data-theme="sunrise"] .ka_thmSwtchr button[title="Light Mode"],
[data-theme="skynight"] .ka_thmSwtchr button[title="Dark Mode"],
[data-theme="auto"] .ka_thmSwtchr button[title="Auto Mode"] {
    background: var(--n3d-clr-ui-p);
    color: white;
}

/* ================================
   THEME TRANSITIONS EFFECTS
===================================*/

/* Efecto LED para SUNRISE */
[data-theme="sunrise"] .ndrs3d-theme-flash {
    background-color: rgba(218, 199, 255, 0.075);
    animation: ledFlashLight 1s ease-out;
}

/* Animación LED - SUNRISE */
@keyframes ledFlashLight {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    30% {
        opacity: 0.3;
    }
    45% {
        opacity: 1;
    }
    60% {
        opacity: 0.4;
    }
    75% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

/* Efecto LED para SKYNIGHT */
[data-theme="skynight"] .ndrs3d-theme-flash {
    background-color: rgba(199, 240, 255, 0.132);
    animation: ledFlashDark 0.8s ease-out;
}

/* Animación LED - SKYNIGHT */
@keyframes ledFlashDark {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    30% {
        opacity: 0.2;
    }
    45% {
        opacity: 0.9;
    }
    60% {
        opacity: 0.3;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

/* Efecto LED para AUTO */
[data-theme="auto"] .ndrs3d-theme-flash {
    background-color: rgba(199, 240, 255, 0.132);
    animation: ledFlashAuto 0.8s ease-out;
}

/* Animación LED - AUTO */
@keyframes ledFlashAuto {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    30% {
        opacity: 0.2;
    }
    45% {
        opacity: 0.9;
    }
    60% {
        opacity: 0.3;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

/* Animación del botón que activa el cambio */
.theme-changing {
    animation: buttonScale 0.3s ease-out;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* ============================================
   SISTEMA DE TRANSICIONES OPTIMIZADO
   ============================================ */

/* 
*
*
*
*   THEME-SPECIFIC STYLES
*
*
*
*/

/* =======================
   🌅 SUNRISE THEME SPECIFIC
   ======================= */
[data-theme="sunrise"] #n3d-backdrop-shoot-stars-container {
  opacity: 0 !important;
  display: none;
}

[data-theme="sunrise"] #n3d-gridLinesFadeStops-canvas {
  opacity: 1 !important;
}


/* ===========================
   🌌 SKYNIGHT THEME SPECIFIC  
   =========================== */
[data-theme="skynight"] #n3d-backdrop-shoot-stars-container {
    opacity: 1;
}
[data-theme="skynight"] #n3d-gridLinesFadeStops-canvas {
  opacity: 0 !important;
  display: none;
}

/* ============================================
   AUTO THEME SPECIFIC
   ============================================ */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] #n3d-backdrop-shoot-stars-container {
        opacity: 1;
    }
    [data-theme="auto"] #n3d-gridLinesFadeStops-canvas {
        opacity: 0;
    }
}

@media (prefers-color-scheme: light) {
    [data-theme="auto"] #n3d-backdrop-shoot-stars-container {
        opacity: 0;
    }
    [data-theme="auto"] #n3d-gridLinesFadeStops-canvas {
        opacity: 1;
    }
}

/* ============================================
   CONDITIONAL ELEMENTS BY THEME
   ============================================ */

/* Mostrar solo en sunrise */
[data-theme="sunrise"] .th-sunrise-only {
  display: block;
}
[data-theme="skynight"] .th-sunrise-only,
[data-theme="auto"] .th-sunrise-only {
  display: none;
}

/* Mostrar solo en skynight */
[data-theme="skynight"] .th-skynight-only {
  display: block;
}
[data-theme="sunrise"] .th-skynight-only,
[data-theme="auto"] .th-skynight-only {
  display: none;
}

/* Mostrar sólo en Auto */
[data-theme="auto"] .th-auto-only {
  display: block;
}
[data-theme="sunrise"] .th-auto-only,
[data-theme="skynight"] .th-auto-only {
  display: none;
}