/* =====================================================
   RESET
===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

    font-family:
        "Trebuchet MS",
        Arial,
        sans-serif;

    background: #f4f8ff;

    color: #17233d;
}


/* =====================================================
   ANIMASI PEMANDANGAN
===================================================== */

.landscape {

    position: relative;

    height: 300px;

    overflow: hidden;

    background:
        linear-gradient(
            to bottom,
            #63d3ff 0%,
            #a9e8ff 60%,
            #dff8ff 100%
        );
}


/* =====================================================
   MATAHARI
===================================================== */

.sun {

    position: absolute;

    width: 70px;
    height: 70px;

    right: 12%;
    top: 35px;

    border-radius: 50%;

    background: #ffd75e;

    box-shadow:
        0 0 30px
        rgba(255, 215, 94, .7);

    animation:
        sunGlow 3s
        infinite alternate;
}

@keyframes sunGlow {

    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}


/* =====================================================
   AWAN
===================================================== */

.cloud {

    position: absolute;

    width: 150px;
    height: 45px;

    background: white;

    border-radius: 50px;

    opacity: .9;

    animation:
        cloudMove
        30s
        linear
        infinite;
}

.cloud span {

    position: absolute;

    background: white;

    border-radius: 50%;
}

.cloud span:nth-child(1) {

    width: 60px;
    height: 60px;

    left: 20px;
    bottom: 15px;
}

.cloud span:nth-child(2) {

    width: 75px;
    height: 75px;

    left: 55px;
    bottom: 10px;
}

.cloud span:nth-child(3) {

    width: 48px;
    height: 48px;

    right: 10px;
    bottom: 12px;
}


.cloud1 {

    top: 45px;
    left: -200px;
}


.cloud2 {

    top: 105px;
    left: -350px;

    transform: scale(.75);

    animation-duration: 38s;
}


.cloud3 {

    top: 25px;
    left: -450px;

    transform: scale(.6);

    animation-duration: 45s;
}


@keyframes cloudMove {

    from {

        transform:
            translateX(-200px);

    }

    to {

        transform:
            translateX(1600px);

    }

}


/* =====================================================
   SATU BUKIT
===================================================== */

.single-hill {

    position: absolute;

    left: -10%;

    bottom: 60px;

    width: 120%;

    height: 180px;

    border-radius:
        55%
        55%
        0
        0;

    background:

        linear-gradient(
            160deg,
            #72b85c,
            #4f984f,
            #347848
        );

    box-shadow:
        inset 0 15px 30px
        rgba(255,255,255,.12);

}


/* =====================================================
   SUNGAI
===================================================== */

.river {

    position: absolute;

    bottom: 0;

    left: 0;

    width: 100%;

    height: 75px;

    background:

        linear-gradient(
            to bottom,
            #42c4ee,
            #178fd3
        );

    overflow: hidden;
}


.water-line {

    position: absolute;

    height: 4px;

    width: 110px;

    background:
        rgba(255,255,255,.7);

    border-radius: 20px;

    animation:
        waterFlow
        5s
        linear
        infinite;
}


.line1 {
    top: 14px;
    left: 5%;
}

.line2 {
    top: 35px;
    left: 25%;
    animation-delay: 1s;
}

.line3 {
    top: 20px;
    left: 48%;
    animation-delay: 2s;
}

.line4 {
    top: 50px;
    left: 65%;
    animation-delay: 3s;
}

.line5 {
    top: 30px;
    left: 80%;
    animation-delay: 1.5s;
}

.line6 {
    top: 58px;
    left: 95%;
    animation-delay: 2.5s;
}


@keyframes waterFlow {

    from {

        transform:
            translateX(-180px);

    }

    to {

        transform:
            translateX(300px);

    }

}


/* =====================================================
   ANGIN
===================================================== */

.wind {

    position: absolute;

    width: 90px;
    height: 3px;

    background:
        rgba(255,255,255,.75);

    border-radius: 20px;

    animation:
        windMove
        5s
        linear
        infinite;
}


.wind1 {

    top: 135px;
    left: 15%;
}


.wind2 {

    top: 170px;
    left: 50%;

    animation-delay: 2s;
}


.wind3 {

    top: 115px;
    left: 70%;

    animation-delay: 3s;
}


