/* STATES - The Industrial Body-State Engine Atom */

/* Morphism Overrides */
[data-morphism="neumorphic"] .rail,
[data-morphism="neumorphic"] .mobile-topbar,
[data-morphism="clay"] .rail,
[data-morphism="clay"] .mobile-topbar {
    background-color: var(--bg-1);
}

[data-morphism="neumorphic"] .panel,
[data-morphism="clay"] .panel {
    background-color: var(--bg-2);
}

/* Dependent Setting Visibility */
html:not([data-sound-effects="on"]) [data-dependent-on="sound_effects"] { display: none; }
html:not([data-glass="on"]) [data-dependent-on="glass"] { display: none; }
html:not([data-virtual-haptics="on"]) [data-dependent-on="virtual_haptics"] { display: none; }

/* Master Volume logic: Show if either sound effects or virtual haptics is ON */
[data-dependent-on="audio_active"] { display: none; }
html[data-sound-effects="on"] [data-dependent-on="audio_active"],
html[data-virtual-haptics="on"] [data-dependent-on="audio_active"] {
    display: flex;
}

/* --- Declarative Icon Toggling --- */

/* Theme Toggle: Sun for Light, Moon for Dark */
html[data-theme="light"] #theme-toggle .sun-icon { display: none; }
html:not([data-theme="light"]) #theme-toggle .moon-icon { display: none; }

/* View Toggle: Show Table icon when in List mode, and vice-versa */
html:not([data-view="table"]) #view-toggle .table-icon { display: none; }
html[data-view="table"] #view-toggle .list-icon { display: none; }

/* Isolated Selection Filtering */
html[data-filter-selected="on"] .row-item:not(:has(.row-item-checkbox:checked)) {
    display: none !important;
}
