/* ============================================================
   WEATHERNOW - Modern Weather Dashboard
   Style: Minimal, Clean, Professional
   ============================================================ */

/* ----- CSS Custom Properties (Light Theme - Default) ----- */
:root {
    /* Colors */
    --color-primary: #2196F3;
    --color-primary-dark: #1976D2;
    --color-primary-light: #BBDEFB;
    --color-primary-gradient: linear-gradient(135deg, #2196F3, #1565C0);

    --color-bg: #F5F7FA;
    --color-bg-card: #FFFFFF;
    --color-bg-card-hover: #F8FAFB;
    --color-bg-input: #F0F4F8;

    --color-text-primary: #1a1a2e;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;

    --color-border: #E5E7EB;
    --color-border-focus: #2196F3;

    --color-error-bg: #FEF2F2;
    --color-error-text: #DC2626;
    --color-error-border: #FECACA;

    --color-success: #10B981;
    --color-warning: #F59E0B;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.12);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Container */
    --container-max: 1100px;

    /* Weather-specific colors */
    --weather-clear: #FF9800;
    --weather-clouds: #90A4AE;
    --weather-rain: #42A5F5;
    --weather-snow: #E3F2FD;
    --weather-thunder: #7C4DFF;
    --weather-mist: #B0BEC5;
    --weather-drizzle: #64B5F6;
}

/* ----- Dark Theme ----- */
[data-theme="dark"] {
    --color-primary: #64B5F6;
    --color-primary-dark: #42A5F5;
    --color-primary-light: #1E3A5F;
    --color-primary-gradient: linear-gradient(135deg, #64B5F6, #2196F3);

    --color-bg: #0F0F1A;
    --color-bg-card: #1A1A2E;
    --color-bg-card-hover: #222240;
    --color-bg-input: #252542;

    --color-text-primary: #E5E7EB;
    --color-text-secondary: #9CA3AF;
    --color-text-muted: #6B7280;

    --color-border: #2D2D4A;
    --color-border-focus: #64B5F6;

    --color-error-bg: #3B1A1A;
    --color-error-text: #FCA5A5;
    --color-error-border: #7F1D1D;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -6px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.4);
}

/* ----- CSS Reset & Base ----- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: var(--font-weight-regular);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- Container ----- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ----- Fluid Typography (applied at root) ----- */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    touch-action: manipulation;
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----- Focus Styles for Accessibility ----- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ----- Screen-Reader Only (visually hidden) ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Skip-to-content link (appears on focus) ----- */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: 10000;
    padding: 12px 24px;
    background: var(--color-primary);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-decoration: none;
    transition: top 200ms ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-primary-light);
    outline-offset: 0;
}

/* ----- Utility: Hidden (accessible) ----- */
[hidden] {
    display: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: opacity var(--transition-fast);
}

.header__brand:hover {
    opacity: 0.85;
}

.header__logo {
    font-size: 28px;
    line-height: 1;
}

.header__title {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn--primary {
    background: var(--color-primary-gradient);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn--primary:hover {
    box-shadow: 0 4px 14px rgba(33, 150, 243, 0.4);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0) scale(0.97);
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--color-bg-input);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.btn--icon:hover {
    background: var(--color-bg-card-hover);
    color: var(--color-text-primary);
    border-color: var(--color-primary);
}

.btn--icon svg {
    width: 20px;
    height: 20px;
}

.btn--location {
    font-size: 18px;
}

.theme-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform var(--transition-base);
}

[data-theme="dark"] .theme-icon {
    transform: rotate(360deg);
}

/* ============================================================
   SEARCH SECTION
   ============================================================ */

.search-section {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.search-form__wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 4px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.search-form__wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light), var(--shadow-md);
}

.search-form__icon {
    flex-shrink: 0;
    margin-left: var(--space-md);
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.search-form__wrapper:focus-within .search-form__icon {
    color: var(--color-primary);
}

.search-form__input {
    flex: 1;
    min-width: 0;
    padding: 12px var(--space-md);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    background: transparent;
    border: none;
    outline: none;
}

.search-form__input::placeholder {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-regular);
}

.search-form__btn {
    flex-shrink: 0;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */

.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: 12px var(--space-md);
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    animation: slideDown 300ms ease forwards;
}

.error-message::before {
    content: '⚠️';
    font-size: 16px;
}

