/* Room specific styles */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 1rem;
}

.device-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variant-dimmer {
    grid-column: span 5;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.control-group {
    margin-top: 0.5rem;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.toggle-switch {
    width: 36px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch.active {
    background-color: var(--accent-color);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    left: 2px;
    transform: translateX(18px);
}

.toggle-switch.is-loading {
    opacity: 0.7;
    pointer-events: none;
    animation: toggle-pulse 1.5s infinite ease-in-out;
}

@keyframes toggle-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        opacity: 0.4;
    }

    100% {
        transform: scale(1);
    }
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text-primary);
}

/* KPI Cards for Rooms */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    grid-column: span 5;
    padding: 1.25rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}