@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@100;300;400;500;700;800;900&display=swap');

/* Small Reset */
*::before,
*::after,
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*LI Reset*/
ul {
    list-style-type: none;
}

li {
    text-decoration: none;
}

/* Alignment */
.left {
    text-align: left;
    float: left;
}

.center {
    text-align: center !important;
    margin: 0 auto;
}

.right {
    text-align: right;
    float: right;
}

/* Padding and Margin */
.padding-5 {
    padding: 5%;
}

.margin-15 {
    margin: 15px !important;
}

.margin-5vw {
    margin: 5vw !important;
}

.margin-5-top {
    margin-top: 5%;
}

.margin-5-bottom {
    margin-bottom: 5%;
}



/* Body Styling for Neumorphism */
body {
    font-family: "M PLUS Rounded 1c", sans-serif;
    font-weight: 600;
    font-size: 12px;
    font-style: normal;
    background: #e0e5ec;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}



/* Neumorphism Effect: Header */
header {
    padding: 20px;
    background-color: #e0e5ec;
    border-radius: 70px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
    color: #333;
    margin: 20px auto 40px auto;
    min-width: 50vw;
}

header h1 {
    margin: 0;
}


/* Neumorphism Effect: Image */
.logo {
    margin: 0 10px;
    width: 60px;
    height: auto;
    background-color: #e0e5ec;
    border-radius: 25px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo:hover {
    transform: scale(1.1);
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}
/* Search Field */
#city-search {
    position: relative;
    z-index: 1000;
    width: 400px;
    padding: 15px;
    border-radius: 30px;
    background-color: #e0e5ec;
    border: none;
    box-shadow: inset 4px 4px 10px #c1c9d2, inset -4px -4px 10px #ffffff;
    transition: box-shadow 0.3s;
}

#city-search:focus {
    outline: none;
    border: none !important;
    box-shadow: 4px 4px 10px #c1c9d2, -4px -4px 10px #ffffff;
}

.city-search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200%;
    max-width: 100vw;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40%;
}

.search-wrapper {
    width: 400px;
    position: relative;
}

/*SEARCH SUGGESTIONS*/
.suggestions {
    display: none;
    width: 300px !important;
    margin-top: -20px;
    padding-top: 28px !important;
    position: absolute;
    background-color: #e0e5ec;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.294), 0 -2px 4px rgba(255, 255, 255, 0.7);
    z-index: 999;
    top: 100% !important;
    left: 0;
}

.suggestion-item {
    padding: 5px;
    cursor: pointer;
}


.suggestion-item:hover {
    border-radius: 15px;
    background-color: #d3d8e3;
    box-shadow: 4px 4px 5px #a3b1c62d, -4px -4px 5px #ffffff3b;
}


/*SEARCH BUTTON*/
button {
    background: #e0e5ec;
    border-radius: 20px;
    box-shadow: 7px 7px 14px #a3b1c6, -7px -7px 14px #ffffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    height: 40px;
    margin-left: 10px;
    transition: box-shadow 0.3s;
}

button:hover {
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}

#city-search:focus {
    outline: none;
    border: none !important;
    box-shadow: 4px 4px 10px #c1c9d2, -4px -4px 10px #ffffff;
}

/*MAP*/
#map {
    margin: 30px;
    margin-top: 10vh;
    height: 53.33vh;
    width: calc(100% - 60px);
    background-color: #e0e5ec;
    border-radius: 20px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
}

map:hover {
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}

/* City Information Box */
#city-info {
    padding: 20px;
    background-color: #e0e5ec;
    border-radius: 20px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
    transition: 0.3s;
}

/* Hover Effect on Markers */
.marker {
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 50%;
    background-color: #e0e5ec;
    box-shadow: 4px 4px 10px #c1c9d2, -4px -4px 10px #ffffff;
}

/* Detail Containers Like E.g. Temerature etc */
.container {
    background-color: #e0e5ec;
    color: #333;
    text-align: left;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
    margin: 20px 0;
    transition: box-shadow 0.3s;
}

