/* ═══════════════════════════════════════════════
   PREMIUM WEATHER DASHBOARD – Styles & Animations
   ═══════════════════════════════════════════════ */

:root {
    --primary: #FF9F1C;
    --secondary: #2EC4B6;
    --accent: #E71D36;
    --dark: #011627;
    --light: #FDFFFC;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --dark: #BAE6FD;
    /* Base Sky Blue */
    --light: #1E293B;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

[data-theme="light"] body {
    background: linear-gradient(180deg, #7DD3FC 0%, #BAE6FD 50%, #DBEAFE 100%);
    background-attachment: fixed;
}

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

body {
    font-family: 'Hind', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* ──────────────────────────────────────────
   1. LAYOUT STRUCTURE
   ────────────────────────────────────────── */

.app-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    /* Increased spacing */
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--light);
    background: var(--glass-bg);
    padding: 0.7rem 1.4rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.location-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    background: var(--glass-bg);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

/* Centered Clock Display */
.clock-display-section {
    text-align: center;
    margin: 0.5rem 0 1rem 0;
    animation: fadeIn 1.2s ease-out;
}

.live-clock-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: none;
    backdrop-filter: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.clock-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: 0.1rem;
}

.live-clock-main {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    background: var(--light);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .live-clock-main { font-size: 1.6rem; }
}


/* Hero Section */
.hero-section {
    text-align: center;
    padding: 1rem 0;
    animation: fadeIn 1.2s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weather-icon-large svg {
    width: 140px;
    height: 140px;
    margin-bottom: 1.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 30px rgba(255, 159, 28, 0.3));
}

.temp-group {
    margin-bottom: 0.5rem;
}

.temp-display {
    font-size: 9rem;
    font-weight: 700;
    line-height: 0.9;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--light) 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feels-like {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.6;
    margin-top: -0.5rem;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
    letter-spacing: -0.02em;
}

.temp-range {
    display: flex;
    gap: 2rem;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 600;
}

.range-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.2rem;
}

.range-icon.hi {
    color: #F87171;
}

.range-icon.lo {
    color: #60A5FA;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}


.detail-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 130px;
    transition: var(--transition);
}

.detail-card.wide {
    grid-column: 1 / -1;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.card-header svg {
    width: 18px;
    height: 18px;
}

.card-value {
    font-size: 2.1rem;
    font-weight: 700;
    font-family: 'Figtree', sans-serif;
    color: var(--light);
    letter-spacing: -0.01em;
}

.card-value small {
    font-size: 1rem;
    opacity: 0.5;
    margin-left: 0.2rem;
}

/* Multi-Value Row Styling (Wind Card) */
.multi-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.val-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.val-group .val {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Figtree', sans-serif;
    color: var(--secondary);
}

.val-group .lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.4;
    letter-spacing: 0.05em;
}

.separator-line {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

/* Rhythms Section */
.rhythms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 25px 0;
}

.rhythm-item {
    background: linear-gradient(135deg, var(--glass-bg), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.rhythm-item svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(255, 159, 28, 0.4));
}

.r-text .lbl {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.4;
    margin-bottom: 0.2rem;
}

.r-text .val {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* Detailed Forecast */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.5;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 800;
    text-align: center;
}

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

.forecast-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--glass-bg);
    padding: 1.2rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: scale(1.01);
}

.f-day {
    font-weight: 700;
    font-size: 1.1rem;
    width: 90px;
}

.f-icon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 60px;
}

.f-icon {
    width: 32px;
    height: 32px;
    color: var(--secondary);
}

.f-rain {
    font-size: 0.75rem;
    font-weight: 700;
    color: #60A5FA;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.f-rain svg {
    width: 12px;
    height: 12px;
}

.f-temp-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    justify-content: flex-end;
}

.f-temp-lo {
    opacity: 0.5;
    width: 45px;
    text-align: right;
    font-weight: 500;
    font-size: 1rem;
}

.f-temp-hi {
    font-weight: 700;
    width: 45px;
    font-size: 1.1rem;
}

.f-bar-track {
    flex: 1;
    max-width: 160px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.f-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #60A5FA, #FCD34D, #EF4444);
}

.app-footer {
    text-align: center;
    padding: 3rem 0;
    opacity: 0.25;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* ──────────────────────────────────────────
   2. REALISTIC ANIMATIONS (Enhanced)
   ────────────────────────────────────────── */

#weather-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Sun Effect */
.effect-sun {
    background: radial-gradient(circle at 60% 0%, rgba(255, 159, 28, 0.15), transparent 70%);
}

[data-theme="light"] .effect-sun {
    background: radial-gradient(circle at 65% 5%, rgba(255, 200, 100, 0.4), transparent 60%);
}

.sun-core {
    position: absolute;
    top: -80px;
    right: 120px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFF9C4 0%, #FFD54F 30%, #FF8F00 65%, transparent 100%);
    box-shadow: 0 0 120px 50px rgba(255, 143, 0, 0.15);
    animation: sunPulse 8s ease-in-out infinite;
}

@keyframes sunPulse {

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

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Moon Effect */
.effect-moon {
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.08), transparent 70%);
}

.moon-core {
    position: absolute;
    top: 40px;
    right: 100px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #e8e8e8;
    box-shadow: 0 0 80px 10px rgba(255, 255, 255, 0.1), inset -20px -15px 0 0 rgba(0, 0, 0, 0.08);
    animation: moonFloat 15s ease-in-out infinite;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 5s ease-in-out infinite var(--delay);
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.3);
    }
}

/* Premium Clouds */
.premium-cloud {
    position: absolute;
    top: var(--top);
    left: -400px;
    width: 350px;
    height: 120px;
    background: radial-gradient(circle at 30% 50%, rgba(200, 210, 220, 0.9) 0%, transparent 80%);
    filter: blur(45px);
    opacity: var(--opacity);
    animation: cloudMove var(--speed) linear infinite var(--delay);
}

[data-theme="light"] .premium-cloud {
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 1) 0%, transparent 90%);
    filter: blur(35px);
    opacity: 0.85;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}


@keyframes cloudMove {
    from {
        transform: translateX(0) scale(var(--scale));
    }

    to {
        transform: translateX(calc(100vw + 800px)) scale(var(--scale));
    }
}

/* Realistic Rain */
.rain-container {
    position: absolute;
    inset: 0;
    transform: rotate(12deg);
}

.rain-streak {
    position: absolute;
    top: -150px;
    width: 1px;
    height: var(--len);
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2));
    animation: rainDrop var(--dur) linear infinite var(--delay);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem;
        gap: 2.5rem;
    }

    .temp-display {
        font-size: 7rem;
    }

    .hero-section h2 {
        font-size: 2rem;
        margin: 0.5rem 0;
    }

    .details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .detail-card {
        padding: 1.2rem;
        min-height: 110px;
        border-radius: 20px;
    }

    .card-value {
        font-size: 1.6rem;
    }

    .val-group .val {
        font-size: 1.8rem;
    }

    .rhythms-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rhythm-item {
        padding: 1.2rem 1.5rem;
        border-radius: 20px;
    }

    .forecast-item {
        padding: 1rem;
        gap: 1rem;
        border-radius: 20px;
    }

    .f-day {
        width: 60px;
        font-size: 0.95rem;
    }

    .f-temp-bar {
        gap: 0.8rem;
    }

    .f-bar-track {
        max-width: 100px;
    }
}

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

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