/* Gaya umum halaman */
body {
    font-family: "Poppins", sans-serif;
    background-color: #093FB4;
    color: #000000;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    display: flex;
    gap: 15px;
}

.content-1 {
    width: 15%;
    height: 50%;
}

.content-2 {
    width: 40%;
    height: auto;
}

.content-3 {
    width: 40%;
    height: auto;
}

.content-4 {
    width: 40%;
    height: auto;
}

/* Kotak data (tegangan, arus, daya) */
.data-box {
    background-color: white;
    color: #31393b;
    border-radius: 24px;
    box-sizing: border-box;
    flex: 1 1 17%;
    /* Fleksibel, minimal 45% lebar */
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.1s ease;
    padding-top: 0vw;
    padding-right: 1.5vw;
    padding-bottom: 1.3vw;
    padding-left: 1.5vw;
}

.data-box p.sensor-data {
    text-align: left;
    font-size: 2em;
    /* Ukuran font bisa diubah sesuai kebutuhan */
    font-weight: bold;
    color: #31393b;
    margin: 0;
    padding: 0;
}

/* Kotak grafik */
.graph-box {
    color: #31393b;
    background-color: white;
    border-radius: 24px;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    /* Tambahkan baris ini */
    padding-top: 0vw;
    padding-right: 1.5vw;
    padding-bottom: 1.3vw;
    padding-left: 1.5vw;
}

/* Judul utama */
#judul {
    font-size: 5vw;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    line-height: 1;
}

/* Navbar */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 100px;
    padding: 0vw;
    margin: 1vw auto 1vw auto;
    max-width: 35.4vw;
    box-sizing: border-box;
}

.navbar-item {
    color: #093FB4;
    padding: 0.8vw 2vw;
    cursor: pointer;
    border-radius: 100px;
    font-weight: bold;
    font-size: 0.7vw;
    user-select: none;
    transition: background-color 0.1s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin: 0vw 0vw 0vw;
}

.navbar-item.active {
    background-color: #b8b5d4;
}

.navbar-item:hover:not(.active) {
    background-color: #cbcbcb;
}

/* Blur background overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 99;
}

/* Modal box */
#loginModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #31393b;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
    text-align: center;
}

/* Button styling */
button {
    padding: 10px 20px;
    margin-top: 10px;
    background-color: #093FB4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Input styling */
input[type="password"] {
    padding: 8px;
    width: 200px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.range-label {
    text-align: center;
    font-size: 13px;
    margin-top: 5px;
    color: #555;
    transition: color 0.3s ease, transform 0.2s ease;
}

.status-label {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
    margin: 0;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.status-text {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin-top: 4px;
}

.status-min {
    color: #ffc107;
    /* kuning */
    transform: scale(1.05);
}

.status-normal {
    color: #4caf50;
    /* hijau */
}

.status-warning {
    color: #f44336;
    /* merah */
    transform: scale(1.05);
}

.threshold-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 0 10px;
    margin-bottom: 2px;
    font-weight: bold;
}

.threshold-labels .min-label {
    color: #ffc107;
    /* kuning */
}

.threshold-labels .normal-label {
    color: #4caf50;
    /* hijau */
    text-align: center;
}

.threshold-labels .warning-label {
    color: #ff4c4c;
    /* merah */
}

.graph-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-download {
    padding: 6px 12px;
    background-color: #093FB4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-download:hover:not(.active) {
    background-color: #cbcbcb;
}

.btn-dropdown {
    padding: 6px 12px;
    background-color: #093FB4;
    border: 1px solid #ccc;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

.btn-dropdown:hover:not(.active) {
    background-color: #cbcbcb;
}

.filter-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: #093FB4;
    border: 1px solid #093FB4;
    border-radius: 8px;
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    min-width: 100%;
    z-index: 999;
}

.dropdown-menu li button {
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

#pvVoltageChart {
    height: 525px;
    width: 100%;
}

#pvCurrentChart {
    height: 525px;
    width: 100%;
}

#pvPowerChart {
    height: 490px;
    width: 100%;
}

#batteryVoltageChart {
    height: 525px;
    width: 100%;
}

#batteryCurrentChart {
    height: 525px;
    width: 100%;
}

#batteryPowerChart {
    height: 490px;
    width: 100%;
}

#inverterVoltageChart {
    height: 525px;
    width: 100%;
}

#inverterCurrentChart {
    height: 525px;
    width: 100%;
}

#inverterPowerChart {
    height: 490px;
    width: 100%;
}

#plnVoltageChart {
    height: 525px;
    width: 100%;
}

#plnCurrentChart {
    height: 525px;
    width: 100%;
}

#plnPowerChart {
    height: 490px;
    width: 100%;
}


/* Media Query untuk perangkat dengan lebar layar maksimum 768px (Tablet dan HP) */
@media (max-width: 768px) {

    /* Container menjadi kolom */
    .container {
        flex-direction: column;
        gap: 10px;
    }

    /* Konten 1 dan 2 mengambil lebar penuh */
    .content-1,
    .content-2,
    .content-3,
    .content-4 {
        width: 100%;
        height: auto;
        /* Menghindari pemotongan konten */
        gap: 5vw;
    }

    /* Data box dan graph box menyesuaikan lebar */
    .data-box,
    .graph-box {
        max-width: 100%;
        padding: 2vw;
        box-sizing: border-box;
        gap: 2vw;
    }

    /* Judul utama agar ukurannya lebih kecil agar muat layar */
    #judul {
        font-size: 6vw;
        margin: 1vw 0;
    }

    /* Navbar menjadi lebar penuh dan item lebih besar agar mudah disentuh */
    .navbar {
        max-width: 100%;
        padding: 1vw;
    }

    .navbar-item {
        font-size: 1.5vw;
        padding: 0.5vw 2vw;
        margin: 0.3vw;
    }
}

@media screen and (max-width: 480px) {

    /* Ukuran font ditingkatkan */
    .data-box {
        padding: 4vw;
        font-size: 3.8vw;
        margin-bottom: 4vw;
        padding-top: 1vw;
    }

    .data-box p.sensor-data {
        font-size: 4.5vw;
        margin-bottom: 2vw;
    }

    .status-label,
    .status-text {
        font-size: 3.8vw;
        margin-top: 2vw;
    }

    .threshold-labels {
        font-size: 3vw;
        padding: 0 4vw;
        margin-bottom: 1vw;
    }

    /* Ukuran panah indikator */
    .data-box .arrow-icon {
        font-size: 5vw;
        margin-top: 1.5vw;
        margin-bottom: 1vw;
    }

    /* Judul responsif */
    #judul {
        font-size: 5vw;
        margin: 4vw 0;
    }

    /* Navbar responsif */
    .navbar {
        flex-wrap: wrap;
        justify-content: center;
        margin: 3vw auto;
        padding: 0vw;
        max-width: 71.5vw;
    }

    .navbar-item {
        font-size: 2vw;
        margin: 0vw;
        padding: 0.8vw 2vw;
    }

    /* Tombol download & dropdown lebih proporsional */
    button,
    select {
        font-size: 3.5vw;
        padding: 2vw 4vw;
        border-radius: 12px;
        margin: 2vw 2vw 0 0;
    }

    /* Spasi antar elemen grafik */
    .graph-box {
        padding: 4vw;
    }

    .btn-download,
    .btn-dropdown,
    .dropdown-menu li button {
        font-size: 3.5vw;
        padding: 2vw 2vw;
    }
}