@keyframes windMove {

    0% {

        transform:
            translateX(-120px);

        opacity: 0;

    }

    30% {

        opacity: 1;

    }

    100% {

        transform:
            translateX(450px);

        opacity: 0;

    }

}


/* =====================================================
   DAUN
===================================================== */

.leaf {

    position: absolute;

    font-size: 22px;

    animation:

        leafFly
        10s
        linear
        infinite,

        leafRotate
        2s
        ease-in-out
        infinite;
}


.leaf1 {

    top: 125px;
    left: 10%;
}


.leaf2 {

    top: 190px;
    left: 30%;

    animation-delay: 2s;
}


.leaf3 {

    top: 145px;
    left: 55%;

    animation-delay: 4s;
}


.leaf4 {

    top: 105px;
    left: 75%;

    animation-delay: 6s;
}


.leaf5 {

    top: 205px;
    left: 45%;

    animation-delay: 8s;
}


@keyframes leafFly {

    0% {

        transform:
            translateX(-50px);

        opacity: 0;

    }

    15% {

        opacity: 1;

    }

    50% {

        transform:
            translateX(160px)
            translateY(-40px);

    }

    100% {

        transform:
            translateX(450px)
            translateY(50px);

        opacity: 0;

    }

}


@keyframes leafRotate {

    50% {

        rotate: 180deg;

    }

}


/* =====================================================
   HEADER
===================================================== */

.header {

    min-height: 145px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        18px 4%;

    gap: 20px;

    background: white;
}


/* =====================================================
   LOGO
===================================================== */

.logo-area {

    width: 150px;

    min-width: 150px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;
}


.logo-area img {

    max-width: 125px;

    max-height: 100px;

    object-fit: contain;
}


/* =====================================================
   JUDUL
===================================================== */

.title-area {

    flex: 1;

    text-align: center;
}


.school-label {

    display: inline-block;

    padding:
        7px 22px;

    border-radius: 20px;

    background: #3275d8;

    color: white;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 1px;

    margin-bottom: 8px;
}


.title-area h1 {

    font-size:
        clamp(
            22px,
            3vw,
            38px
        );

    color: #294f93;

    font-weight: 900;

    line-height: 1.15;
}


.title-area h2 {

    margin-top: 7px;

    font-size: 15px;

    color: #5378a8;

}


/* =====================================================
   ONLINE
===================================================== */

.online-status {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 8px;

    padding: 7px 12px;

    background: #f4fff9;

    border-radius: 10px;

    border: 1px solid #d9f3e6;
}


.online-dot {

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #20bd78;

    box-shadow:
        0 0 10px
        #20bd78;

    animation:
        onlinePulse
        1.5s
        infinite;
}


.online-status strong {

    display: block;

    color: #17935d;

    font-size: 10px;
}


.online-status small {

    display: block;

    color: #84918c;

    font-size: 9px;
}


@keyframes onlinePulse {

    50% {

        opacity: .35;

        transform:
            scale(.7);

    }

}


/* =====================================================
   NAVBAR
===================================================== */

.navbar {

    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 5px;

    padding: 13px;

    background: #16213a;
}


.navbar a {

    color: white;

    text-decoration: none;

    padding:
        9px 16px;

    border-radius: 10px;

    font-size: 14px;

    transition: .25s;
}


.navbar a:hover {

    background: #3776e8;

    transform:
        translateY(-2px);
}


/* =====================================================
   CONTAINER
===================================================== */

.container {

    width: 92%;

    max-width: 1400px;

    margin: auto;
}


/* =====================================================
   STATUS SISTEM
===================================================== */

.system-status {

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 15px;

    padding:
        30px 0;
}


.status-card {

    background: white;

    padding: 20px;

    border-radius: 15px;

    box-shadow:
        0 5px 20px
        rgba(39,76,119,.08);

    border-left:
        5px solid #4b8df8;
}


.status-card span {

    display: block;

    color: #7b8799;

    font-size: 11px;

    margin-bottom: 7px;
}


.status-card strong {

    font-size: 17px;
}


.green {
    color: #16a36a;
}


.blue {
    color: #347ce5;
}


/* =====================================================
   SECTION
===================================================== */

.section {

    margin-bottom: 35px;
}