.container:hover {
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}

.infobox {
    text-align: center;
    width: 100px;
    height: 100px;
    margin: 15px 0;
    border-radius: 20px;
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e0e5ec;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
    transition: box-shadow 0.3s;
}

.infobox:hover {
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}

/*SIde BOX With legend of rating*/
.legend {
    font-family: Arial, sans-serif;
    font-size: 12px;
    background-color: #e0e5ec;
    border-radius: 20px;
    padding: 10px 15px;
    box-shadow: inset 4px 4px 10px #c1c9d2, inset -4px -4px 10px #ffffff;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding-bottom: 10px;
}

.color-box {
    border-radius: 5px;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background-color: #e0e0e0;
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
    transition: box-shadow 0.3s ease;
}

.color-box:hover {
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}


.marker:hover {
    transform: scale(1.2);
    box-shadow: 4px 4px 10px #a3b1c6, -4px -4px 10px #ffffff;
}


/*GRid Styling*/
.grid-2-columns {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 15vw 15vw;
    gap: 20px;
    margin-right: 5vw;
}

.grid-2-columns-40-60 {
    margin-top: 15px;
    margin: 30px;
    display: grid;
    grid-template-columns: calc(40%) calc(60% - 20px);
    gap: 20px;
}


/* Footer Styling */
footer {
    text-align: center;
    background-color: #e0e5ec;
    color: #333;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
}

footer p {
    color: #333;
    text-decoration: none;
}

@media (max-width: 768px) {
    header {
        min-width: 90vw;
    }

    .logo{
        margin: 0 2px;
    }
    .container {
        margin: 5vw 0;
    }

    #detail-container {
        display: none;
    }

    #chart-container {
        margin-top: 0;
    }


    /*Mobile Search*/

    .city-search-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100vw;
    }

    .search-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        flex-direction: row;
        /* Ensure the search bar and button stay in the same row */
    }

    .search-wrapper {
        width: 65vw;
        /* Adjust width of search bar to leave space for the button */
        position: relative;
        margin: 0;
        /* No margin to ensure full width usage */
    }

    .suggestions {
        width: 55vw !important;
        /* Match the width of the search bar */
        position: absolute;
        top: 100% !important;
        /* Position the suggestions just below the input field */
        left: 0;
        margin-left: 0;
    }

    #city-search {
        width: 100%;
        /* Full width within the wrapper */
        padding: 15px;
        border-radius: 30px;
        background-color: #e0e5ec;
        border: none;
        box-shadow: inset 4px 4px 10px #c1c9d2, inset -4px -4px 10px #ffffff;
        transition: box-shadow 0.3s;
        margin: 0;
        /* No margin to ensure full width usage */
    }

    button {
        background: #e0e5ec;
        border-radius: 20px;
        box-shadow: 7px 7px 14px #a3b1c6, -7px -7px 14px #ffffff;
        border: none;
        padding: 10px 20px;
        cursor: pointer;
        height: 40px;
        margin-left: 5px;
        /* Add some space between the search bar and the button */
        display: inline-flex;
        /* Keep button in line with the search bar */
    }

    #city-info {
        padding: 15px;
    }


    .grid-2-columns-40-60 {
        grid-template-columns: 90vw !important;
        margin: 0 5vw;
        gap: 0vw;
    }

    .grid-2-columns {
        flex-direction: column;
        /* Stack the items vertically in mobile */
        grid-template-columns: none;
        /* Remove grid-template-columns */
        width: 80vw;
        /* Adjust the width */
        margin: 0 auto;
        /* Ensure the parent container is centered */
    }

    .legend {
        width: 100%;
        /* Full width within the parent */
        margin: 0 auto;
        /* Center the legend */
        padding: 10px 15px;
    }

    #temperaturePollutionChart {
        width: 75vw;
        height: auto;
    }
}