/* ============================================================
   RECENT SEARCHES
   ============================================================ */

.recent-searches {
    margin-bottom: var(--space-lg);
    animation: fadeIn 400ms ease forwards;
}

.section-title {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.recent-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    background: var(--color-primary-light);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.recent-item::before {
    content: '🕐';
    font-size: 12px;
    opacity: 0.7;
}

.recent-item:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.recent-item:active {
    transform: scale(0.95);
}

/* Recent Item Wrapper (for delete button positioning) */
.recent-item-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Delete button on each recent search item */
.recent-item__delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.recent-item-wrapper:hover .recent-item__delete,
.recent-item__delete:focus-visible {
    opacity: 1;
}

.recent-item__delete:hover {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border-color: var(--color-error-border);
    transform: scale(1.1);
}

/* Clear All button */
.recent-item__clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
}

.recent-item__clear:hover {
    color: var(--color-error-text);
    background: var(--color-error-bg);
    border-color: var(--color-error-border);
}

@media (max-width: 480px) {
    .recent-item__delete {
        width: 18px;
        height: 18px;
        top: -5px;
        right: -5px;
        opacity: 1;
    }
    .recent-item__clear {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ============================================================
   LOADING SKELETON (Shimmer)
   ============================================================ */

.loading {
    animation: fadeIn 300ms ease forwards;
}

/* Shimmer keyframe — a moving gradient sweep */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

/* Shared shimmer gradient for light & dark themes */
:root {
    --skeleton-base: #E5E7EB;
    --skeleton-shine: #F3F4F6;
    --skeleton-radius: var(--radius-md);
}

[data-theme="dark"] {
    --skeleton-base: #2D2D4A;
    --skeleton-shine: #3A3A5C;
}

.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 30%, var(--skeleton-shine) 50%, var(--skeleton-base) 70%);
    background-size: 400px 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--skeleton-radius);
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

/* --- Current Weather Skeleton --- */
.skeleton-current {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    border: 1px solid var(--color-border);
}

.skeleton-current__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.skeleton-current__location {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-current__city {
    width: 180px;
    height: 28px;
}

.skeleton-current__datetime {
    width: 260px;
    height: 14px;
}

.skeleton-current__unit-toggle {
    width: 80px;
    height: 32px;
}

.skeleton-current__body {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.skeleton-current__icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-current__temp-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.skeleton-current__temp {
    width: 140px;
    height: 56px;
}

.skeleton-current__condition {
    width: 100px;
    height: 18px;
}

.skeleton-current__details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.skeleton-current__detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
}

.skeleton-current__detail-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.skeleton-current__detail-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.skeleton-current__detail-label {
    width: 60%;
    height: 12px;
}

.skeleton-current__detail-value {
    width: 80%;
    height: 16px;
}

/* --- Hourly Forecast Skeleton --- */
.skeleton-hourly {
    display: flex;
    gap: var(--space-sm);
    overflow: hidden;
    padding: var(--space-sm) 0;
}

.skeleton-hourly__card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 90px;
}

.skeleton-hourly__time {
    width: 40px;
    height: 14px;
}

.skeleton-hourly__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-hourly__temp {
    width: 48px;
    height: 18px;
}

/* --- 5-Day Forecast Skeleton --- */
.skeleton-forecast {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

.skeleton-forecast__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: var(--space-lg) var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.skeleton-forecast__day {
    width: 60px;
    height: 16px;
}

.skeleton-forecast__date {
    width: 50px;
    height: 12px;
}

.skeleton-forecast__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.skeleton-forecast__condition {
    width: 70px;
    height: 14px;
}

.skeleton-forecast__temps {
    width: 90px;
    height: 16px;
}

/* ============================================================
   LOADING SPINNER (fallback)
   ============================================================ */

.loading__spinner {
    display: flex;
    gap: 8px;
}

.loading__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading__dot:nth-child(1) { animation-delay: -0.32s; }
.loading__dot:nth-child(2) { animation-delay: -0.16s; }
.loading__dot:nth-child(3) { animation-delay: 0s; }

.loading__text {
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
    animation: fadeIn 600ms ease forwards;
}

.empty-state__icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
    animation: float 3s ease-in-out infinite;
}

