/* Sensor display styling */
#sensor-display {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

.sensor-card {
    background-color: var(--sensor-card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px var(--shadow-color);
    width: 45%;
    max-width: 300px;
}

.sensor-card h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--text-color);
    font-size: 1.4rem;
}

.room-readings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sensor-reading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    background-color: var(--sensor-reading-bg);
    border-radius: 6px;
}

.sensor-label {
    font-weight: bold;
    color: var(--text-color);
    text-align: left;
    flex: 1;
}

.sensor-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0 0.5rem;
    color: var(--text-color);
}

.sensor-unit {
    font-size: 0.9rem;
    color: var(--text-color);
    width: 25px;
    text-align: left;
}

#last-updated-livingroom,
#last-updated-bedroom {
    text-align: center;
    color: var(--text-color);
    font-style: italic;
}

/* Chart styling */
h2 .chart-controls {
    display: flex;
    align-items: center;
    gap: 8px; 
}

h2 .chart-controls label {
    font-size: 0.8rem; 
    font-weight: normal; 
    color: var(--text-color); 
    margin: 0; 
}
  
#time-range-selector {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--container-bg);
    color: var(--text-color);
    cursor: pointer;
}
  
#time-range-selector:focus {
    outline: none;
    border-color: var(--accent-color);
}
  
#history-chart {
    display: block;
    width: 100%;
    height: 400px;
    background-color: var(--container-bg);
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    margin-top: 10px;
}
  
/* Responsive adjustments */
@media (max-width: 600px) {
    #sensor-display {
        flex-direction: column;
        align-items: center;
    }
    
    .sensor-card {
        width: 80%;
        margin-bottom: 1rem;
    }
    
    #history-chart {
        height: 300px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
  
@media (max-width: 480px) {
    .room-reading {
        padding: 0.4rem 0.6rem;
    }
    
    .sensor-value {
        font-size: 1.6rem;
    }
}