* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.4s ease;
}

/* Main container */

.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    color: white;
}

/* Title */

h1 {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
    font-size: 32px;
    letter-spacing: 0.5px;
}

/* Search section */

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
}

button {
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    cursor: pointer;
    background: white;
    color: #1e3c72;
    font-weight: bold;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

/* Weather card */

.weather-card {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    padding: 24px;
    min-height: 180px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-align: center;
}

.weather-icon {
    font-size: 58px;
    margin-bottom: 10px;
}

.weather-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

/* Large temperature display */

.temperature {
    font-size: 52px;
    font-weight: bold;
    margin: 8px 0 18px;
}

/* Weather details */

.weather-card p {
    margin: 8px 0;
    font-size: 17px;
    line-height: 1.4;
}

.weather-card .label {
    font-weight: bold;
    opacity: 0.9;
}

/* Weather background themes */

.sunny-bg {
    background: linear-gradient(135deg, #f7971e, #ffd200);
}

.cloudy-bg {
    background: linear-gradient(135deg, #757f9a, #d7dde8);
}

.rainy-bg {
    background: linear-gradient(135deg, #314755, #26a0da);
}

.snowy-bg {
    background: linear-gradient(135deg, #83a4d4, #b6fbff);
}

.stormy-bg {
    background: linear-gradient(135deg, #232526, #414345);
}

.foggy-bg {
    background: linear-gradient(135deg, #606c88, #3f4c6b);
}

.forecast {
    margin: 20px;
}

.forecast h3 {
    margin-bottom: 12px;
    font-size: 20px;
    text-align: left;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}

.forecast-day {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.forecast-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

.forecast-temp {
    font-size: 14px;
    line-height: 1.4;
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.weather-card {
    transition: all 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-3px);
}

.footer {
    margin-top: 20px;
    font-size: 12px;
    text-align: center;
    opacity: 0.7;
}

.background-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

/* Rain */
.raindrop {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 18px;
    background: rgba(255, 255, 255, 0.5);
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }

    100% {
        transform: translateY(110vh);
        opacity: 0.1;
    }
}

/* Snow */
.snowflake {
    position: absolute;
    top: -20px;
    color: white;
    font-size: 14px;
    opacity: 0.8;
    animation: snow-fall linear infinite;
}

@keyframes snow-fall {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(110vh) translateX(20px);
    }
}

/* Sun Glow */
.sun-glow {
    position: absolute;
    top: 60px;
    right: 80px;
    width: 140px;
    height: 140px;
    background: rgba(255, 223, 100, 0.35);
    filter: blur(20px);
    animation: pulse-glow 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.1;
    }
}