.empty-state__title {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state__text {
    font-size: 16px;
    color: var(--color-text-secondary);
    max-width: 300px;
}

/* ============================================================
   WEATHER DISPLAY CONTAINER
   ============================================================ */

.weather-display {
    animation: fadeInUp 600ms ease forwards;
}

/* ============================================================
   CURRENT WEATHER CARD
   ============================================================ */

.current-weather {
    margin-bottom: var(--space-xl);
}

.current-weather__card {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

/* Weather background effects */
.current-weather__card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(30%, -30%);
    background: var(--color-primary);
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.current-weather__card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0.04;
    transform: translate(-20%, 20%);
    background: var(--color-primary);
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.current-weather__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.current-weather__location-group {
    flex: 1;
    min-width: 200px;
}

.current-weather__city {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.current-weather__country {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.current-weather__datetime {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.current-weather__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.current-weather__icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.current-weather__icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.current-weather__temp-group {
    flex: 1;
    min-width: 150px;
}

.current-weather__temp {
    font-size: 64px;
    font-weight: var(--font-weight-extrabold);
    line-height: 1;
    color: var(--color-text-primary);
    letter-spacing: -2px;
}

.current-weather__temp-unit {
    font-size: 32px;
    font-weight: var(--font-weight-light);
    color: var(--color-text-muted);
    vertical-align: super;
}

.current-weather__condition {
    font-size: 18px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: capitalize;
    margin-top: var(--space-xs);
}

.current-weather__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.weather-detail {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.weather-detail:hover {
    background: var(--color-bg-card-hover);
}

.weather-detail__icon {
    flex-shrink: 0;
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
}

.weather-detail__info {
    min-width: 0;
}

.weather-detail__label {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-detail__value {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

/* ============================================================
   HOURLY FORECAST (with draggable scrollbar)
   ============================================================ */

.hourly-forecast {
    margin-bottom: var(--space-xl);
}

.hourly-forecast__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

/* --- Scroll Wrapper --- */
.hourly-forecast__scroll-wrapper {
    position: relative;
}

/* --- Navigation Arrows --- */
.hourly-forecast__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.hourly-forecast__scroll-wrapper:hover .hourly-forecast__nav,
.hourly-forecast__nav:focus-visible {
    opacity: 1;
}

.hourly-forecast__nav:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
}

.hourly-forecast__nav:active {
    transform: translateY(-50%) scale(0.95);
}

.hourly-forecast__nav--prev {
    left: -6px;
}

.hourly-forecast__nav--next {
    right: -6px;
}

/* --- Scroll Container (drag-to-scroll + snap) --- */
.hourly-forecast__scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-sm) 0 var(--space-sm);
    scroll-snap-type: x mandatory;
    scroll-snap-stop: normal;
    scroll-padding: 0 var(--space-lg);
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    scrollbar-width: none;
}

.hourly-forecast__scroll::-webkit-scrollbar {
    display: none;
}

.hourly-forecast__scroll--dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

/* --- Custom Draggable Scrollbar --- */
.hourly-forecast__scrollbar {
    position: relative;
    width: 100%;
    height: 6px;
    margin-top: var(--space-sm);
    background: var(--color-bg-input);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: height var(--transition-fast);
}

.hourly-forecast__scrollbar:hover {
    height: 8px;
}

.hourly-forecast__scrollbar-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.hourly-forecast__scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 40px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    cursor: grab;
    transition: width 200ms ease, background var(--transition-fast);
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.3);
}

.hourly-forecast__scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

.hourly-forecast__scrollbar-thumb--dragging {
    cursor: grabbing;
    background: var(--color-primary-dark);
}

/* --- Hourly Cards --- */
.hourly-card {
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    min-width: 90px;
    transition: all var(--transition-fast);
    pointer-events: auto;
}

.hourly-card:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hourly-card__time {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.hourly-card__icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.hourly-card__temp {
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* ============================================================
   AIR QUALITY INDEX
   ============================================================ */

.air-quality {
    margin-bottom: var(--space-xl);
}

.aqi-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.aqi-card__body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

/* AQI Gauge */
.aqi-gauge {
    flex: 1;
    min-width: 200px;
}

.aqi-gauge__bg {
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #10B981 0%, #F59E0B 25%, #F97316 50%, #EF4444 75%, #8B5CF6 100%);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.aqi-gauge__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px currentColor;
    opacity: 0.85;
}

.aqi-gauge__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 9px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.aqi-gauge__labels span {
    flex: 1;
    text-align: center;
}

.aqi-gauge__labels span:first-child {
    text-align: left;
}

.aqi-gauge__labels span:last-child {
    text-align: right;
}

/* AQI Badge */
.aqi-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    border: 2px solid;
    flex-shrink: 0;
}

.aqi-badge__icon {
    font-size: 28px;
    line-height: 1;
}

.aqi-badge__info {
    display: flex;
    flex-direction: column;
}

.aqi-badge__value {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

.aqi-badge__label {
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* AQI Components */
.aqi-components {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    flex: 1;
    min-width: 200px;
}

.aqi-component {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    background: var(--color-bg-input);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.aqi-component:hover {
    background: var(--color-bg-card-hover);
}

.aqi-component__label {
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aqi-component__value {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.aqi-component__unit {
    font-size: 10px;
    font-weight: var(--font-weight-regular);
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .aqi-card__body {
        flex-direction: column;
    }
    .aqi-gauge {
        width: 100%;
        min-width: 0;
    }
    .aqi-badge {
        align-self: center;
    }
    .aqi-components {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .aqi-card {
        padding: var(--space-lg) var(--space-md);
    }
    .aqi-components {
        grid-template-columns: repeat(2, 1fr);
    }
    .aqi-gauge__labels span:nth-child(2),
    .aqi-gauge__labels span:nth-child(4) {
        display: none;
    }
}

/* ============================================================
   5-DAY FORECAST
   ============================================================ */

.forecast {
    margin-bottom: var(--space-xl);
}

.forecast__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

.forecast-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: all var(--transition-base);
    animation: fadeInUp 500ms ease forwards;
    opacity: 0;
}

.forecast-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.forecast-card:nth-child(1) { animation-delay: 50ms; }
.forecast-card:nth-child(2) { animation-delay: 100ms; }
.forecast-card:nth-child(3) { animation-delay: 150ms; }
.forecast-card:nth-child(4) { animation-delay: 200ms; }
.forecast-card:nth-child(5) { animation-delay: 250ms; }

.forecast-card__day {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.forecast-card__date {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.forecast-card__icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.forecast-card__condition {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: capitalize;
}

.forecast-card__temps {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
}

.forecast-card__temp-max {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.forecast-card__temp-min {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.forecast-card__temp-sep {
    color: var(--color-border);
}

/* ============================================================
   UNIT TOGGLE BUTTON INSIDE CURRENT WEATHER
   ============================================================ */

.unit-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    background: var(--color-primary-light);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.unit-toggle-btn:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.unit-toggle-btn:active {
    transform: scale(0.95);
}

/* ============================================================
   WEATHER CONDITION ANIMATIONS (UPGRADED)
   ============================================================ */

/* ====================== SHARED ====================== */
.rain-drop,
.snow-flake,
.sun-sparkle,
.night-star,
.cloud-float,
.rain-splash,
.fog-layer {
    pointer-events: none;
    will-change: transform, opacity;
}

/* ====================== SUNNY / CLEAR (DAY) ====================== */

.sun-animation {
    position: absolute;
    z-index: 1;
    top: -20px;
    right: 50px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #FFF176, #FFB300 60%, #FF8F00);
    box-shadow:
        0 0 40px rgba(255, 193, 7, 0.4),
        0 0 80px rgba(255, 193, 7, 0.2),
        0 0 120px rgba(255, 193, 7, 0.1);
    animation: sunPulse 4s ease-in-out infinite;
    pointer-events: none;
}

.sun-rays {
    position: absolute;
    z-index: 0;
    top: -40px;
    right: 30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 235, 59, 0.08) 10deg, transparent 20deg, rgba(255, 235, 59, 0.08) 30deg, transparent 40deg, rgba(255, 235, 59, 0.08) 50deg, transparent 60deg, rgba(255, 235, 59, 0.08) 70deg, transparent 80deg, rgba(255, 235, 59, 0.08) 90deg, transparent 100deg, rgba(255, 235, 59, 0.08) 110deg, transparent 120deg);
    animation: sunRotate 20s linear infinite;
    pointer-events: none;
}

.sun-sparkle {
    position: absolute;
    z-index: 2;
    width: 3px;
    height: 3px;
    background: #FFD54F;
    border-radius: 50%;
    box-shadow: 0 0 4px #FFD54F, 0 0 8px rgba(255, 213, 79, 0.5);
    animation: sparkleFloat 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sunPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 193, 7, 0.4), 0 0 80px rgba(255, 193, 7, 0.2), 0 0 120px rgba(255, 193, 7, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 193, 7, 0.6), 0 0 120px rgba(255, 193, 7, 0.3), 0 0 160px rgba(255, 193, 7, 0.15);
        transform: scale(1.05);
    }
}

@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sparkleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    25% { opacity: 0.8; }
    50% { opacity: 0; transform: translateY(-30px) scale(1.2); }
    75% { opacity: 0.4; }
}

/* ====================== CLEAR (NIGHT) ====================== */

.moon-animation {
    position: absolute;
    z-index: 1;
    top: 10px;
    right: 60px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #FFFFFF, #E8EAF6 70%, #C5CAE9);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 0 60px rgba(197, 202, 233, 0.15);
    animation: moonGlow 6s ease-in-out infinite;
    pointer-events: none;
}

.moon-animation::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-bg-card);
    pointer-events: none;
}

.night-star {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
    animation: starTwinkle 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes moonGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 0 60px rgba(197, 202, 233, 0.15); }
    50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.4), 0 0 80px rgba(197, 202, 233, 0.2); }
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ====================== RAIN ====================== */

.rain-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(100, 150, 200, 0.05) 0%, rgba(66, 165, 245, 0.08) 100%);
    pointer-events: none;
}

.rain-drop {
    position: absolute;
    z-index: 1;
    width: 2px;
    background: linear-gradient(180deg, transparent, rgba(174, 214, 241, 0.7));
    animation: rainFall 0.9s linear infinite;
    opacity: 0.4;
    pointer-events: none;
    border-radius: 0 0 1px 1px;
}

.rain-splash {
    position: absolute;
    z-index: 2;
    bottom: 10px;
    width: 6px;
    height: 2px;
    background: rgba(174, 214, 241, 0.4);
    border-radius: 50%;
    animation: splashBurst 0.8s ease-out infinite;
    pointer-events: none;
}

@keyframes rainFall {
    0% { transform: translateY(-20px); opacity: 0; }
    8% { opacity: 0.7; }
    100% { transform: translateY(250px); opacity: 0; }
}

@keyframes splashBurst {
    0% { opacity: 0.6; transform: scaleX(0.3); }
    50% { opacity: 0.3; transform: scaleX(2); }
    100% { opacity: 0; transform: scaleX(3); }
}

/* ====================== SNOW ====================== */

.snow-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.06) 100%);
    pointer-events: none;
}

