:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #0f0c29;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Global Base Shadow */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 300% 300%;
    /* Continuous Flow Animation remains */
    animation: gradientMove 15s ease infinite;
    z-index: -2;
    transition: opacity 2.5s ease-in-out;
    /* Slower cross-fade */
}

.bg-layer.active {
    opacity: 1;
    z-index: -1;
}

.bg-layer.next {
    opacity: 0;
    z-index: -1;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Noise - Darkened slightly to help contrast */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.06'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.background-mesh {
    display: none;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.weather-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 380px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: auto;
    /* Darker overlay for contrast */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);

    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 1s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    /* Increased from 0.95rem (+25%) */
    color: #fff;
    /* Heavy Shadow 1 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 16px;
    /* Slightly larger padding */
    border-radius: 20px;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
    /* Specific increase for badge text */
}

.location-badge:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.weather-main {
    margin-bottom: 2.5rem;
}

.temp-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 1rem 0;
}

#temperature {
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    /* Heavy Shadow 2: Multi-layer */
    text-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.2);
}

.unit {
    font-size: 2rem;
    margin-top: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#condition-text {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.glass-inner {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.4rem;
    /* More padding */
    display: flex;
    justify-content: space-around;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* More gap */
}

.detail-item .label {
    font-size: 1.0rem;
    /* Increased from 0.8rem (+25%) */
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.detail-item .value {
    font-weight: 600;
    font-size: 1.35rem;
    /* Increased from 1.1rem (~+22%) */
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}

.weather-icon-container {
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
}

.icon.sunny {
    background: #fff59d;
    box-shadow: 0 0 60px rgba(255, 245, 157, 0.8);
    /* Brighter glow */
    animation: sunPulse 4s infinite ease-in-out;
}

.icon.cloudy {
    background: #cfd8dc;
    box-shadow: 20px -10px 0 0 #eceff1, -20px 5px 0 0 #b0bec5;
    border-radius: 20px;
    width: 54px;
    height: 22px;
    animation: floatCloud 4s infinite ease-in-out;
}

.icon.cloudy::after {
    top: -22px;
    left: 10px;
    width: 34px;
    height: 34px;
    background: #eceff1;
}

.icon.rainy {
    background: #78909c;
    width: 60px;
    height: 60px;
    overflow: visible;
}

.icon.rainy::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 10px;
    background: #81d4fa;
    top: 70px;
    left: 20px;
    animation: rainDrop 1.2s infinite linear;
    box-shadow: 12px 14px 0 #81d4fa, -12px 6px 0 #81d4fa;
}

@keyframes sunPulse {

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

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

@keyframes floatCloud {

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

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

@keyframes rainDrop {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }

    100% {
        transform: translateY(25px);
        opacity: 0;
    }
}