body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.header {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.header-left { /* New style for the left part of the header */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.auth-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-info {
    font-weight: bold;
    color: #555;
}
.login-button, .logout-button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
}
.login-button:hover, .logout-button:hover {
    background-color: #0056b3;
}
.logout-button {
    background-color: #dc3545;
}
.logout-button:hover {
    background-color: #c82333;
}
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
}
.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    transition: transform 0.2s ease-in-out;
    background-color: #ffffff;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-5px);
}
.card h3 {
    margin-top: 0;
    color: #555;
    font-size: 1.2em;
}
.card p {
    font-size: 2.2em;
    font-weight: bold;
    margin: 10px 0 0;
    color: #2c3e50;
    pointer-events: none;
}
.card .unit {
    font-size: 0.8em;
    color: #777;
    margin-top: 5px;
}
.temp-card.cold { background-color: #e0f2f7; }
.temp-card.cool { background-color: #bbdefb; }
.temp-card.moderate { background-color: #c8e6c9; }
.temp-card.warm { background-color: #ffe0b2; }
.temp-card.hot { background-color: #ffccbc; }
.temp-card.cold p { color: #0277bd; }
.temp-card.cool p { color: #1976d2; }
.temp-card.moderate p { color: #43a047; }
.temp-card.warm p { color: #fb8c00; }
.temp-card.hot p { color: #e64a19; }
.status-card.on { background-color: #dcedc8; }
.status-card.off { background-color: #ffcdd2; }
.status-card.on p { color: #388e3c; }
.status-card.off p { color: #d32f2f; }
.card.low { background-color: #e3f2fd; color: #1e88e5; }
.card.normal { background-color: #e8f5e9; color: #43a047; }
.card.high { background-color: #ffe0b2; color: #fb8c00; }
.card.very-high { background-color: #ffcdd2; color: #e53935; }
.last-updated { /* Adjusted style for placement in header */
    margin-top: 10px; /* Adjusted margin for better spacing within header */
    font-size: 0.9em;
    color: #777;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}
@keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
@media (max-width: 600px) {
    .container { grid-template-columns: 1fr; }
    .card { min-height: 120px; padding: 20px; }
    .card p { font-size: 1.8em; }
    .modal-content { width: 95%; }
}

#chartModal .modal-content {
    width: 90vw;
    max-width: 800px;
}
