body {
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    margin: 0;
}

.header {
    background: #4CAF50;
    color: white;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px #ccc;
}

.container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px;
    flex-wrap: wrap;
}

.card {
    background: white;
    width: 300px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 2px 2px 10px #ccc;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 15px #bbb;
}

.card .value {
    font-size: 45px;
    font-weight: bold;
    margin-top: 10px;
}

.status {
    font-size: 30px;
    color: #2c3e50;
}

.pir {
    font-size: 32px;
    color: #8e44ad;
}

.chart-box {
    background: white;
    margin: 25px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 2px 2px 10px #ccc;
}

.chart-box h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.4em;
}

/* Gauge Styles */
.gauge-container {
    text-align: center;
    position: relative;
    margin: 0 auto;
    width: 300px;
    height: 200px;
}

.gauge-value {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 120px;
    text-align: center;
}

.gauge-value.alert {
    color: #ff4444;
    border: 2px solid #ff4444;
}

.gauge-value.safe {
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

/* PERBAIKAN UKURAN GRAFIK */
.chart-container {
    position: relative;
    height: 250px; /* Diperkecil dari 300px */
    width: 100%;
}

#chartKelembaban {
    height: 250px !important;
    width: 100% !important;
}

/* Chart Canvas */
canvas {
    max-width: 100%;
    height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 90%;
        max-width: 400px;
    }
    
    .chart-box {
        margin: 15px;
        padding: 15px;
    }
    
    .gauge-container {
        width: 250px;
    }
    
    .chart-container {
        height: 200px; /* Lebih kecil di mobile */
    }
    
    #chartKelembaban {
        height: 200px !important;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 180px; /* Paling kecil untuk mobile sangat kecil */
    }
    
    #chartKelembaban {
        height: 180px !important;
    }
}