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

html {
    font-size: 16px;
}

body {
    font-family: 'SN Pro','Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(0deg, #a8edea 0%, #fdfed6 100%);
}

header {
    background-color: rgba(17, 147, 180, 0.425);
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    font-family: 'Mea Culpa', 'Lucida Handwriting', cursive;
    font-size: 3rem;
    color: #685500;
}

h2 {
    color: #886f00;
    text-align: center;
}

main {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

button {
    font-family: 'Elsie Swash Caps', sans-serif;
    font-size: 1.25rem;
    background: #2f676e;
    color: rgb(255, 255, 255);
    border: none;
}

/* === Location Selection === */
#location-selection {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#location-selection button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
}

#location-selection button:disabled {
    background: #597173;
    color: rgb(255, 255, 255);
    cursor: default;
}

.location-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

#search-form {
    display: none;
}
#search-form input {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    min-width: 20rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* -- Suggestions Dropdown -- */
#suggestions {
    padding: 0.5rem;
    max-height: 9rem;
    width: 100%;
    overflow-y: auto;
    border: 1px solid #ccc;
    background: #bee6ff72;
    border-radius: 0rem 0rem 0.5rem 0.5rem;
    scrollbar-color: #2f676e transparent;
    margin-top: -0.3rem;
    z-index: 0;
}

.suggestion-item, .no-results {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
}

.suggestion-item:hover {
    background: #2f676e;
    color: rgb(255, 255, 255);
}


/* === Weather Tabs === */

#weather-tabs {
    gap: 1rem;
    margin-bottom: 0.5rem;
    align-items: center;
    margin: 1rem;
}

.tab-button {
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
}

.tab-button.active, .unit-button.active {
    cursor: default;
    background: #597173;
    color: rgb(255, 255, 255);
}

.weather-section {
    display: none;
    width: 100%;
}

/* === Unit Toggles === */
.unit-section {
    position: fixed; 
    right: 0;
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s ease-in-out;
    z-index: 100;
}

.unit-section.closed {
    transform: translateX(80%);   /* Slide off screen */
}

.unit-display {
    background: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: 0 0 0 0.5rem;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.unit-arrow {
    border: none;
    width: 3rem;
    height: 4rem;
    border-radius: 0.5rem 0 0 0.5rem;
    cursor: pointer;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.4s ease;
}

.unit-section:not(.closed) .unit-arrow i {
    transform: rotate(180deg);
}

.unit-button {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.unit-button.left {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.unit-button.right {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.temperature, .wind-speed, .precipitation {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Weather Display === */

#weather-info {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 1.25rem;
    width: 100%;
}


.weather-section.active {
    display: block;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 600px;
    width: auto;
    height: auto;
}

.centered {
    text-align: center;
    padding: 1rem;
    font-size: 1.35rem;
}

.feels-like {
    font-size: 1.1rem;
    color: #494949;
    padding-bottom: 1rem;
}

.max-temp {
    color: #d9534f;
}

.min-temp {
    color: #53adc8;
}

.daily-major {
    padding-bottom: 1rem;
    border-bottom: 1px solid #ccc;
}

/* Current */
#current > div {
    background: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: 0.75rem;
}
#current-weather-emoji {
    font-size: 3rem;
}

#current-temperature {
    font-size: 2rem;
    font-weight: bold;
}

#current-feels-like {
    font-size: 1.25rem;
    color: #494949;
}

#current-weather-description {
    font-size: 1.5rem;
    font-style: italic;
    padding-bottom: 1rem;
}

#current-weather-details {
    font-size: 1.35rem;
    padding: 1.3rem 0;
}

/* Hourly and Daily */
#hourly, #daily {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #2f676e transparent;
}

#hourly > div, #daily > div {
    min-width: 14rem;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    scroll-snap-align: start;
    text-align: left;
}

#hourly h3, #daily h3 {
    margin-bottom: 0.75rem;
}

#hourly > div div, #daily > div div {
    margin: 0.5rem 0;
}

/* == Responsiveness == */  

@media only screen and (max-width: 770px) {
    main {
        padding: 2rem;
    }

    #weather-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .weather-section.active, #search-form input {
        min-width: 100%;
    }
}

@media only screen and (max-width: 435px) {
    main {
        padding: 1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    button, #weather-info, #current-feels-like {
        font-size: 1rem;
    }

    .unit-arrow {
        font-size: 1.25rem;
    }

    .unit-section {
        top: 11.5rem;
    }

    #search-form input {
        font-size: 0.875rem;
    }

    #location-selection {
        max-width: 100%;
    }

    #location-selection button {
        padding: 0.5rem 1rem;
    }

    .location-buttons {
        gap: 0.5rem;
    }

    .weather-section.active {
        padding: 1rem;
    }

    .centered, #current-weather-details {
        font-size: 1.15rem;
    }

    .centered {
        padding: 0rem;
        margin: 0rem;
    }

    #current-weather-emoji {
        font-size: 2.25rem;
    }

    #current-temperature {
        font-size: 1.5rem;
    }

    #current-weather-description {
        font-size: 1.25rem;
        font-style: italic;
        padding-bottom: 1rem;
    }

    #current-weather-details {
        padding: 1.3rem 0;
    }

    #hourly > div, #daily > div {
        min-width: 12rem;
    }
}