html,
body {
    font-family: 'Prompt', sans-serif;
    background-color: #f4f7fc;
}
#viewDiv {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
    position: relative;
    font-family: 'Prompt', sans-serif;
    background-color: #f4f7fc;
    /* สีพื้นหลังเพื่อให้ดูสบายตา */
}

/* .button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    font-family: 'Prompt';
    flex-direction: row;
    gap: 10px;
    z-index: 10;
}

button {
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    border-color: 2px solid #007acc;
    border-radius: 24px;
    background-color: #007acc;
    color: #007acc;
    font-family: 'Prompt', sans-serif;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

button.selected {
    background-color: #007acc;
    color: white;
    border-color: #007acc;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #007acc;
    color: white;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
} */

.button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    font-family: 'Prompt', sans-serif;
    flex-direction: row;
    gap: 10px;
    z-index: 10;
}

button {
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    font-family: 'Prompt', sans-serif;
    background-color: white;
    color: #007acc;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;

}

button {
    background-color: white;
    color: #007acc;
}

button.selected {
    background-color: #007acc;
    color: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

button:hover {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.map-control-button button {
    padding: 8px;
    background-color: #ffffff;
    /* color: #007acc; */
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgb(0 0 0 / 40%) !important;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.rounded-circle {
    border-radius: 10px !important;
}

.map-control-button {
    display: none;
    position: absolute;
    bottom: 348px;
    right: 21px;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    animation: slideUp 0.2s ease-out forwards;
    
}

.expand-button {
    position: absolute; 
    bottom: 295px;
    right: 20px;
    padding: 8px;
    background-color: #ffffff;
    color: #000000;
    border-radius: 10px; 
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer; 
    /* transition: background-color 0.3s, color 0.3s, transform 0.3s;  */
    z-index: 20;
}

#timeSlider {
    position: absolute;
    left: 50%;
    /* right: 1%; */
    bottom: 15px;
    transform: translateX(-50%);
    font-family: 'Prompt';
    z-index: 5;
    width: 98%;
    /* border-radius: 10px; */
    background-color: #ffffff;
    padding: 15px;
    box-shadow: 0px 4px 15px rgb(0 0 0 / 62%);
}

.heat-index-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    text-align: center;
}


.header h1 {
    color: #d44e41;
    margin: 15px 0 10px;
    font-size: 18px;
    font-weight: 900;
}

.header p {
    margin: 0 0 5px;
    font-size: 1em;
    color: #000000;
    font-weight: 400;
}

.legend {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    max-width: 100%;
}

.legend-item {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 10px;
    color: white;
    font-size: 0.9em;
    margin-left: 4px;
    margin-right: 4px;
    font-weight: bold;
    width: 100%;
}

.lightgreen {
    background-color: rgb(152, 203, 0);
    color: #666;
}
.green {
    background-color: rgb(139, 184, 7);
    color: #666;
}

.legend-item.green {
    background-color: rgb(244, 156, 49); /* ตัวอย่างสี */
  }


.yellow {
    background-color: rgb(192, 135, 0);
    color: #666;
}

.darkyellow {
    background-color: rgb(244, 156, 49);
    color: #666;
}

.orange {
    background-color: rgb(232.8, 102.8, 28.8);
}

.red {
    background-color: rgb(254, 34, 0);
} 

.esri-time-slider__row {
    padding: 12px 12px 12px 8px;
}

.esri-time-slider__time-extent {
    font-size: 16px;
}

.esri-time-slider__min,
.esri-time-slider__max {
    flex-flow: column;
    justify-content: center;
    font-size: 14px;
    line-height: 14px;
    display: flex;
}

.esri-time-slider__slider .esri-slider__tick-label {
    white-space: nowrap;
    margin-top: 23px;
    font-size: 14px;
}
.esri-legend {
    background: rgba(255, 255, 255, 0.8); /* พื้นหลังสีขาวโปร่งใส */
    padding: 10px; /* เพิ่ม padding ให้ Legend ดูเป็นระเบียบ */
    border-radius: 8px; /* เพิ่มมุมโค้งมนให้ Legend */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ Legend */
}

.esri-ui-manual-container>.esri-component {
    display: none;
}

.gradient-legend {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 40px;
    height: 250px;
    display: flex;
    flex-direction: column-reverse; /* ใช้ column-reverse เพื่อให้ข้อความอยู่ตำแหน่งที่ต้องการ */
    align-items: center;
    z-index: 20;
}

.gradient-bar {
    width: 20px;
    height: 200px;
    background: linear-gradient(to top, rgb(254, 34, 0), rgb(232.8, 102.8, 28.8), rgb(255, 251, 6), rgb(152, 203, 0), rgb(152, 203, 0));
}

.legend-label {
    font-size: 14px;
    font-weight: bold;
    color: black;
    margin: 5px 0;
}
.material-icons {
    font-size: 1.5rem;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-size: 1.2em;
    color: #007acc;
}
.esri-time-slider__slider .esri-slider__tick-label {
    white-space: nowrap;
    display: none;
}

.white-bg {
    background-color: white;
}
.search-panel {
    position: absolute;
    top: 100px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.search-panel label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.search-panel input {
    margin-bottom: 10px;
    width: 100%;
}

.btn-search {
    display: block;
    width: 100%;
    background-color: #007acc;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
}

.btn-search:hover {
    background-color: #005a99;
}

.search-container {
    z-index: 999;
}

@media (min-width: 300px) and (max-width: 601px) {

    body {
        font-size: 8px;
    }

    .button-container {
        top: 10px;
        right: 10px;
        flex-direction: row;
        /* เรียงปุ่มในแนวนอนสำหรับ Mobile */
        gap: 5px;
        /* ลดระยะห่างระหว่างปุ่ม */
    }

    button {
        padding: 4px 4px;
        /* ลดขนาด padding ของปุ่มให้เหมาะสมกับหน้าจอขนาดเล็ก */
        font-size: 8px;
        /* ลดขนาดฟอนต์ของปุ่ม */
    }

    .legend-item {
        flex: 1 1 45%;
        padding: 2px;
        font-size: 10px;
        margin-top: -12px
    }
    .legend-flex{
        flex: 1; 
        padding: 4px;
        font-size: 10px;

    }

    .header h1 {
        font-size: 12px;
        margin: 4px 4px 0 8px;
        text-align: left;
    }

    .header p {
        font-size: 10px;
        margin: 4px 4px -4px 8px;
        text-align: left;
    }

    .esri-time-slider__time-extent {
        font-size: 10px;
    }

    .esri-time-slider__min-date,
    .esri-time-slider__max-date {
        font-weight: 600;
        font-size: 10px;
    }

    .esri-time-slider {
        min-width: 95%;
        padding: 4px;
    }

    .esri-time-slider__slider .esri-slider__tick-label {
        white-space: nowrap;
        margin-top: 15px;
        font-size: 10px;
    }

    .esri-time-slider__row {
        padding: 8px 0 0 0;
    }

    .esri-time-slider__time-extent-date, .esri-time-slider__time-extent-separator {
        margin-bottom: 17px;
    }

    .map-control-button {
        bottom: 41%;
        right: 20px;
        gap: 8px;
        z-index: 10;
        animation: slideUp 0.2s ease-out forwards;
    }
    .expand-button {
        bottom: 35%;

    }
    .map-control-button button {
        padding: 4px;
        border-radius: 4px;
    }

}

@media (min-width: 601px) and (max-width: 768px) {

    body {
        font-size: 16px;
    }

    .button-container {
        top: 10px;
        right: 10px;
        flex-direction: row;
        /* เรียงปุ่มในแนวนอนสำหรับ Mobile */
        gap: 5px;
        /* ลดระยะห่างระหว่างปุ่ม */
    }

    button {
        padding: 8px 8px;
        font-size: 12px;
    }

    .legend-item {
        flex: 1 1 45%;
        padding: 2px;
        font-size: 10px;
        margin-top: -12px
    }

    .header h1 {
        font-size: 1.0em;
        /* margin: 12px 12px 0 12px; */
    }

    .header p {
        font-size: 14px;
        /* margin-top: 8px;
        margin-bottom: 4px; */
    }

    .esri-time-slider__time-extent {
        font-size: 14px;
    }

    .esri-time-slider__min-date,
    .esri-time-slider__max-date {
        font-weight: 600;
        font-size: 14px;
    }

    .esri-time-slider {
        min-width: 340px;
        padding: 4px;
    }

    .esri-time-slider__slider .esri-slider__tick-label {
        white-space: nowrap;
        margin-top: 15px;
        font-size: 14px;
    }

    .esri-time-slider__row {
        padding: 12px 12px 12px 8px;
    }

    .map-control-button {
        display: none;
        position: absolute;
        bottom: 372px;
        right: 21px;
        flex-direction: column;
        gap: 10px;
        z-index: 10;
        animation: slideUp 0.2s ease-out forwards;
        
    }
    .expand-button {
        bottom: 316px;

    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    body {
        font-size: 16px;
    }

    .button-container {
        top: 10px;
        right: 10px;
        flex-direction: row;
        /* เรียงปุ่มในแนวนอนสำหรับ Mobile */
        gap: 5px;
        /* ลดระยะห่างระหว่างปุ่ม */
    }

    button {
        padding: 8px 8px;
        /* ลดขนาด padding ของปุ่มให้เหมาะสมกับหน้าจอขนาดเล็ก */
        font-size: 12px;
        /* ลดขนาดฟอนต์ของปุ่ม */
    }

    .legend-item {
        flex: 1 1 45%;
        padding: 2px;
        font-size: 10px;
        margin-top: -12px
    }

    .header h1 {
        font-size: 1.4em;
        /* margin: 8px 8px 0 8px; */
    }

    .header p {
        font-size: 14px;
        margin-bottom: 0px;
    }

    .esri-time-slider__time-extent {
        font-size: 14px;
    }

    .esri-time-slider__min-date,
    .esri-time-slider__max-date {
        font-weight: 600;
        font-size: 14px;
    }

    .my-location-button {
        position: absolute;
        bottom: 283px;
        right: 10px;
        padding: 10px;
        background-color: #ffffff;
        color: #007acc;
        /* border: 2px solid #007acc; */
        /* border-radius: 50%; */
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
        z-index: 10;
    }
}

@media (min-width: 1025px) {

    body {
        font-size: 20px;
    }

    .button-container {
        top: 10px;
        right: 10px;
        flex-direction: row;
        /* เรียงปุ่มในแนวนอนสำหรับ Mobile */
        gap: 5px;
        /* ลดระยะห่างระหว่างปุ่ม */
    }

    button {
        padding: 8px 8px;
        /* ลดขนาด padding ของปุ่มให้เหมาะสมกับหน้าจอขนาดเล็ก */
        font-size: 12px;
        /* ลดขนาดฟอนต์ของปุ่ม */
    }

    .legend-item {
        flex: 1 1 45%;
        padding: 2px;
        font-size: 10px;
        margin-top: -12px
    }

    .header h1 {
        font-size: 1.2em;
        margin: 8px 8px 0 8px;
    }

    .header p {
        font-size: 12px;
        margin-bottom: 0px;
    }

    .esri-time-slider__time-extent {
        font-size: 12px;
    }

    .esri-time-slider__min-date,
    .esri-time-slider__max-date {
        font-weight: 600;
        font-size: 12px;
    }
}