.snow-flake {
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    background: #FFFFFF;
    opacity: 0.7;
    filter: blur(0.5px);
    animation: snowFall 4s linear infinite;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

@keyframes snowFall {
    0% {
        transform: translateY(-10px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(260px) translateX(var(--drift, 50px)) rotate(360deg);
        opacity: 0;
    }
}

/* ====================== CLOUDS (PARALLAX) ====================== */

.cloud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cloud-layer--back {
    z-index: 0;
}

.cloud-layer--mid {
    z-index: 1;
}

.cloud-layer--front {
    z-index: 2;
}

.cloud-float {
    position: absolute;
    background: linear-gradient(135deg, rgba(144, 164, 174, 0.12), rgba(144, 164, 174, 0.08));
    border-radius: 50px;
    animation: cloudDrift ease-in-out infinite;
    pointer-events: none;
}

.cloud-float::before,
.cloud-float::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-float::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 15px;
}

.cloud-float::after {
    width: 30px;
    height: 30px;
    top: -14px;
    left: 45px;
}

@keyframes cloudDrift {
    0%, 100% { transform: translateX(-30px); opacity: 0.5; }
    50% { transform: translateX(30px); opacity: 1; }
}

/* ====================== THUNDER / STORM ====================== */

.storm-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 30, 60, 0.1) 0%, rgba(40, 40, 70, 0.15) 100%);
    pointer-events: none;
}

