/* General styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

main {
    width: min(90%, 500px);
    margin: 50px auto;
    text-align: center;
    border-radius: 20px;
    overflow: hidden;
}

/* Search bar */
#search-form {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    margin: 35px auto 20px;
}

#search-form button {
    padding: 10px 14px;
    border: none;
    border-radius: 20px;
    background-color: white;
    color: #7779e8;
    cursor: pointer;
}

#city-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Current weather */
#weather {
    position: relative;
    background: linear-gradient(135deg, #999cff, #7779e8);
    color: white;
    padding: 40px 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px 20px 0 0;
}

#weather-content img {
    width: 100px;
    height: 100px;
    margin: 8px 0;
}

#weather p:first-of-type {
    font-size: 3.2rem;
    font-weight: 300;
    margin: 5px 0;
}

#weather-content h2 {
    font-size: 1.5rem;
    font-weight: normal;
    margin: 8px 0 4px;
}

.weather-description {
    margin: 2px 0 10px;
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Forecast */
#forecast {
    background-color: white;
    padding: 24px 25px;
}

#forecast>div {
    display: grid;
    grid-template-columns: 60px 60px 1fr;
    align-items: center;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #eeeeee;
}

#forecast>div:last-child {
    border-bottom: none;
}

#forecast h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

#forecast img {
    width: 40px;
    height: 40px;
    display: block;
    margin: auto;
}

#forecast p {
    margin: 0;
    text-align: right;
}

.forecast-info {
    text-align: right;
}

.forecast-info p {
    margin: 0;
}

.high-temperature {
    font-weight: 600;
}

.low-temperature {
    color: #aaa;
    margin-left: 12px;
    font-weight: 400;
}

.forecast-info p:first-child {
    font-weight: bold;
    margin-bottom: 3px;
}

.forecast-info p:last-child {
    font-size: 0.8rem;
    color: #888;
}

/* Sunrise and sunset */
.sun-times {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 18px;
    margin-bottom: 35px;
}

#weather .sun-times p {
    margin: 0;
    font-size: 0.85rem;
}

/* Navigation and buttons */
.menu-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    padding: 5px;
    line-height: 1;
    cursor: pointer;
}

.refresh-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: white;
    color: #7779e8;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Media query */

@media (min-width: 1200px) {
    main {
        width: min(80%, 700px);
    }

    #weather {
        padding-left: 40px;
        padding-right: 40px;
    }

    #forecast {
        padding-left: 40px;
        padding-right: 40px;
    }
}