/*
#customizeModal.modal {
    position: fixed;
    top: 0px;
    right: 0px;
    margin: min(5%, 20px);
    box-sizing: border-box;
    overflow: auto;
    display: block;
    left: auto;
    bottom: auto;
    transform-origin: top right;
    transform: translateX(0) translateY(-50%) scale(0.9) scaleY(0.8) scaleX(0.5);
    opacity: 0;
    filter: blur(5px);
    width: clamp(280px, 90%, 500px);
    z-index: 9999 !important;
    border-radius: 50px;
    background: var(--search-background);
    backdrop-filter: var(--edge-refraction-filter) saturate(2) blur(5px);
    box-shadow: var(--sun-shadow), 0 0 50px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 18px 20px 22px 20px;
    corner-shape: superellipse(1.5);
    scrollbar-width: none;
}

#customizeModal.modal::-webkit-scrollbar {
    display: none;
}

#customizeModal.modal.show {
    transform: scale(1);
    opacity: 1;
    filter: none;
}
*/

#blurOverlayControls {
    z-index: 9996;
    background: var(--overlay-color);
    backdrop-filter: blur(50px);
}

.controls-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-between;
    margin-left: 10px;
}

.btn-qc {
    background-color: var(--overlay-color);
    color: var(--text-color);
    backdrop-filter: var(--edge-refraction-filter) saturate(2) blur(2.5px);
    box-shadow: var(--sun-shadow);
    border-radius: 32px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 32px;
    height: 32px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter';
}

.controls-container .btn-qc {
    backdrop-filter: none;
    background-color: var(--search-background);
}

.status-qc {
    display: flex;
    align-items: center;
}

#customizeModal.modal {
    position: fixed;
    top: 0px;
    left: 0px;
    margin: 0;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    justify-content: center;
    left: auto;
    bottom: auto;
    transform: scale(1.2);
    opacity: 0;
    filter: blur(5px);
    width: 100%;
    height: 100%;
    min-width: 100%;
    max-width: 100%;
    max-height: 100%;
    z-index: 9999 !important;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    scrollbar-width: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

#customizeModal.modal::-webkit-scrollbar {
    display: none;
}

#customizeModal.modal.show {
    transform: scale(1);
    opacity: 1;
    filter: none;
}

/* --- Split View for Customize Modal --- */
.modal-split-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: auto;
    padding: 20px 20px 80px 20px;
    overflow-x: hidden;
}

.modal-left-pane, .modal-right-pane {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

@media (min-width: 800px) {
    .modal-split-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 24px;
        width: 100%;
    }

    .modal-left-pane {
        flex: 1;
        min-width: 100px;
        max-width: 400px;
    }

    .modal-right-pane {
        flex: 1;
        min-width: 100px;
        max-width: 400px;
        position: sticky;
        top: 0;
        box-sizing: border-box;
        scrollbar-width: none;
    }

    .modal-right-pane::-webkit-scrollbar {
        display: none;
    }

    .modal-right-pane:has(.notification-shade:empty)::before {
        content: 'No notifications';
        display: flex;
        justify-content: center;
        align-items: center;
        flex-grow: 1;
        color: var(--secondary-text-color);
        font-weight: 500;
        font-family: 'Open Runde', 'Inter', sans-serif;
        font-size: 1.1rem;
        opacity: 0.7;
    }
}

.cust-label {
    display: inline-flex;
    align-items: center;
    /* Align text and icon vertically */
    gap: 15px;
    /* Space between text and icon */
    text-shadow: 0 0 4px var(--search-background);
}

/* Brightness Control Styles */
.qc-sliders {
    display: flex;
    gap: 3px;
    flex-direction: column;
}

.brightness-slider-container,
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    padding-left: 10px;
    border: 1px solid var(--glass-border);
    background: var(--search-background);
    box-shadow: var(--sun-shadow);
    border-radius: 20px;
    corner-shape: superellipse(1.5);
    transition: background-color 0.2s, transform 0.1s;
}

.brightness-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 34px;
    background: none;
    padding-right: 8px;
    outline: none;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 34px;
    background: none;
    outline: none;
}

.brightness-slider::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    box-shadow: var(--sun-shadow);
    transition: width 0.3s, height 0.3s, transform 0.3s;
}

.brightness-slider::-webkit-slider-thumb:active,
.volume-slider::-webkit-slider-thumb:active {
    width: 24px;
    height: 24px;
    transform: scale(1.1);
}

.brightness-slider::-moz-range-thumb,
.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    box-shadow: var(--sun-shadow);
    transition: width 0.3s, height 0.3s, transform 0.3s;
}

.brightness-slider::-moz-range-thumb:active,
.volume-slider::-moz-range-thumb:active {
    width: 24px;
    height: 24px;
    transform: scale(1.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
    border-bottom: 2px solid var(--transparent-color);
    border-radius: 0 !important;
    padding-bottom: 10px;
}

.settings-grid.system-settings {
    display: none;
    border-bottom: none;
    border-top: 2px solid var(--transparent-color);
    padding: 10px 0 0;
}

.settings-grid.home-settings {
    display: flex;
    flex-direction: column;
    padding: 0;
    backdrop-filter: none;
    background-color: transparent;
    border-top: 2px solid var(--transparent-color);
    border-bottom: none;
    box-shadow: none;
    padding-top: 10px;
}

.settings-grid.wallpaper-settings {
    border: none;
    padding-bottom: 0;
}

.setting-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
}