.section-title {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


.section-title h2 {

    font-size: 25px;

    color: #182b52;
}


.section-title p {

    margin-top: 5px;

    color: #8290a7;
}


.sensor-count,
.live-badge {

    padding:
        8px 14px;

    background: #e9f4ff;

    color: #2777d4;

    border-radius: 20px;

    font-size: 12px;

    font-weight: bold;
}


/* =====================================================
   SENSOR
===================================================== */

.sensor-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;
}


.sensor-card {

    background: white;

    padding: 25px;

    border-radius: 18px;

    display: flex;

    align-items: center;

    gap: 18px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);

    transition: .3s;
}


.sensor-card:hover {

    transform:
        translateY(-5px);

    box-shadow:
        0 12px 30px
        rgba(42,91,148,.15);
}


.sensor-icon {

    width: 65px;
    height: 65px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 15px;

    font-weight: bold;

    font-size: 15px;
}


.ph {

    background: #e9f1ff;

    color: #3d75d8;
}


.temp {

    background: #fff0e7;

    color: #ed7b35;
}


.level {

    background: #e4fbff;

    color: #1499bd;
}


.turbidity {

    background: #eeeaff;

    color: #6860d7;
}


.sensor-card h3 {

    font-size: 13px;

    color: #7d899e;
}


.sensor-value {

    font-size: 32px;

    font-weight: 900;

    color: #1b2e52;

    margin-top: 5px;
}


.sensor-card small {

    color: #8994a6;
}


.normal {

    margin-top: 8px;

    font-size: 11px;

    color: #20a66c;

    font-weight: bold;
}


.level-bar {

    width: 130px;

    height: 8px;

    background: #e7edf4;

    border-radius: 10px;

    margin-top: 5px;

    overflow: hidden;
}


#levelBar {

    width: 78%;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            #3bc7ee,
            #317fe4
        );

    border-radius: 10px;
}


/* =====================================================
   SATU GRAFIK + INFORMASI
===================================================== */

.realtime-panel {

    display: grid;

    grid-template-columns:
        1.7fr
        1fr;

    gap: 20px;

    background: white;

    padding: 22px;

    border-radius: 20px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);
}


/* GRAFIK */

.chart-container {

    min-height: 430px;

    padding: 10px;
}


.chart-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 15px;
}


.chart-header h3 {

    color: #263b61;

    font-size: 17px;
}


.chart-header span {

    padding:
        6px 12px;

    background: #eafff4;

    color: #1aa66a;

    border-radius: 15px;

    font-size: 10px;

    font-weight: bold;
}


.chart-container canvas {

    width: 100% !important;

    height: 350px !important;
}


/* =====================================================
   PENJELASAN GRAFIK
===================================================== */

.realtime-info {

    padding: 10px;

    border-left:
        1px solid #e7edf4;
}


.realtime-info h3 {

    color: #263b61;

    margin-bottom: 15px;

    font-size: 17px;
}


.parameter-info {

    display: flex;

    gap: 12px;

    padding: 12px;

    margin-bottom: 10px;

    border-radius: 12px;

    background: #f7faff;
}


.parameter-icon {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 10px;

    font-size: 11px;

    font-weight: bold;

    background: #e5f1ff;

    color: #3479d8;
}


.parameter-info strong {

    display: block;

    color: #263b61;

    font-size: 13px;
}


.parameter-info p {

    margin-top: 4px;

    color: #7e8b9f;

    font-size: 11px;

    line-height: 1.4;
}


.parameter-info b {

    display: block;

    margin-top: 5px;

    color: #3180df;

    font-size: 11px;
}


/* =====================================================
   PROSES
===================================================== */

.process {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    flex-wrap: wrap;
}


.process-box {

    width: 160px;

    min-height: 120px;

    padding: 18px;

    text-align: center;

    background: white;

    border-radius: 16px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);

    border-top:
        5px solid #3e8bea;
}


.process-box span {

    display: block;

    color: #3b85e5;

    font-size: 12px;

    font-weight: bold;
}


.process-box strong {

    display: block;

    margin-top: 10px;

    font-size: 13px;
}


.process-box small {

    display: block;

    margin-top: 7px;

    color: #8490a3;
}


.process-arrow {

    font-size: 25px;

    color: #3984e5;
}


/* =====================================================
   AKTUATOR
===================================================== */

.actuator-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;
}


.actuator-card {

    display: flex;

    align-items: center;

    gap: 15px;

    background: white;

    padding: 20px;

    border-radius: 16px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);
}


