/* Mengimpor font Montserrat dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset margin, padding, dan box-sizing untuk semua elemen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif; /* Menggunakan font Montserrat sebagai default */
}

/* Styling untuk body */
body {
    display: flex; /* Mengatur elemen agar tata letak fleksibel */
    justify-content: center; /* Menyelaraskan isi di tengah secara vertikal */
    align-items: center; /* Menyelaraskan isi di tengah secara horizontal */
    min-height: 100vh; /* Memastikan tinggi minimal 100% dari tinggi viewport */
    background: #5f41e4; /* Memberi latar belakang */
}

/* Styling untuk container */
.container {
    flex-grow: 1;
    overflow: hidden;
    max-width: 425px; /* Batasan lebar maksimum container */
    border-radius: 10px; /* Membulatkan sudut wadah */
    position: relative;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); /* Efek bayangan */
}

/* Styling untuk bagian pencarian */
.search-section {
    display: flex;
    gap: 10px; 
    padding: 25px;
    align-items: center;
}

.search-section .input-wrapper {
    height: 54px;
    width: 100%;
    position: relative;
}

/* Styling ikon pencarian */
.search-section .input-wrapper span {
    position: absolute;
    top: 50%;
    left: 17px;
    pointer-events: none;
    transform: translateY(-50%);
}

/* Styling input pencarian */
.search-section .search-input {
    height: 100%;
    width: 100%;
    outline: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    text-transform: uppercase;
    padding: 0 20px 0 50px;
    border: 1px solid #beb0ff;
    background: #fff;
    transition: 0.1s ease;
}

/* Efek saat input mendapatkan fokus */
.search-section .search-input:focus {
    border-color: #5f41e4;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.14);
}

.search-section .search-input::placeholder {
    text-transform: none;
}

/* Styling tombol lokasi */
.search-section .location-button {
    height: 54px;
    width: 56px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: #fff;
    color: #5f41e4;
    border: 1px solid #beb0ff;
    transition: 0.3s ease;
}

/* Efek hover pada tombol lokasi */
.search-section .location-button:hover {
    color: #fff;
    background: #5f41e4;
    border-color: #5f41e4;
}

.search-section .location-button span {
    font-size: 1.3rem;
}

/* Styling untuk bagian no results */
.no-results {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    display: none;
    padding: 40px;
    text-align: center;
    align-items: center;
    flex-direction: column;
    transform: translate(-50%, -50%);
    transition: 0.2s ease;
}

body.show-no-results .no-results {
    display: flex;
}

.no-results .title {
    font-weight: 700;
    margin: 25px 0 15px;
}

.no-results .message {
    font-weight: 500;
    line-height: 23px;
}

/* Menyembunyikan informasi cuaca ketika ada no-results */
body.show-no-results .weather-section {
    visibility: hidden;
}

/* Styling untuk bagian cuaca saat ini */
.weather-section .current-weather {
    display: flex;
    padding: 20px 0 50px;
    flex-direction: column;
    align-items: center;
}

.current-weather .weather-icon {
    width: 140px;
    aspect-ratio: 1;
}

.current-weather .temperature {
    font-size: 3.38rem;
    margin: 23px 0;
    display: flex;
}

.current-weather .temperature span {
    font-size: 1.56rem;
    font-weight: 500;
    margin: 5px 0 0 2px;
}

.current-weather .description {
    font-weight: 500;
    font-size: 1.25rem;
}

/* Styling untuk prakiraan cuaca per jam */
.hourly-weather {
    padding: 16px 25px;
    border-top: 1px solid #d5ccff;
}

.hourly-weather .weather-list {
    display: flex;
    gap: 41px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: -16px;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

/* Sembunyikan scroll bar */
.hourly-weather:hover .weather-list {
    scrollbar-color: #bfbfbf transparent;
}

.hourly-weather .weather-list .weather-item {
    display: flex;
    gap: 7px;
    width: 60px;
    font-weight: 500;
    flex-direction: column;
    align-items: center;
}

.hourly-weather .weather-item .weather-icon {
    width: 28px;
    aspect-ratio: 1;
}

/* Media query untuk tampilan kecil */
@media (max-width: 624px) {
    .body {
        padding: 15px;
    }

    .search-section {
        padding: 20px;
    }

    .no-results {
        padding: 30px;
    }

    .hourly-weather {
        padding: 16px 20px;
    }

    .hourly-weather .weather-list {
        gap: 32px;
    }
}