/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
    --primary: #1a2530;
    --bg-light: #f4f4f5;
    --bg-dark: #0f172a;
    --surface-light: #ffffff;
    --surface-dark: #1e293b;
    --text-light-primary: #1f2937;
    --text-light-secondary: #4b5563;
    --text-dark-primary: #f3f4f6;
    --text-dark-secondary: #9ca3af;
    --border-light: #e5e7eb;
    --border-dark: #334155;
    --landing-bg: #f9f9f9;

    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --text-primary: var(--text-light-primary);
    --text-secondary: var(--text-light-secondary);
    --border: var(--border-light);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.05);
}

html.dark {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --text-primary: var(--text-dark-primary);
    --text-secondary: var(--text-dark-secondary);
    --border: var(--border-dark);
    --nav-bg: rgba(30, 41, 59, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --landing-bg: #0f172a;
    --primary: #e2e8f0;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    width: 100%;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: transparent;
}

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

.hidden {
    display: none !important;
}

/* ===========================
   NAVBAR — SHARED
   =========================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.3s, border-color 0.3s;
}

.navbar-landing {
    background: transparent;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 50;
}

.navbar-main {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

html.dark .nav-icon {
    color: #fff;
}

.nav-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.icon-btn {
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

html.dark .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Theme icon toggle */
.theme-icon-light {
    display: none;
}

html.dark .theme-icon-dark {
    display: none;
}

html.dark .theme-icon-light {
    display: block;
}

/* ===========================
   NAVBAR — SEARCH BAR
   =========================== */
.nav-search-bar {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    background: var(--surface);
    gap: 0.5rem;
    max-width: 400px;
    flex: 1;
    min-width: 0;
    margin: 0 1rem;
    transition: border-color 0.3s, background-color 0.3s;
}

.nav-search-bar:focus-within {
    border-color: var(--primary);
}

.search-icon-nav {
    color: var(--text-secondary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.nav-search-input {
    flex: 1;
    min-width: 0;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.nav-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-loc-btn {
    padding: 0.35rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===========================
   PAGE CONTAINERS
   =========================== */
.page {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* ===========================
   LANDING PAGE
   =========================== */
.page-landing {
    position: relative;
    background-color: var(--landing-bg);
}

.landing-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.3;
    mix-blend-mode: multiply;
}

html.dark .landing-bg {
    opacity: 0.15;
    mix-blend-mode: overlay;
}

.landing-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(1) blur(2px);
}

.landing-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, var(--landing-bg));
}

html.dark .landing-bg-overlay {
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
}

.landing-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    margin-top: -5vh;
}

.landing-content {
    text-align: center;
    max-width: 56rem;
    width: 100%;
}

.landing-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}

.landing-title-sub {
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.8rem, 6vw, 4.5rem);
    opacity: 0.8;
}

.landing-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 500;
}

/* Search wrapper — restructured with input-group */
.landing-search-wrapper {
    max-width: 36rem;
    margin: 0 auto 2rem;
    display: flex;
    align-items: stretch;
}

.landing-input-group {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.landing-search-icon {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: var(--text-secondary);
    z-index: 2;
}

.landing-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #1a2530;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    transition: background-color 0.3s, border-color 0.3s;
}

html.dark .landing-search-input {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border);
}

.landing-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 0.875rem;
}

.landing-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--primary);
}

.landing-explore-btn {
    padding: 0 1.5rem;
    background-color: #1a2530;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: opacity 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

html.dark .landing-explore-btn {
    background-color: #cbd5e1;
    color: #0f172a;
}

.landing-explore-btn:hover {
    opacity: 0.9;
}

.landing-location-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 0.5rem;
}

.landing-location-btn:hover {
    color: var(--text-primary);
}

.landing-location-btn .material-symbols-outlined {
    font-size: 1rem;
}

.landing-location-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

/* ===========================
   MAIN PAGE
   =========================== */
.main-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.main-content {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 5vw, 3.75rem);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.main-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 36rem;
}

/* Current weather bar */
.current-weather-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.current-location {
    min-width: 0;
    flex: 1;
}

.current-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.current-city {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.25rem, 4vw, 1.875rem);
    font-weight: 500;
    overflow-wrap: break-word;
    word-break: break-word;
}

.current-temp-wrapper {
    text-align: right;
    flex-shrink: 0;
}

.current-temp {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 300;
}

.current-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: capitalize;
}

/* ===========================
   WEATHER CARDS
   =========================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.weather-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, transform 0.3s, opacity 0.5s;
    min-height: 130px;
    position: relative;
    overflow: hidden;
}

.weather-card:hover {
    border-color: var(--primary);
}

html.dark .weather-card:hover {
    border-color: #fff;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

.card-icon {
    font-size: 1.125rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.weather-card:hover .card-icon {
    color: var(--primary);
}

html.dark .weather-card:hover .card-icon {
    color: #fff;
}

.card-value {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-bottom: 0.5rem;
}

.card-value .unit {
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

.card-extra {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Card slide-in animation */
.card-animate {
    opacity: 0;
    transform: translateY(20px);
}

