/* === SUBCARPETA AISLADA v2.2.3: CONMUTADOR EJECUTIVO SOL Y LUNA (LADO IZQUIERDO) === */

.topbar-left-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title-divider {
    width: 1px;
    height: 22px;
    background: var(--border-soft);
    flex-shrink: 0;
}

.idv-theme-switch {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 72px;
    height: 36px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid #B5DAF0;
    background: linear-gradient(180deg, #DFEFFA 0%, #EFF7FC 100%);
    box-shadow: inset 0 1px 3px rgba(10, 37, 64, 0.09), 0 3px 10px rgba(15, 62, 110, 0.07);
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    user-select: none;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.22s ease, transform 0.14s ease;
}

.idv-theme-switch:hover {
    border-color: #22C7D6;
    box-shadow: inset 0 1px 3px rgba(10, 37, 64, 0.08), 0 4px 14px rgba(34, 199, 214, 0.22);
}

.idv-theme-switch:active {
    transform: scale(0.96);
}

/* Pastilla deslizante interior */
.idv-theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 32px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFBEB 100%);
    box-shadow: 0 2px 7px rgba(15, 62, 110, 0.18), 0 0 0 1px rgba(245, 158, 11, 0.30);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.idv-theme-slot {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.24s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.idv-svg-sun,
.idv-svg-moon {
    width: 17px;
    height: 17px;
    display: block;
}

/* Estado Modo Claro Activo (Sol iluminado a la izquierda, Luna discreta a la derecha) */
.idv-slot-sun {
    color: #EA8806;
    transform: scale(1.06) rotate(0deg);
}
.idv-slot-sun .sun-core {
    fill: rgba(245, 158, 11, 0.24);
}
.idv-theme-switch:hover .idv-slot-sun {
    transform: scale(1.08) rotate(18deg);
}

.idv-slot-moon {
    color: #557796;
    opacity: 0.78;
}
.idv-slot-moon .moon-body {
    fill: transparent;
}

/* Estado Modo Oscuro Activo (Pastilla desliza a la derecha e ilumina la Luna en Turquesa ideviOS) */
body.dark-mode .idv-theme-switch {
    background: linear-gradient(180deg, #051324 0%, #0A213C 100%);
    border-color: rgba(60, 226, 236, 0.40);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.60), 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .idv-theme-switch:hover {
    border-color: #53EEF9;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.55), 0 0 15px rgba(60, 226, 236, 0.28);
}

body.dark-mode .idv-theme-thumb {
    transform: translateX(32px);
    background: linear-gradient(145deg, #123E6E 0%, #0B2849 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 10px rgba(60, 226, 236, 0.26), inset 0 0 0 1px rgba(60, 226, 236, 0.48);
}

body.dark-mode .idv-slot-sun {
    color: #6D90B2;
    opacity: 0.75;
    transform: scale(0.94);
}
body.dark-mode .idv-slot-sun .sun-core {
    fill: transparent;
}

body.dark-mode .idv-slot-moon {
    color: #3CE2EC;
    opacity: 1;
    transform: scale(1.06) rotate(-8deg);
    filter: drop-shadow(0 0 5px rgba(60, 226, 236, 0.42));
}
body.dark-mode .idv-slot-moon .moon-body {
    fill: rgba(60, 226, 236, 0.22);
}

@media (max-width: 600px) {
    .topbar-left-cluster {
        gap: 8px;
    }
    .topbar-title-divider {
        display: none;
    }
    .idv-theme-switch {
        width: 64px;
        height: 32px;
        padding: 2px;
    }
    .idv-theme-thumb,
    .idv-theme-slot {
        top: 2px;
        width: 29px;
        height: 26px;
    }
    .idv-theme-slot {
        top: 0;
    }
    body.dark-mode .idv-theme-thumb {
        transform: translateX(29px);
    }
    .idv-svg-sun,
    .idv-svg-moon {
        width: 15px;
        height: 15px;
    }
}
