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

body {
    min-height: 100vh;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 25px;

    background:
        linear-gradient(
            135deg,
            #4facfe,
            #00f2fe
        );

    transition:
        background 0.8s ease;

    color: #222;
}


/* APP */

.weather-app {
    width: 100%;
    max-width: 680px;

    background: rgba(255, 255, 255, 0.96);

    padding: 35px;

    border-radius: 25px;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.22);

    animation:
        appAppear 0.7s ease;

    transition:
        background 0.4s ease,
        color 0.4s ease;
}


@keyframes appAppear {

    from {
        opacity: 0;
        transform: translateY(25px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* HEADER */

.app-header {
    margin-bottom: 30px;
}


.header-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}


.app-header h1 {
    color: #222;

    font-size: 34px;

    margin-bottom: 10px;
}


.app-header p {
    color: #666;

    font-size: 15px;
}


/* DARK MODE BUTTON */

.theme-btn {
    width: 48px;

    height: 48px;

    border: none;

    border-radius: 50%;

    background: #eef7ff;

    font-size: 21px;

    cursor: pointer;

    transition:
        transform 0.3s ease,
        background 0.3s ease;
}


.theme-btn:hover {
    transform:
        rotate(20deg)
        scale(1.08);
}


/* SEARCH */

.search-box {
    display: flex;

    gap: 10px;

    margin-bottom: 12px;
}


.input-wrapper {
    flex: 1;

    position: relative;
}


.search-box input {
    width: 100%;

    padding: 14px 16px;

    border: 2px solid #e0e0e0;

    border-radius: 12px;

    font-size: 16px;

    outline: none;

    transition:
        border 0.3s ease,
        box-shadow 0.3s ease;
}


.search-box input:focus {
    border-color: #4facfe;

    box-shadow:
        0 0 0 3px
        rgba(79, 172, 254, 0.15);
}


.search-box button {
    border: none;

    padding: 14px 20px;

    border-radius: 12px;

    background: #168de2;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    transition:
        transform 0.3s ease,
        background 0.3s ease;
}


.search-box button:hover {
    background: #0875c1;

    transform:
        translateY(-2px);
}


/* SUGGESTIONS */

.suggestions {
    position: absolute;

    top: calc(100% + 5px);

    left: 0;

    right: 0;

    background: white;

    border-radius: 10px;

    box-shadow:
        0 10px 25px
        rgba(0, 0, 0, 0.15);

    overflow: hidden;

    z-index: 100;

    display: none;
}


.suggestion-item {
    padding: 12px 15px;

    cursor: pointer;

    border-bottom:
        1px solid #eee;

    color: #333;

    transition:
        background 0.2s ease;
}


.suggestion-item:hover {
    background: #f0f8ff;
}


/* LOCATION */

.location-btn {
    width: 100%;

    padding: 12px;

    border: 2px solid #168de2;

    border-radius: 12px;

    background: white;

    color: #168de2;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;

    margin-bottom: 25px;
}


.location-btn:hover {
    background: #168de2;

    color: white;

    transform:
        translateY(-2px);
}


/* WEATHER */

.weather-result {
    background: #f5f9ff;

    border-radius: 20px;

    padding: 25px;

    min-height: 220px;

    animation:
        resultAppear 0.5s ease;

    transition:
        background 0.4s ease;
}


@keyframes resultAppear {

    from {
        opacity: 0;

        transform:
            translateY(12px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* WELCOME */

.welcome-message {
    text-align: center;

    padding: 25px 10px;
}


.welcome-icon {
    font-size: 55px;

    margin-bottom: 10px;

    animation:
        floatIcon 3s ease-in-out infinite;
}


@keyframes floatIcon {

    0%,
    100% {
        transform:
            translateY(0);
    }

    50% {
        transform:
            translateY(-8px);
    }

}


.welcome-message h2 {
    color: #333;

    margin-bottom: 10px;
}


.welcome-message p {
    color: #777;
}


/* CURRENT WEATHER */

.current-weather {
    text-align: center;
}


.location {
    color: #222;

    font-size: 25px;

    margin-bottom: 5px;
}


.country {
    color: #777;

    margin-bottom: 10px;
}


.weather-icon {
    font-size: 70px;

    margin: 10px 0;

    animation:
        weatherFloat 3s
        ease-in-out infinite;
}


@keyframes weatherFloat {

    0%,
    100% {
        transform:
            translateY(0);
    }

    50% {
        transform:
            translateY(-7px);
    }

}


.weather-description {
    color: #555;

    font-size: 18px;

    margin-bottom: 10px;
}


.temperature {
    font-size: 58px;

    font-weight: bold;

    color: #168de2;

    margin: 10px 0;

    animation:
        temperatureAppear 0.6s ease;
}


@keyframes temperatureAppear {

    from {
        opacity: 0;

        transform:
            scale(0.8);
    }

    to {
        opacity: 1;

        transform:
            scale(1);
    }

}


.feels-like {
    color: #666;

    margin-bottom: 15px;
}


.current-time {
    color: #555;

    font-size: 14px;

    margin-bottom: 20px;
}


/* DETAILS */

.weather-details {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    margin-bottom: 25px;
}


.weather-detail {
    background: white;

    padding: 18px;

    border-radius: 15px;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.07);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.weather-detail:hover {
    transform:
        translateY(-5px);

    box-shadow:
        0 10px 25px
        rgba(0, 0, 0, 0.12);
}


.weather-detail-icon {
    font-size: 25px;

    display: block;

    margin-bottom: 8px;
}


.weather-detail strong {
    display: block;

    color: #333;

    font-size: 16px;
}


.weather-detail small {
    display: block;

    color: #777;

    margin-top: 4px;
}


/* SUN */

.sun-times {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    margin-bottom: 25px;
}


.sun-card {
    background: white;

    padding: 15px;

    border-radius: 15px;

    text-align: center;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.06);

    transition:
        transform 0.3s ease;
}


.sun-card:hover {
    transform:
        translateY(-4px);
}


.sun-card span {
    font-size: 25px;
}


.sun-card strong {
    display: block;

    margin-top: 7px;

    color: #333;
}


.sun-card small {
    color: #777;
}


/* FORECAST */

.forecast-title {
    text-align: center;

    color: #333;

    margin-bottom: 15px;
}


.forecast {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 8px;
}


.forecast-card {
    background: white;

    padding: 14px 8px;

    border-radius: 13px;

    text-align: center;

    box-shadow:
        0 4px 12px
        rgba(0, 0, 0, 0.06);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    animation:
        forecastAppear
        0.5s ease
        both;
}


.forecast-card:hover {
    transform:
        translateY(-6px);

    box-shadow:
        0 10px 20px
        rgba(0, 0, 0, 0.1);
}


.forecast-card:nth-child(2) {
    animation-delay: 0.05s;
}

.forecast-card:nth-child(3) {
    animation-delay: 0.1s;
}

.forecast-card:nth-child(4) {
    animation-delay: 0.15s;
}

.forecast-card:nth-child(5) {
    animation-delay: 0.2s;
}


@keyframes forecastAppear {

    from {
        opacity: 0;

        transform:
            translateY(12px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


.forecast-day {
    font-size: 13px;

    font-weight: bold;

    color: #555;
}


.forecast-icon {
    font-size: 30px;

    margin: 8px 0;
}


.forecast-temp {
    font-weight: bold;

    color: #168de2;

    font-size: 14px;
}


.forecast-low {
    color: #888;

    font-size: 12px;

    margin-top: 3px;
}


/* ERROR */

.error-message {
    text-align: center;

    padding: 30px 10px;
}


.error-message h2 {
    color: #d9534f;

    margin-bottom: 10px;
}


.error-message p {
    color: #777;
}


/* =========================
   DARK MODE
========================= */

body.dark {
    color: #eee;
}


body.dark .weather-app {
    background:
        rgba(25, 31, 45, 0.97);

    color: #eee;
}


body.dark .app-header h1,
body.dark .location,
body.dark .weather-detail strong,
body.dark .sun-card strong,
body.dark .forecast-title,
body.dark .welcome-message h2 {
    color: #f5f5f5;
}


body.dark .app-header p,
body.dark .country,
body.dark .feels-like,
body.dark .current-time,
body.dark .welcome-message p,
body.dark .weather-description {
    color: #b8beca;
}


body.dark .weather-result {
    background:
        rgba(15, 23, 42, 0.9);
}


body.dark .weather-detail,
body.dark .sun-card,
body.dark .forecast-card {
    background:
        #202938;
}


body.dark .weather-detail small,
body.dark .sun-card small,
body.dark .forecast-low,
body.dark .forecast-day {
    color: #aeb6c4;
}


body.dark .search-box input {
    background: #202938;

    border-color: #3a4558;

    color: white;
}


body.dark .search-box input::placeholder {
    color: #9ca3af;
}


body.dark .location-btn {
    background: transparent;

    color: #67b8ff;
}


body.dark .location-btn:hover {
    background: #168de2;

    color: white;
}


body.dark .theme-btn {
    background: #303a4d;
}


body.dark .suggestions {
    background: #202938;
}


body.dark .suggestion-item {
    color: white;

    border-color: #3a4558;
}


body.dark .suggestion-item:hover {
    background: #303a4d;
}


/* MOBILE */

@media (max-width: 600px) {

    body {
        padding: 10px;

        align-items:
            flex-start;
    }


    .weather-app {
        margin-top: 10px;

        padding:
            22px 15px;

        border-radius: 20px;
    }


    .header-top {
        align-items:
            flex-start;
    }


    .app-header h1 {
        font-size: 27px;
    }


    .app-header p {
        font-size: 13px;

        line-height: 1.5;
    }


    .theme-btn {
        flex-shrink: 0;
    }


    .search-box {
        flex-direction:
            column;
    }


    .search-box button {
        width: 100%;
    }


    .weather-result {
        padding: 18px 12px;
    }


    .weather-details {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .forecast {
        display: flex;

        overflow-x: auto;

        padding-bottom: 8px;
    }


    .forecast-card {
        min-width: 78px;

        flex-shrink: 0;
    }


    .temperature {
        font-size: 48px;
    }


    .weather-icon {
        font-size: 60px;
    }

}