.card-animate.animate-in {
    animation: cardSlideIn 0.5s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
}

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

/* Skeleton shimmer */
.card-skeleton .card-header,
.card-skeleton .card-value,
.card-skeleton .card-extra {
    visibility: hidden;
}

.card-skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.04) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 2;
}

html.dark .card-skeleton::before {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton bars (for forecast placeholders) */
.skeleton-bar {
    border-radius: 4px;
    background: var(--border);
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-bar-sm {
    height: 0.6rem;
    width: 2rem;
}

.skeleton-bar-md {
    height: 1rem;
    width: 2.5rem;
}

.skeleton-circle {
    border-radius: 50%;
    background: var(--border);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===========================
   FORECAST & SOLAR
   =========================== */
.forecast-solar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2.5rem;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

/* Forecast scroll */
/* ===========================
   FORECAST SECTION — FIXED
   =========================== */
.forecast-section {
    min-width: 0;
    overflow: hidden;
}

.forecast-scroll-wrapper {
    position: relative;
    width: 100%;
}

.forecast-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.forecast-scroll::-webkit-scrollbar {
    display: none;
}

/* Gradient fade hints */
.forecast-scroll-wrapper::before,
.forecast-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    z-index: 5;
    pointer-events: none;
}

.forecast-scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
}

.forecast-scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
}


