:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --text-secondary: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    padding: 2rem 1rem;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    z-index: -1;
    transition: background 1s ease;
}

/* Dynamic Backgrounds */
.background-gradient.clear {
    background: linear-gradient(135deg, #fad961 0%, #f76b1c 100%);
    /* Softer Orange/Yellow */
}

.background-gradient.cloudy {
    background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
}

.background-gradient.rain {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}

.background-gradient.snow {
    background: linear-gradient(135deg, #83a4d4 0%, #b6fbff 100%);
}

.background-gradient.thunder {
    background: linear-gradient(135deg, #141E30 0%, #243B55 100%);
}

/* Rain Animation Effect */
.background-gradient.rain::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff' fill-opacity='0.1'%3E%3Crect x='10' y='0' width='1' height='5'/%3E%3C/svg%3E");
    animation: rainFall 1s linear infinite;
}

@keyframes rainFall {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 20px;
    }
}

/* Snow Animation Effect */
.background-gradient.snow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff' fill-opacity='0.2'%3E%3Ccircle cx='10' cy='10' r='1'/%3E%3C/svg%3E");
    animation: snowFall 5s linear infinite;
}

@keyframes snowFall {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 100px;
    }
}

.container {
    width: 100%;
    max-width: 480px;
}

.weather-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-form {
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.input-group button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.input-group button:hover {
    opacity: 1;
}

.weather-info {
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.location h2 {
    font-size: 2rem;
    font-weight: 600;
}

.location span {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-weather {
    margin: 2rem 0;
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

.details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

.alert.error {
    background: rgba(255, 87, 87, 0.2);
    border: 1px solid rgba(255, 87, 87, 0.4);
    color: #ffdede;
    padding: 1rem;
    background-position: 0 20px;
}


/* Snow Animation Effect */
.background-gradient.snow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff' fill-opacity='0.2'%3E%3Ccircle cx='10' cy='10' r='1'/%3E%3C/svg%3E");
    animation: snowFall 5s linear infinite;
}

@keyframes snowFall {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 100px;
    }
}

.container {
    width: 100%;
    max-width: 480px;
}

.weather-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-form {
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.input-group button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.input-group button:hover {
    opacity: 1;
}

.weather-info {
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.location h2 {
    font-size: 2rem;
    font-weight: 600;
}

.location span {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-weather {
    margin: 2rem 0;
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

.details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

.alert.error {
    background: rgba(255, 87, 87, 0.2);
    border: 1px solid rgba(255, 87, 87, 0.4);
    color: #ffdede;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Small icons for details */
.icon.small {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

/* Forecast Section */
.forecast-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.forecast-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: transform 0.2s;
}

.forecast-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.15);
}

.forecast-item .day {
    width: 60px;
    font-weight: 600;
}

.forecast-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon.tiny {
    width: 24px;
    height: 24px;
}

.temps {
    display: flex;
    gap: 1rem;
    width: 80px;
    justify-content: flex-end;
}

.search-form {
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.input-group button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.input-group button:hover {
    opacity: 1;
}

.weather-info {
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.location h2 {
    font-size: 2rem;
    font-weight: 600;
}

.location span {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-weather {
    margin: 2rem 0;
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

.details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

.alert.error {
    background: rgba(255, 87, 87, 0.2);
    border: 1px solid rgba(255, 87, 87, 0.4);
    color: #ffdede;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Small icons for details */
.icon.small {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

/* Forecast Section */
.forecast-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.forecast-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: transform 0.2s;
}

.forecast-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.15);
}

.forecast-item .day {
    width: 60px;
    font-weight: 600;
}

.forecast-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon.tiny {
    width: 24px;
    height: 24px;
}

.temps {
    display: flex;
    gap: 1rem;
    width: 80px;
    justify-content: flex-end;
}

.temps .max {
    font-weight: 600;
}

.temps .min {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-bottom: 1rem;
}

.footer .heart {
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}