.rain-drop--storm {
    width: 3px;
    background: linear-gradient(180deg, transparent, rgba(200, 210, 230, 0.8));
    animation-duration: 0.5s;
    opacity: 0.5;
}

.rain-splash--storm {
    background: rgba(200, 210, 230, 0.6);
}

.thunder-flash {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    animation: thunderFlash 4s infinite;
    pointer-events: none;
}

@keyframes thunderFlash {
    0%, 100% { opacity: 0; }
    91% { opacity: 0; }
    92% { opacity: 0.7; background: rgba(255, 255, 255, 0.12); }
    93% { opacity: 0; }
    94% { opacity: 0.4; background: rgba(255, 255, 255, 0.08); }
    95% { opacity: 0; }
}

/* ====================== MIST / FOG ====================== */

.fog-layer {
    position: absolute;
    left: 0;
    width: 200%;
    height: 80px;
    background: linear-gradient(90deg, transparent 0%, rgba(176, 190, 197, 0.08) 25%, rgba(176, 190, 197, 0.12) 50%, rgba(176, 190, 197, 0.08) 75%, transparent 100%);
    animation: fogDrift 20s linear infinite;
    pointer-events: none;
    filter: blur(8px);
}

@keyframes fogDrift {
    0% { transform: translateX(-25%); }
    100% { transform: translateX(25%); }
}