.forecast-card {
    flex: none;
    width: 5.5rem;
    border: 1px solid var(--border);
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 130px;
    background: var(--surface);
    transition: border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.forecast-card:hover {
    border-color: var(--primary);
}

html.dark .forecast-card:hover {
    border-color: #fff;
}

.forecast-day {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.forecast-icon {
    color: var(--text-primary);
    margin: 0.5rem 0;
}

html.dark .forecast-icon {
    color: #fff;
}

.forecast-temp-high {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
}

.forecast-temp-low {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Forecast skeleton */
.forecast-skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.04) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 2;
}

html.dark .forecast-skeleton::before {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    background-size: 200% 100%;
}

/* ===========================
   SOLAR CYCLE — FIXED HEIGHT
   =========================== */
.solar-card {
    border: 1px solid var(--border);
    padding: 1.5rem;
    padding-top: 2.5rem;
    background: var(--surface);
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}

.solar-card:hover {
    border-color: var(--primary);
}

html.dark .solar-card:hover {
    border-color: #fff;
}

.solar-arc {
    position: absolute;
    left: 50%;
    bottom: 3.5rem;
    transform: translateX(-50%);
    width: 14rem;
    height: 7rem;
}

.solar-arc-line {
    width: 100%;
    height: 100%;
    border-top: 1px dashed var(--border);
    border-left: 1px dashed var(--border);
    border-right: 1px dashed var(--border);
    border-bottom: none;
    border-radius: 9999px 9999px 0 0;
}

.solar-sun-icon {
    position: absolute;
    transition: all 0.5s ease;
}

.sun-icon {
    color: #eab308;
    font-size: 1.5rem;
}

.solar-times {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    position: relative;
    z-index: 10;
    padding: 0 0.5rem;
}

.solar-time {
    text-align: center;
}

.solar-time-icon {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.solar-time-value {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
}

.solar-time-value .ampm {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-left: none;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
    transition: background-color 0.3s, border-color 0.3s;
    max-height: 450px;
}

.sidebar-disabled {
    opacity: 0.4;
    filter: blur(1px) grayscale(1);
    pointer-events: none;
    user-select: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

html.dark .sidebar-header {
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.35rem;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.sidebar-list-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-list-wrapper::-webkit-scrollbar {
    display: none;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    border-bottom: 1px solid var(--border);
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-item {
    display: block;
    padding: 1.25rem 1.5rem;
    transition: background-color 0.3s;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg);
}

.sidebar-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.sidebar-item-city {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    transition: color 0.3s;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.sidebar-item:hover .sidebar-item-city {
    color: var(--primary);
}

html.dark .sidebar-item:hover .sidebar-item-city {
    color: #fff;
}

.sidebar-item-temp {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 300;
    flex-shrink: 0;
}

.sidebar-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-item-bottom .material-symbols-outlined {
    font-size: 0.875rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.clear-history-btn {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    padding-bottom: 0.2rem;
    border-bottom: 1px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.clear-history-btn:hover {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

html.dark .clear-history-btn:hover {
    border-bottom-color: #fff;
}

.empty-history {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

/* ===========================
   ERROR PAGE
   =========================== */
.error-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.error-content-wrapper {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    text-align: center;
    min-height: 60vh;
}

.error-bg-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.05;
    overflow: hidden;
}

html.dark .error-bg-icon {
    opacity: 0.1;
}

.error-bg-icon .material-symbols-outlined {
    font-size: clamp(12rem, 40vw, 40rem);
    color: var(--text-primary);
}

.error-content {
    position: relative;
    z-index: 10;
    max-width: 48rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}

.error-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 5vw, 3.75rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
}

.error-description {
    color: var(--text-secondary);
    max-width: 28rem;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.error-detail {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.retry-btn {
    background-color: #1a2530;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 1rem 3rem;
    font-size: 0.8rem;
    transition: opacity 0.2s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

html.dark .retry-btn {
    background-color: #cbd5e1;
    color: #0f172a;
}

.retry-btn:hover {
    opacity: 0.9;
}

/* ===========================
   LOADING OVERLAY
   =========================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.loading-spinner {
    text-align: center;
    color: var(--text-primary);
    background: var(--surface);
    padding: 2.5rem 3rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
}

.loading-icon {
    font-size: 2.5rem;
    animation: spin 2s linear infinite;
    display: block;
    margin-bottom: 1rem;
}

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

.loading-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===========================
   FOOTER
   =========================== */
.app-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: 'Playfair Display', serif;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    z-index: 10;
    background: var(--bg);
    transition: background-color 0.3s, border-color 0.3s;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ===========================
   RESPONSIVE — TABLET (768px+)
   =========================== */
@media (min-width: 768px) {
    .app-footer {
        flex-direction: row;
        justify-content: space-between;
        padding: 2rem 3rem;
        text-align: left;
    }

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

    .sidebar-header {
        padding: 2rem;
    }

    .sidebar-item {
        padding: 1.5rem 2rem;
    }

    .sidebar-item-city {
        font-size: 1.25rem;
    }

    .sidebar-item-temp {
        font-size: 1.25rem;
    }
}

/* ===========================
   RESPONSIVE — DESKTOP (1024px+)
   =========================== */
@media (min-width: 1024px) {
    .main-layout,
    .error-layout {
        flex-direction: row;
    }

    .main-content {
        padding: 3rem 2rem 3rem 4rem;
        flex: 1;
    }

    .sidebar {
        width: 24rem;
        flex-shrink: 0;
        max-height: none;
        border-left: 1px solid var(--border);
        border-top: none;
        box-shadow: -10px 0 30px var(--shadow-color);
    }

    .solar-arc {
        width: 16rem;
        height: 8rem;
    }

    .solar-card {
        height: 230px;
    }
}

/* ===========================
   RESPONSIVE — MOBILE NAV WRAP (≤600px)
   =========================== */
@media (max-width: 600px) {
    .navbar-main {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .nav-search-bar {
        order: 3;
        max-width: none;
        flex: none;
        width: 100%;
        margin: 0.6rem 0 0;
    }

    .landing-main {
        margin-top: 0;
    }

    .landing-search-wrapper {
        flex-direction: column;
    }

    .landing-input-group {
        width: 100%;
    }

    .landing-search-input {
        border-right: 1px solid #1a2530;
    }

    html.dark .landing-search-input {
        border-right-color: var(--border);
    }

    .landing-explore-btn {
        padding: 0.9rem 1.5rem;
        width: 100%;
    }

    .landing-subtitle {
        font-size: 0.6rem;
        letter-spacing: 0.15em;
        margin-bottom: 2rem;
    }

    .main-header {
        margin-bottom: 1.5rem;
    }

    .main-description {
        font-size: 0.8rem;
    }

    .current-weather-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .current-temp-wrapper {
        text-align: left;
    }

    .forecast-card {
        width: 5rem;
        min-height: 120px;
        padding: 0.75rem;
    }

    .cards-grid {
        gap: 1rem;
    }

    .error-content-wrapper {
        min-height: 50vh;
    }

    .retry-btn {
        padding: 0.9rem 2.5rem;
    }
}

/* ===========================
   RESPONSIVE — SMALL MOBILE (≤420px)
   =========================== */
@media (max-width: 420px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-title {
        font-size: 1.1rem;
    }

    .landing-content {
        padding: 0 0.25rem;
    }

    .main-content {
        padding: 1.25rem;
    }

    .cards-grid {
        gap: 0.75rem;
    }

    .weather-card {
        padding: 1.25rem;
        min-height: 110px;
    }

    .solar-arc {
        width: 11rem;
        height: 5.5rem;
    }

    .solar-card {
        height: 190px;
        padding-top: 2rem;
    }

    .solar-time-value {
        font-size: 0.9rem;
    }

    .sidebar-item {
        padding: 1rem 1.25rem;
    }

    .sidebar-item-city {
        font-size: 1rem;
    }

    .sidebar-item-temp {
        font-size: 1rem;
    }

    .loading-spinner {
        padding: 2rem;
    }

    .forecast-solar-grid {
        gap: 1.5rem;
        padding-top: 2rem;
    }

    .section-title {
        font-size: 1rem;
    }
}