:root {
    color-scheme: light;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Samsung One UI Cute Light Palette */
    --bg: #f4f7fc;
    --bg-gradient: linear-gradient(180deg, #f8fafc 0%, #eef2f9 100%);
    --panel: #ffffff;
    --panel-subtle: #f8fafc;
    --panel-hover: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;

    /* Cute Samsung Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-light: #eff6ff;
    --accent-sun: #f59e0b;
    --accent-sun-light: #fffbeb;
    --accent-rose: #ec4899;
    --accent-rose-light: #fdf2f8;
    --accent-mint: #10b981;
    --accent-mint-light: #ecfdf5;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #f5f3ff;

    --shadow-sm: 0 2px 8px rgba(148, 163, 184, 0.08);
    --shadow-md: 0 10px 25px -5px rgba(148, 163, 184, 0.12), 0 8px 10px -6px rgba(148, 163, 184, 0.04);
    --shadow-lg: 0 20px 35px -10px rgba(148, 163, 184, 0.18);

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* App Shell Layout */
.app-shell {
    width: min(100%, 720px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.app-shell.is-hidden {
    display: none;
}

/* Header & Navigation */
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-rose-light);
    color: var(--accent-rose);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 400px;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn,
.menu-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--panel-subtle);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.refresh-btn:hover,
.menu-toggle:hover {
    background: var(--panel-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--accent-blue);
    border-color: var(--accent-blue-light);
}

.refresh-btn:active,
.menu-toggle:active {
    transform: scale(0.94);
}

/* Now Header */
.now-header {
    display: flex;
    flex-direction: column;
    gap: 4px;

}

.eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-blue);
}

.location-name {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
}

#locationInput {
    border: none;
    outline: none;
    font-size: 24px;
    /* Increases the text and placeholder size */
    padding: 10px 15px;
    /* Adds breathing room inside the input box */
    width: 250px;
}

.condition-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
    margin: 2px 0 0;
}

/* Alert Banner */
.alert-banner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    animation: fadeIn 0.3s ease;
}

.alert-banner.hidden {
    display: none;
}

.alert-badge {
    background: #e53e3e;
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.alert-content strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.alert-copy {
    font-size: 0.88rem;
    margin-top: 2px;
    color: #9b2c2c;
}

/* Current Weather Main Temp Block */
.current-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.current-temp {
    font-size: clamp(4rem, 10vw, 5.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: var(--text);
    transition: color 0.3s ease;
}

.weather-icon {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    background: var(--panel-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.weather-icon:hover {
    transform: scale(1.06) rotate(3deg);
}

.weather-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.06));
}

/* Stat Pills Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--panel-subtle);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.stat-high {
    background: var(--accent-sun-light);
    border-color: #fde68a;
}

.stat-low {
    background: var(--accent-purple-light);
    border-color: #ddd6fe;
}

.stat-precip {
    background: var(--accent-blue-light);
    border-color: #bfdbfe;
}

.stat-sunset {
    background: var(--accent-rose-light);
    border-color: #fbcfe8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stat-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

/* Forecast Sections - Samsung One UI Card Style */
.forecast-section {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hourly Forecast Grid */
.hourly-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.hour-card {
    background: var(--panel-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.hour-card:hover {
    background: var(--panel);
    border-color: var(--accent-blue-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.hour-card .time {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.hour-card .icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
}

.hour-card .temp {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

/* Daily Forecast List */
.daily-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.daily-item {
    background: var(--panel-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.daily-item:hover {
    background: var(--panel);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.daily-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.daily-icon {
    width: 42px;
    height: 42px;
    background: var(--panel);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.day-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-item .day {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}

.daily-item .day-meta {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.rain-chance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: 4px;
}

.temps-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.temp-pill {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 800;
}

.temp-pill.high {
    background: var(--accent-sun-light);
    color: #d97706;
    border: 1px solid #fde68a;
}

.temp-pill.low {
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-card {
    background: var(--panel-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-icon {
    font-size: 1.2rem;
}

.detail-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

/* Radar Map Container */
.radar-map {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel-subtle);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.base-map-tiles {
    filter: saturate(0.8) contrast(1.05) brightness(0.98);
}

.leaflet-left,
.leaflet-top.leaflet-left {
    display: none !important;
}

/* One UI Bottom Sheet Modal */
.menu-panel {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}

.menu-panel.is-open {
    display: flex;
}

.menu-panel-inner {
    width: min(100%, 520px);
    padding: 28px 24px;
    background: var(--panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: popUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.menu-panel-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--panel-subtle);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.menu-close:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.zip-row {
    display: flex;
    gap: 10px;
}

.zip-input {
    flex: 1;
    border: 2px solid var(--border);
    background: var(--panel-subtle);
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zip-input:focus {
    border-color: var(--accent-blue);
    background: var(--panel);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#locationName {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.location-btn {
    border: none;
    background: var(--accent-blue);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0 22px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.location-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.location-btn:active {
    transform: scale(0.96);
}

.saved-locations {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.saved-location-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saved-location {
    flex: 1;
    border: 1px solid var(--border);
    background: var(--panel-subtle);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    color: var(--text);
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.saved-location:hover {
    background: var(--panel);
    border-color: var(--accent-blue-light);
    transform: translateX(2px);
}

.saved-location-label {
    flex: 1;
    text-align: left;
}

.saved-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--panel-subtle);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.saved-remove-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.saved-empty {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
#map-attribution-footer {
    padding: 20px 0 10px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    font-weight: 500;
}

#map-attribution-footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

#map-attribution-footer a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popUp {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

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

/* Responsive Tweaks */
@media (max-width: 640px) {
    body {
        padding: 12px 10px;
    }

    .hero-card {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .hourly-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hour-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 12px 16px;
    }

    .hour-card .time {
        margin-left: auto;
        text-align: right;
    }

    .forecast-section {
        padding: 18px 14px;
        border-radius: var(--radius-md);
    }

    .zip-row {
        flex-direction: column;
    }

    .location-btn {
        height: 44px;
    }
}