/* ====================== RESPONSIVE ANIMATIONS ====================== */

@media (max-width: 768px) {
    .sun-animation {
        width: 56px;
        height: 56px;
        top: -14px;
        right: 30px;
    }
    .sun-rays {
        width: 84px;
        height: 84px;
        top: -28px;
        right: 16px;
    }
    .moon-animation {
        width: 40px;
        height: 40px;
        right: 40px;
    }
    .moon-animation::before {
        width: 32px;
        height: 32px;
        top: 6px;
        left: -6px;
    }
    .rain-drop { animation-duration: 0.6s; }
    .snow-flake { animation-duration: 3s; }
    .fog-layer { height: 50px; }
    .night-star { display: none; }
    .sun-sparkle { display: none; }
}

@media (max-width: 480px) {
    .sun-animation {
        width: 44px;
        height: 44px;
        top: -12px;
        right: 20px;
    }
    .sun-rays {
        width: 64px;
        height: 64px;
        top: -20px;
        right: 10px;
        animation-duration: 15s;
    }
    .moon-animation {
        width: 32px;
        height: 32px;
        right: 28px;
        top: 8px;
    }
    .moon-animation::before {
        width: 26px;
        height: 26px;
        top: 4px;
        left: -4px;
    }
    .rain-drop { animation-duration: 0.5s; opacity: 0.3; }
    .rain-splash { display: none; }
    .snow-flake { animation-duration: 2.5s; }
    .cloud-float { animation-duration: 10s !important; }
    .fog-layer { height: 36px; }
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    margin-top: var(--space-2xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-card);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

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

.footer__text {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.footer__version {
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

.footer__link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: opacity var(--transition-fast);
}

.footer__link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================================
   SCROLL STYLING
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* --- Large Desktop: 1200px+ --- */
@media (min-width: 1200px) {
    .container {
        padding: 0 var(--space-2xl);
    }

    .current-weather__card {
        padding: var(--space-3xl) var(--space-2xl);
    }

    .current-weather__city {
        font-size: 32px;
    }

    .current-weather__temp {
        font-size: 72px;
    }

    .current-weather__temp-unit {
        font-size: 36px;
    }

    .current-weather__icon {
        width: 120px;
        height: 120px;
    }

    .current-weather__details {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }

    .forecast-card {
        padding: var(--space-xl) var(--space-lg);
    }
}

/* --- Desktop & Tablet Landscape: up to 1024px --- */
@media (max-width: 1024px) {
    .forecast__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .current-weather__details {
        grid-template-columns: repeat(3, 1fr);
    }

    .header__title {
        font-size: 19px;
    }

    .hourly-card {
        min-width: 84px;
        padding: var(--space-sm) var(--space-md);
    }
}

/* --- Tablet Portrait: up to 768px --- */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }

    /* Header */
    .header__inner {
        height: 56px;
    }

    .header__title {
        font-size: 18px;
    }

    .header__logo {
        font-size: 24px;
    }

    .header__controls {
        gap: 6px;
    }

    /* Search */
    .search-section {
        margin-top: var(--space-lg);
        margin-bottom: var(--space-md);
    }

    .search-form__wrapper {
        padding: 3px;
    }

    .search-form__input {
        padding: 10px var(--space-sm);
        font-size: 15px;
    }

    .search-form__btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Current Weather */
    .current-weather__card {
        padding: var(--space-xl) var(--space-lg);
    }

    .current-weather__city {
        font-size: 24px;
    }

    .current-weather__temp {
        font-size: 48px;
    }

    .current-weather__temp-unit {
        font-size: 24px;
    }

    .current-weather__icon {
        width: 80px;
        height: 80px;
    }

    .current-weather__details {
        grid-template-columns: repeat(2, 1fr);
    }

    .current-weather__condition {
        font-size: 16px;
    }

    /* Forecast */
    .forecast__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .forecast-card {
        padding: var(--space-md) var(--space-md);
    }

    .forecast-card__icon {
        width: 48px;
        height: 48px;
    }

    /* Hourly */
    .hourly-forecast__nav {
        display: none;
    }
    .hourly-card {
        min-width: 80px;
        padding: var(--space-sm) var(--space-md);
    }

    .hourly-card__icon {
        width: 36px;
        height: 36px;
    }

    .hourly-card__temp {
        font-size: 15px;
    }

    .hourly-forecast__scrollbar {
        height: 5px;
    }

    /* Empty State */
    .empty-state {
        padding: var(--space-2xl) var(--space-lg);
    }

    .empty-state__icon {
        font-size: 48px;
    }

    .empty-state__title {
        font-size: 20px;
    }

    /* Footer */
    .footer {
        margin-top: var(--space-xl);
        padding: var(--space-md) 0;
    }

    /* Skeleton responsive */
    .skeleton-current__details {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-forecast {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-current__body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .skeleton-current__temp-block {
        align-items: center;
    }

    .skeleton-current__city {
        width: 140px;
    }

    /* Weather card background effects smaller */
    .current-weather__card::before {
        width: 200px;
        height: 200px;
    }

    .current-weather__card::after {
        width: 120px;
        height: 120px;
    }
}

/* --- Landscape phones & small tablets: 480-600px --- */
@media (min-width: 481px) and (max-width: 600px) {
    .container {
        padding: 0 var(--space-md);
    }

    .search-form__wrapper {
        flex-direction: row;
    }

    .search-form__input {
        text-align: left;
        font-size: 15px;
    }

    .search-form__btn {
        width: auto;
        padding: 10px 20px;
    }

    .current-weather__main {
        flex-direction: row;
        text-align: left;
    }

    .current-weather__details {
        grid-template-columns: repeat(3, 1fr);
    }

    .weather-detail {
        flex-direction: row;
        text-align: left;
    }

    .forecast__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .forecast-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-md);
    }

    .forecast-card__icon {
        order: 0;
    }

    .forecast-card__day {
        flex: none;
        order: 0;
        width: auto;
    }

    .forecast-card__date {
        order: 0;
        width: auto;
    }

    .forecast-card__condition {
        display: block;
    }

    .forecast-card__temps {
        order: 0;
    }
}