.actuator-icon {

    width: 55px;
    height: 55px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 15px;

    background: #edf5ff;

    font-size: 25px;
}


.actuator-card h3 {

    font-size: 14px;

    margin-bottom: 7px;
}


.actuator-status {

    font-size: 12px;

    font-weight: bold;
}


.actuator-status.on {

    color: #18a568;
}


.actuator-status.off {

    color: #929bab;
}


/* =====================================================
   ALARM
===================================================== */

.alarm-container {

    background: white;

    padding: 20px;

    border-radius: 18px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);
}


.alarm-normal {

    display: flex;

    align-items: center;

    gap: 18px;

    padding: 15px;

    background: #effbf5;

    border-radius: 12px;

    border-left:
        5px solid #23b978;
}


.alarm-symbol {

    width: 45px;
    height: 45px;

    display: flex;

    justify-content: center;

    align-items: center;

    background: #22b876;

    color: white;

    border-radius: 50%;

    font-size: 22px;
}


.alarm-normal h3 {

    color: #198a5c;

    font-size: 15px;
}


.alarm-normal p {

    color: #668477;

    margin-top: 5px;
}


.alarm-time {

    margin-left: auto;

    color: #849187;

    font-size: 12px;
}


/* =====================================================
   MODBUS
===================================================== */

.modbus-container {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;

    padding: 25px;

    background: white;

    border-radius: 20px;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);
}


.modbus-device {

    min-width: 180px;

    padding: 20px;

    text-align: center;

    border-radius: 15px;

    background: #eef6ff;

    border:
        2px solid #d5e8ff;
}


.device-icon {

    font-size: 30px;

    margin-bottom: 8px;
}


.modbus-device strong {

    display: block;
}


.modbus-device small {

    display: block;

    color: #7f8ca0;

    margin-top: 5px;
}


.modbus-line {

    color: #327de0;

    font-size: 20px;

    font-weight: bold;
}


.communication-status {

    width: fit-content;

    margin: 20px auto;

    padding:
        12px 20px;

    background: #e9fff5;

    color: #17955e;

    border-radius: 20px;

    font-weight: bold;

    font-size: 13px;
}


.pulse {

    display: inline-block;

    width: 9px;
    height: 9px;

    margin-right: 7px;

    border-radius: 50%;

    background: #1fb873;

    animation:
        onlinePulse
        1s
        infinite;
}


/* =====================================================
   HISTORI
===================================================== */

.history-table {

    background: white;

    padding: 20px;

    border-radius: 18px;

    overflow-x: auto;

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.06);
}


table {

    width: 100%;

    border-collapse: collapse;
}


th {

    background: #edf5ff;

    color: #3867a3;

    padding: 14px;

    text-align: left;

    font-size: 13px;
}


td {

    padding: 14px;

    border-bottom:
        1px solid #edf0f5;

    font-size: 13px;
}


.table-normal {

    color: #1ba56a;

    font-weight: bold;
}


/* =====================================================
   FOOTER
===================================================== */

footer {

    margin-top: 40px;

    padding: 35px 20px;

    text-align: center;

    color: white;

    background: #17253e;
}


footer strong {

    font-size: 17px;
}


footer p {

    margin-top: 8px;

    color: #b9c7dc;
}


footer span {

    display: block;

    margin-top: 15px;

    color: #7fa3d7;

    font-size: 13px;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1000px) {

    .sensor-grid,
    .actuator-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }


    .system-status {

        grid-template-columns:
            repeat(3, 1fr);
    }


    .realtime-panel {

        grid-template-columns: 1fr;
    }


    .realtime-info {

        border-left: none;

        border-top:
            1px solid #e7edf4;

        padding-top: 20px;
    }

}


@media (max-width: 650px) {

    .system-status,
    .sensor-grid,
    .actuator-grid {

        grid-template-columns: 1fr;
    }


    .landscape {

        height: 230px;
    }


    .header {

        flex-direction: column;
    }


    .title-area h1 {

        font-size: 22px;
    }


    .title-area h2 {

        font-size: 12px;
    }


    .online-status {

        margin:
            8px auto 0;
    }


    .navbar a {

        font-size: 12px;

        padding:
            8px 10px;
    }


    .chart-container canvas {

        height: 280px !important;
    }


    .process-arrow {

        transform:
            rotate(90deg);
    }

}