/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

/* Add center alignment for titles */
h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

h3 {
    text-align: center;
    margin-bottom: 15px;
}

.charts-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    width: 100%;
}

/* Desktop layout (lebih dari 768px) */
@media screen and (min-width: 769px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 900px;
    }

    .chart-container {
        height: 350px;
    }
}

/* Mobile layout (768px atau kurang) */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto;
        height: auto;
    }

    .chart-container {
        min-height: 300px;
        margin-bottom: 20px;
        width: 100%;
    }

    h2 {
        font-size: 28px;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 16px;
    }
}

.chart-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 280px;
}

/* Memastikan mobile view bekerja dengan benar */
@media screen and (max-width: 480px) {
    .charts-grid {
        grid-template-columns: 1fr !important;
        padding: 10px;
    }

    .chart-container {
        min-height: 250px;
        padding: 15px;
    }
}

#statusTitle {
    margin-bottom: 20px;
}

.status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    height: 100%;
}

.status-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 350px;
}

/* Style untuk status keran */
.status-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    transition: background-color 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-indicator.status-on {
    background-color: #4CAF50;  /* Warna hijau untuk status ON */
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.status-indicator.status-off {
    background-color: #f44336;  /* Warna merah untuk status OFF */
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
}

.status-text {
    font-size: 24px;
    font-weight: bold;
    margin-top: auto; /* Changed from fixed margin to auto */
    margin-bottom: 5px; /* Added bottom margin */
}

/* Menyesuaikan ukuran untuk mobile */
@media screen and (max-width: 768px) {
    .status-indicator {
        width: 80px;
        height: 80px;
    }
    
    .status-text {
        font-size: 20px;
    }
}