/* --- Mobile: up to 480px --- */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }

    /* Header */
    .header__inner {
        height: 52px;
    }

    .header__title {
        font-size: 16px;
    }

    .header__logo {
        font-size: 22px;
    }

    .header__controls {
        gap: 4px;
    }

    .btn--icon {
        width: 36px;
        height: 36px;
    }

    .btn--icon svg {
        width: 18px;
        height: 18px;
    }

    /* Search */
    .search-form__wrapper {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm);
        border-radius: var(--radius-md);
    }

    .search-form__icon {
        display: none;
    }

    .search-form__input {
        width: 100%;
        padding: 14px 12px;
        text-align: center;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .search-form__btn {
        width: 100%;
        padding: 14px 12px;
        font-size: 15px;
    }

    /* Current Weather */
    .current-weather__card {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--radius-lg);
    }

    .current-weather__main {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .current-weather__header {
        text-align: center;
        justify-content: center;
    }

    .current-weather__city {
        font-size: 22px;
    }

    .current-weather__temp {
        font-size: 42px;
    }

    .current-weather__temp-unit {
        font-size: 20px;
    }

    .current-weather__icon {
        width: 72px;
        height: 72px;
    }

    .current-weather__condition {
        font-size: 15px;
    }

    .current-weather__details {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        padding-top: var(--space-md);
    }

    .weather-detail {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
        padding: var(--space-sm) var(--space-xs);
    }

    .weather-detail__icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .weather-detail__label {
        font-size: 11px;
    }

    .weather-detail__value {
        font-size: 14px;
    }

    /* Forecast */
    .forecast__grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .forecast-card {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-sm) var(--space-md);
        text-align: left;
        gap: var(--space-xs);
    }

    .forecast-card__icon {
        width: 40px;
        height: 40px;
        order: 2;
    }

    .forecast-card__day {
        flex: 1;
        order: 1;
        font-size: 14px;
        min-width: 0;
    }

    .forecast-card__date {
        width: auto;
        order: 3;
        font-size: 11px;
    }

    .forecast-card__condition {
        display: none;
    }

    .forecast-card__temps {
        order: 4;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Skeleton responsive */
    .skeleton-current__details {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .skeleton-current__detail-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .skeleton-forecast {
        grid-template-columns: 1fr;
    }

    .skeleton-forecast__card {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .skeleton-hourly__card {
        min-width: 68px;
        padding: var(--space-sm) 10px;
    }

    /* Hourly */
    .hourly-forecast__scroll {
        gap: 6px;
        padding-bottom: var(--space-sm);
    }

    .hourly-card {
        min-width: 68px;
        padding: var(--space-sm) 10px;
        gap: 4px;
    }

    .hourly-forecast__scrollbar {
        height: 4px;
    }

    .hourly-forecast__scrollbar-thumb {
        min-width: 30px;
    }

    .hourly-card__time {
        font-size: 12px;
    }

    .hourly-card__icon {
        width: 32px;
        height: 32px;
    }

    .hourly-card__temp {
        font-size: 14px;
    }

    /* Loading & Empty */
    .loading {
        padding: var(--space-2xl) 0;
    }

    .loading__dot {
        width: 10px;
        height: 10px;
    }

    .empty-state {
        padding: var(--space-2xl) var(--space-md);
    }

    .empty-state__icon {
        font-size: 40px;
        margin-bottom: var(--space-md);
    }

    .empty-state__title {
        font-size: 18px;
    }

    .empty-state__text {
        font-size: 14px;
    }

    /* Recent Searches */
    .recent-list {
        justify-content: center;
        gap: 6px;
    }

    .recent-item {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Error */
    .error-message {
        font-size: 13px;
        padding: 10px var(--space-sm);
    }

    /* Footer */
    .footer {
        margin-top: var(--space-xl);
        padding: var(--space-md) 0;
    }

    .footer__text {
        font-size: 12px;
    }

    /* Unit Toggle */
    .unit-toggle-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* --- Very small phones: up to 360px --- */
@media (max-width: 360px) {
    .header__title {
        font-size: 14px;
    }

    .header__logo {
        font-size: 18px;
    }

    .btn--icon {
        width: 32px;
        height: 32px;
    }

    .current-weather__city {
        font-size: 18px;
    }

    .current-weather__temp {
        font-size: 36px;
    }

    .current-weather__temp-unit {
        font-size: 18px;
    }

    .current-weather__icon {
        width: 60px;
        height: 60px;
    }

    .current-weather__details {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .weather-detail {
        padding: 6px 4px;
    }

    .weather-detail__icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .weather-detail__value {
        font-size: 12px;
    }

    .weather-detail__label {
        font-size: 10px;
    }

    .hourly-card {
        min-width: 60px;
        padding: var(--space-xs) 8px;
    }

    .hourly-forecast__scrollbar {
        height: 3px;
    }

    .hourly-forecast__scrollbar-thumb {
        min-width: 24px;
    }

    .hourly-card__time {
        font-size: 11px;
    }

    .hourly-card__icon {
        width: 28px;
        height: 28px;
    }

    .hourly-card__temp {
        font-size: 13px;
    }

    .current-weather__location-group {
        min-width: 0;
    }

    .forecast-card {
        padding: var(--space-xs) var(--space-sm);
    }

    .forecast-card__day {
        font-size: 13px;
    }

    .forecast-card__temps {
        font-size: 12px;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .header,
    .search-section,
    .recent-searches,
    .hourly-forecast,
    .footer,
    .btn {
        display: none !important;
    }

    .weather-display {
        display: block !important;
    }

    .current-weather__card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .forecast-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