.setting-item .setting-icon-bg {
    transform: scale(1);
    transition: all 0.3s cubic-bezier(.2, 1.3, .64, 1);
    box-shadow: var(--sun-shadow);
}

.setting-item:active .setting-icon-bg {
    transform: scale(1.1);
    transition: all 0.3s cubic-bezier(.2, 1.3, .64, 1);
    filter: brightness(1.5);
}

.setting-item.active .setting-icon-bg {
    background-color: var(--accent);
    color: var(--background-color);
    border-radius: 35px;
    corner-shape: superellipse(1.5);
}

.setting-item.active .setting-icon-bg .material-symbols-rounded {
    color: var(--background-color);
}

.setting-item.active .setting-label {
    font-family: 'Open Runde';
    font-weight: 500;
}

.setting-icon-bg {
    justify-content: center;
    /* margin-bottom: 8px; */
    pointer-events: none;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--search-background);
    border-radius: 32px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, filter 0.1s;
    position: relative;
    min-height: 32px;
    height: 32px;
    box-shadow: var(--sun-shadow);
    border: 1px solid var(--glass-border);
    width: -webkit-fill-available;
}

.setting-label {
    font-size: 13px;
    font-weight: 400;
    pointer-events: none;
    line-height: 1.2;
    color: var(--text-color);
    transition: color 0.2s;
    word-break: break-word;
    text-shadow: 0 0 4px var(--search-background);
    margin-top: 10px;
}

.control-popup {
    display: none;
    position: fixed;
    z-index: 10001;
    min-width: 155px;
    max-width: calc(100vw - 40px); /* Leave room for margin */
    max-height: calc(100vh - 40px);
    overflow: visible; /* Ensure shadows aren't clipped */
}

.control-popup select,
.control-popup input {
    /* width: 100%; */
}

/* Smart Home Controls Styles */
.quick-controls {
    display: grid;
    /* Make above grid when in production */
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
}

.qcontrol-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--search-background);
    border-radius: 32px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, filter 0.1s;
    position: relative;
    min-height: 32px;
    height: 32px;
    box-shadow: var(--sun-shadow);
    border: 1px solid var(--glass-border);
}

.qcontrol-item:active {
    transform: scale(1.1);
    filter: brightness(1.5);
}

.qcontrol-item.active {
    background-color: var(--accent);
    color: var(--background-color);
    border-radius: 35px !important;
    corner-shape: superellipse(1.5);
}

.qcontrol-item.active .qc-label {
    font-family: 'Open Runde';
    font-weight: 500;
}

.qcontrol-item .material-symbols-rounded {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.qc-label {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 0;
}

#silent_switch_qc {
    grid-column: 1;
    grid-row: 1;
}

#temp_control_qc {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    justify-content: center;
}

#temp_control_qc .qc-label {
    display: none;
}

#night-mode-qc {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    justify-content: center;
}

#night_mode_qc .qc-label {
    display: none;
}

#thermostat-value {
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
}

#minimal_mode_qc {
    grid-column: 1;
    grid-row: 2;
}

#light_mode_qc {
    grid-column: 2;
    grid-row: 2;
}

.qc-switch {
    appearance: none;
    width: 50px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.qc-switch::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    transition: transform 0.3s;
}

.qc-switch:checked {
    background-color: #3c78d8;
}

.qc-switch:checked::before {
    transform: translateX(18px);
}

.thermostat-popup {
    display: none;
    position: absolute;
    z-index: 10000;
    border: 1px solid var(--glass-border);
    background-color: var(--modal-transparent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 35px;
    corner-shape: superellipse(1.5);
    padding: 15px;
    backdrop-filter: var(--edge-refraction-filter) saturate(2) blur(2.5px);
    box-shadow: var(--sun-shadow);
    width: 155px;
}

.thermostat-popup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 15px;
}

.thermostat-popup-header .material-symbols-rounded {
    margin-right: 10px;
}

.thermostat-popup-header span:nth-child(2) {
    flex-grow: 1;
}

.close-popup-btn {
    display: none !important;
    background: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thermostat-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.thermostat-slider {
    -webkit-appearance: none;
    width: 90%;
    height: 38px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    padding: 0 8px;
    border: 1px solid var(--glass-border);
}

.thermostat-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: width 0.3s, height 0.3s, transform 0.3s;
}

.thermostat-slider::-webkit-slider-thumb:active {
    width: 28px;
    height: 28px;
    transform: scale(1.1);
}

.thermostat-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: width 0.3s, height 0.3s, transform 0.3s;
}

.thermostat-slider::-moz-range-thumb:active {
    width: 28px;
    height: 28px;
    transform: scale(1.1);
}

#thermostat-popup-value {
    font-size: 24px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* Ensure all items take up the same space in the grid */
#smart-home-lights,
#smart-home-thermostat,
#smart-home-security,
#smart-home-camera {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.version-info,
.campaign-info,
#app-management-info,
.controls-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    transition: background-color 0.2s, transform 0.1s;
    border: 1px solid var(--glass-border);
    box-shadow: var(--sun-shadow);
    background-color: var(--background-color);
    border-radius: 32px;
    position: fixed;
    bottom: 25px;
    gap: 18px;
}