:root {
    /* --- Defaults (Dark Aurora) --- */
    --glass-bg: linear-gradient(140deg, rgba(18, 30, 52, 0.86), rgba(7, 16, 30, 0.92));
    --glass-border: rgba(148, 163, 184, 0.18);
    --glass-highlight: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 40px 80px -20px rgba(2, 6, 23, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    --panel-bg: rgba(15, 23, 42, 0.55);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-color: #22d3ee;
    --accent-warm: #f59e0b;
    --card-hover-bg: rgba(34, 211, 238, 0.12);
    --input-bg: rgba(2, 6, 23, 0.45);
    --blur-strength: 36px;
    --video-overlay: brightness(0.5) blur(0px);
    --body-font: "Archivo", sans-serif;
    --heading-font: "Fraunces", serif;
    --chart-line: #38bdf8;
    --chart-fill: rgba(56, 189, 248, 0.6);
    --chart-fill-bottom: rgba(56, 189, 248, 0);
}

body.theme-dark-aurora {
    background-color: #020617;
    background-image:
        radial-gradient(60rem 60rem at 10% -10%, rgba(14, 116, 144, 0.45), transparent 55%),
        radial-gradient(40rem 40rem at 90% 10%, rgba(37, 99, 235, 0.35), transparent 60%),
        radial-gradient(32rem 32rem at 70% 85%, rgba(245, 158, 11, 0.18), transparent 60%),
        linear-gradient(180deg, #0b1221 0%, #05080f 100%);
}

body.theme-dark-aurora .footer-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.92));
    border-color: rgba(34, 211, 238, 0.22);
}

/* Dark Aurora header controls + search styling */
body.theme-dark-aurora .glass-panel {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(34, 211, 238, 0.22);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

body.theme-dark-aurora .glass-panel:hover {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.5), rgba(37, 99, 235, 0.45));
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
    transform: translateY(-1px);
}

body.theme-dark-aurora #city-search {
    background: rgba(2, 6, 23, 0.65);
    border-color: rgba(34, 211, 238, 0.28);
}

body.theme-dark-aurora #city-search:focus {
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

body.theme-dark-aurora #search-btn i,
body.theme-dark-aurora #settings-btn i,
body.theme-dark-aurora #history-btn i,
body.theme-dark-aurora #gps-btn i,
body.theme-dark-aurora #compact-toggle i,
body.theme-dark-aurora #theme-toggle i,
body.theme-dark-aurora #audio-toggle i {
    color: #22d3ee;
}

body.theme-dark-aurora .glass-panel:hover i {
    color: #f8fafc;
}

body.theme-dark-aurora #forecast-container .glass-panel {
    background: rgba(15, 23, 42, 0.7);
}

body.theme-dark-aurora #sun-arc-progress {
    stroke: rgba(34, 211, 238, 0.8);
}

body.theme-dark-aurora #sun-progress-dot {
    fill: #fbbf24;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.7));
}

body.theme-dark-ember {
    --glass-bg: linear-gradient(140deg, rgba(45, 24, 20, 0.85), rgba(18, 10, 8, 0.92));
    --glass-border: rgba(253, 186, 116, 0.18);
    --glass-highlight: rgba(255, 255, 255, 0.16);
    --glass-shadow: 0 40px 80px -20px rgba(7, 3, 2, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    --panel-bg: rgba(28, 14, 11, 0.62);
    --accent-color: #fb7185;
    --accent-warm: #f97316;
    --card-hover-bg: rgba(251, 113, 133, 0.15);
    --input-bg: rgba(18, 10, 8, 0.65);
    background-color: #0b0605;
    background-image:
        radial-gradient(40rem 40rem at 10% -10%, rgba(234, 88, 12, 0.35), transparent 55%),
        radial-gradient(30rem 30rem at 90% 10%, rgba(251, 113, 133, 0.28), transparent 60%),
        radial-gradient(24rem 24rem at 70% 85%, rgba(245, 158, 11, 0.2), transparent 60%),
        linear-gradient(180deg, #1a0f0b 0%, #080404 100%);
    --body-font: "Space Grotesk", sans-serif;
    --heading-font: "Unbounded", sans-serif;
    --chart-line: #fb7185;
    --chart-fill: rgba(251, 113, 133, 0.55);
    --chart-fill-bottom: rgba(251, 113, 133, 0);
}

body.theme-light-sky {
    --glass-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.75), rgba(241, 245, 249, 0.9));
    --glass-border: rgba(148, 163, 184, 0.4);
    --glass-highlight: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    --panel-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --accent-color: #2563eb;
    --accent-warm: #0ea5e9;
    --card-hover-bg: rgba(37, 99, 235, 0.12);
    --input-bg: rgba(255, 255, 255, 0.92);
    background-color: #e2e8f0;
    background-image:
        radial-gradient(50rem 50rem at 10% -10%, rgba(56, 189, 248, 0.35), transparent 55%),
        radial-gradient(34rem 34rem at 90% 10%, rgba(59, 130, 246, 0.25), transparent 60%),
        radial-gradient(26rem 26rem at 70% 85%, rgba(14, 165, 233, 0.2), transparent 60%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    --body-font: "DM Sans", sans-serif;
    --heading-font: "Playfair Display", serif;
    --chart-line: #2563eb;
    --chart-fill: rgba(37, 99, 235, 0.45);
    --chart-fill-bottom: rgba(37, 99, 235, 0);
}

body.theme-light-sand {
    --glass-bg: linear-gradient(140deg, rgba(255, 251, 235, 0.8), rgba(254, 243, 199, 0.92));
    --glass-border: rgba(180, 130, 70, 0.35);
    --glass-highlight: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 30px 60px -20px rgba(120, 76, 35, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    --panel-bg: rgba(255, 248, 235, 0.7);
    --text-primary: #3b2615;
    --text-secondary: #7a5532;
    --accent-color: #b45309;
    --accent-warm: #f59e0b;
    --card-hover-bg: rgba(180, 83, 9, 0.12);
    --input-bg: rgba(255, 248, 235, 0.9);
    background-color: #f8f1df;
    background-image:
        radial-gradient(50rem 50rem at 10% -10%, rgba(245, 158, 11, 0.25), transparent 55%),
        radial-gradient(34rem 34rem at 90% 10%, rgba(251, 191, 36, 0.25), transparent 60%),
        radial-gradient(26rem 26rem at 70% 85%, rgba(217, 119, 6, 0.2), transparent 60%),
        linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    --body-font: "Sora", sans-serif;
    --heading-font: "Cormorant Garamond", serif;
    --chart-line: #b45309;
    --chart-fill: rgba(180, 83, 9, 0.45);
    --chart-fill-bottom: rgba(180, 83, 9, 0);
}

body {
    font-family: var(--body-font);
    overflow-x: hidden;
    color: var(--text-primary);
    transition: color 0.5s ease, background 1s ease;
    min-height: 100vh;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(30rem 30rem at 15% 20%, rgba(34, 211, 238, 0.12), transparent 60%),
        radial-gradient(22rem 22rem at 85% 15%, rgba(139, 92, 246, 0.12), transparent 60%),
        radial-gradient(26rem 26rem at 70% 85%, rgba(245, 158, 11, 0.12), transparent 60%);
    filter: blur(0px);
    animation: auroraShift 18s ease-in-out infinite;
}

body::after {
    opacity: 0.35;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 8px),
        radial-gradient(40rem 40rem at 20% 80%, rgba(59, 130, 246, 0.12), transparent 60%);
    animation: auroraShift 26s ease-in-out infinite reverse;
}

/* --- Typography & Icons --- */
h1, h2, .text-8xl {
    font-family: var(--heading-font);
    letter-spacing: -0.02em;
    text-shadow: 0 10px 25px rgba(2, 6, 23, 0.4);
}

i {
    color: var(--accent-color);
}

/* --- Glassmorphism Components --- */

/* Main Container */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    box-shadow: var(--glass-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: riseIn 700ms ease both;
}

/* Inner Cards */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

.glass-panel:hover {
    background: var(--card-hover-bg);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
    border-color: rgba(34, 211, 238, 0.6);
    transform: translateY(-2px);
}

/* Toast Notifications */
#toast-container {
    align-items: flex-end;
}

.toast {
    min-width: 240px;
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--panel-bg);
    color: var(--text-primary);
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    display: flex;
    gap: 10px;
    align-items: center;
    animation: toastIn 220ms ease-out;
}

.toast .icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent-color);
    flex: 0 0 auto;
}

.toast.error .icon {
    background: rgba(248, 113, 113, 0.18);
    color: #ef4444;
}

.toast.warn .icon {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.toast .content {
    font-size: 0.9rem;
    line-height: 1.2rem;
}

.toast .title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast.hide {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 200ms ease, transform 200ms ease;
}

#forecast-container .glass-panel:hover {
    transform: none;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.2);
}

#forecast-container {
    overflow-y: visible;
    padding-top: 0.25rem;
}

/* Sun Path (Semi-circle SVG) */
.sun-arc {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.sun-arc-svg {
    width: 100%;
    height: 100%;
}

#sun-arc-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 2;
}

#sun-arc-shadow {
    fill: none;
    stroke: url(#sun-arc-bg);
    stroke-width: 8;
    stroke-linecap: round;
    filter: url(#sun-soft-glow);
    opacity: 0.8;
}

#sun-arc-progress {
    fill: none;
    stroke: url(#sun-gradient);
    stroke-width: 5;
    stroke-linecap: round;
    filter: url(#sun-glow);
}

#sun-progress-dot {
    fill: #22d3ee;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.4));
}

#hourly-cards .glass-panel {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#hourly-cards .glass-panel:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.2);
}

#hourly-cards {
    overflow-y: visible;
    padding-top: 0.25rem;
}

/* Trend strips */
.trend-strip {
    display: block;
}

/* Sparkline charts */
.sparkline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sparkline-svg {
    width: 100%;
    height: 140px;
}

.sparkline-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.35));
}

.sparkline-area {
    fill: rgba(56, 189, 248, 0.15);
}

.sparkline-dot {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1;
}

.sparkline-labels {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(56px, 1fr);
    gap: 8px;
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.85;
}

.sparkline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sparkline-value {
    font-size: 0.65rem;
    opacity: 0.75;
}

/* Sparkline single palette per theme */
.sparkline .sparkline-line { stroke: rgba(56, 189, 248, 0.95); }
.sparkline .sparkline-area { fill: rgba(56, 189, 248, 0.16); }
.sparkline .sparkline-dot { fill: rgba(56, 189, 248, 0.95); }

body.theme-light-sky .sparkline .sparkline-line { stroke: rgba(37, 99, 235, 0.95); }
body.theme-light-sky .sparkline .sparkline-area { fill: rgba(37, 99, 235, 0.16); }
body.theme-light-sky .sparkline .sparkline-dot { fill: rgba(37, 99, 235, 0.95); }
body.theme-light-sky .sparkline-line { filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3)); }

body.theme-light-sand .sparkline .sparkline-line { stroke: rgba(180, 83, 9, 0.95); }
body.theme-light-sand .sparkline .sparkline-area { fill: rgba(180, 83, 9, 0.16); }
body.theme-light-sand .sparkline .sparkline-dot { fill: rgba(180, 83, 9, 0.95); }
body.theme-light-sand .sparkline-line { filter: drop-shadow(0 4px 10px rgba(180, 83, 9, 0.25)); }

body.theme-dark-ember .sparkline .sparkline-line { stroke: rgba(251, 113, 133, 0.95); }
body.theme-dark-ember .sparkline .sparkline-area { fill: rgba(251, 113, 133, 0.16); }
body.theme-dark-ember .sparkline .sparkline-dot { fill: rgba(251, 113, 133, 0.95); }
body.theme-dark-ember .sparkline-line { filter: drop-shadow(0 4px 12px rgba(251, 113, 133, 0.35)); }

.sun-arc-glow {
    position: absolute;
    inset: 0;
    border-radius: 999px 999px 0 0;
    background: radial-gradient(80% 60% at 50% 85%, rgba(56, 189, 248, 0.2), transparent 70%);
    pointer-events: none;
    animation: sunGlow 3.2s ease-in-out infinite;
}

/* Inputs */
input {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1);
}

select {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

select option {
    color: #0f172a;
}

input::placeholder {
    color: var(--text-secondary);
}

/* Buttons */
button.glass-panel:hover {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(59, 130, 246, 0.9));
    color: white;
    border-color: transparent;
}

button.glass-panel:hover i {
    color: white;
}

body.theme-light-sky button.glass-panel:hover,
body.theme-light-sand button.glass-panel:hover {
    color: white;
}

body.theme-light-sky .glass-panel:hover,
body.theme-light-sand .glass-panel:hover {
    border-color: rgba(37, 99, 235, 0.5);
}

body.theme-light-sand .glass-panel:hover {
    border-color: rgba(180, 83, 9, 0.5);
}

/* --- Utilities --- */
.text-gray-300, .text-gray-200, .text-gray-100 {
    color: var(--text-secondary);
}

/* Compact Mode */
.compact-mode #main-container {
    padding: 0.5rem;
}
.compact-mode .glass {
    padding: 1rem;
    gap: 1rem;
}
.compact-mode .text-8xl {
    font-size: 4rem;
}
.compact-mode .text-4xl {
    font-size: 1.5rem;
}
.compact-mode .glass-panel {
    padding: 0.5rem;
}
.compact-mode .weather-icon-lg {
    width: 4rem;
    height: 4rem;
}
.compact-mode .hide-compact {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

@keyframes auroraShift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(2%, -1%, 0) scale(1.02); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}


@keyframes sunGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

body.theme-light-sky::before,
body.theme-light-sky::after {
    opacity: 0.18;
}

body.theme-light-sand::before,
body.theme-light-sand::after {
    opacity: 0.16;
}

/* Footer and modal contrast fixes for light themes */
.footer-panel {
    color: var(--text-primary);
}

body.theme-light-sky .footer-panel,
body.theme-light-sand .footer-panel {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

body.theme-dark-ember .footer-panel {
    background: linear-gradient(135deg, rgba(39, 18, 14, 0.9), rgba(22, 10, 8, 0.95));
    border-color: rgba(251, 113, 133, 0.25);
}

body.theme-light-sand .footer-panel {
    background: linear-gradient(135deg, rgba(255, 246, 226, 0.92), rgba(255, 239, 206, 0.9));
    border-color: rgba(180, 130, 70, 0.35);
}

body.theme-light-sky .footer-panel,
body.theme-light-sand .footer-panel,
body.theme-light-sky .footer-panel a,
body.theme-light-sand .footer-panel a {
    color: var(--text-primary);
    opacity: 1;
}

body.theme-light-sky .footer-panel .text-gray-100,
body.theme-light-sky .footer-panel .text-gray-200,
body.theme-light-sky .footer-panel .text-gray-300,
body.theme-light-sand .footer-panel .text-gray-100,
body.theme-light-sand .footer-panel .text-gray-200,
body.theme-light-sand .footer-panel .text-gray-300 {
    color: var(--text-primary);
}

body.theme-light-sky .footer-panel a:hover,
body.theme-light-sand .footer-panel a:hover {
    color: var(--accent-color);
}

#modal-overlay .glass {
    color: var(--text-primary);
}

body.theme-light-sky #modal-overlay .glass,
body.theme-light-sand #modal-overlay .glass {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.25);
}

body.theme-light-sky #modal-overlay,
body.theme-light-sand #modal-overlay {
    background-color: rgba(15, 23, 42, 0.25) !important;
}

body.theme-light-sky #modal-overlay .text-gray-300,
body.theme-light-sand #modal-overlay .text-gray-300 {
    color: var(--text-secondary);
}

body.theme-light-sky #modal-overlay #search-results-list .text-gray-300,
body.theme-light-sand #modal-overlay #search-results-list .text-gray-300 {
    color: var(--text-secondary);
}

/* Summary panel theme tuning */
body.theme-light-sand .border-cyan-400 {
    border-color: rgba(180, 83, 9, 0.6);
}

body.theme-light-sand .text-cyan-300 {
    color: #b45309;
}

body.theme-light-sand .bg-cyan-400\/10 {
    background: rgba(180, 83, 9, 0.12);
}

body.theme-light-sky .border-cyan-400 {
    border-color: rgba(37, 99, 235, 0.55);
}

body.theme-light-sky .text-cyan-300 {
    color: #2563eb;
}

body.theme-light-sky .bg-cyan-400\/10 {
    background: rgba(37, 99, 235, 0.12);
}

body.theme-dark-ember .border-cyan-400 {
    border-color: rgba(251, 113, 133, 0.6);
}

body.theme-dark-ember .text-cyan-300 {
    color: #fb7185;
}

body.theme-dark-ember .bg-cyan-400\/10 {
    background: rgba(251, 113, 133, 0.12);
}

/* Theme-tuned Sun Path + Bars */
body.theme-light-sand #sun-arc-progress {
    stroke: rgba(180, 83, 9, 0.75);
}

body.theme-light-sky #sun-arc-progress {
    stroke: rgba(37, 99, 235, 0.75);
}

body.theme-dark-ember #sun-arc-progress {
    stroke: rgba(251, 113, 133, 0.75);
}

body.theme-light-sand #sun-arc-shadow {
    stroke: rgba(245, 158, 11, 0.25);
}

body.theme-light-sky #sun-arc-shadow {
    stroke: rgba(59, 130, 246, 0.22);
}

body.theme-dark-ember #sun-arc-shadow {
    stroke: rgba(251, 113, 133, 0.22);
}

body.theme-dark-aurora #sun-arc-shadow {
    stroke: rgba(34, 211, 238, 0.22);
}

body.theme-light-sand #sun-progress-dot {
    fill: #b45309;
    filter: drop-shadow(0 0 8px rgba(180, 83, 9, 0.45));
}

body.theme-light-sky #sun-progress-dot {
    fill: #2563eb;
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.4));
}

body.theme-dark-ember #sun-progress-dot {
    fill: #fb7185;
    filter: drop-shadow(0 0 8px rgba(251, 113, 133, 0.45));
}

/* Theme-tuned sun arc */
body.theme-light-sand .sun-arc {
    border-color: rgba(180, 83, 9, 0.25);
}

body.theme-light-sky .sun-arc {
    border-color: rgba(37, 99, 235, 0.25);
}

body.theme-dark-ember .sun-arc {
    border-color: rgba(251, 113, 133, 0.25);
}

body.theme-dark-aurora .sun-arc {
    border-color: rgba(34, 211, 238, 0.25);
}

body.theme-light-sky #modal-overlay label,
body.theme-light-sand #modal-overlay label,
body.theme-light-sky #modal-overlay h2,
body.theme-light-sand #modal-overlay h2 {
    color: var(--text-primary);
}

body.theme-light-sky #contact-email,
body.theme-light-sand #contact-email {
    color: #1d4ed8;
}

body.theme-light-sand #contact-email {
    color: #a16207;
}

body.theme-light-sky #close-modal,
body.theme-light-sand #close-modal {
    color: #334155;
}

/* Light theme input + icon contrast */
body.theme-light-sky input,
body.theme-light-sky select {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body.theme-light-sand input,
body.theme-light-sand select {
    color: var(--text-primary);
    background: rgba(255, 252, 244, 0.95);
    border-color: rgba(180, 130, 70, 0.35);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body.theme-dark-ember input,
body.theme-dark-ember select {
    color: #fef2f2;
    background: rgba(28, 14, 11, 0.8);
    border-color: rgba(251, 113, 133, 0.35);
    box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.1);
}

body.theme-light-sky input::placeholder,
body.theme-light-sand input::placeholder {
    color: rgba(15, 23, 42, 0.55);
}

body.theme-light-sky input:focus,
body.theme-light-sand input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.theme-light-sand input:focus {
    border-color: rgba(180, 83, 9, 0.5);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

body.theme-dark-ember input:focus {
    border-color: rgba(251, 113, 133, 0.6);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18);
}

/* Light Sand header controls + search styling */
body.theme-light-sand .glass-panel {
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.97), rgba(255, 236, 210, 0.93));
    border-color: rgba(217, 119, 6, 0.35);
    box-shadow: 0 14px 28px rgba(180, 83, 9, 0.14);
}

/* Left column spacing */
.left-card {
    padding: 0.85rem;
}

/* Dark Ember header controls + search styling */
body.theme-dark-ember .glass-panel {
    background: rgba(31, 14, 11, 0.8);
    border-color: rgba(251, 113, 133, 0.28);
    box-shadow: 0 10px 24px rgba(7, 3, 2, 0.45);
}

body.theme-dark-ember .glass-panel:hover {
    background: linear-gradient(135deg, rgba(88, 24, 27, 0.95), rgba(44, 16, 13, 0.95));
    border-color: rgba(251, 113, 133, 0.55);
    box-shadow: 0 18px 36px rgba(7, 3, 2, 0.55);
    transform: translateY(-1px);
}

body.theme-dark-ember #city-search {
    background: rgba(26, 12, 10, 0.9);
    border-color: rgba(251, 113, 133, 0.35);
}

body.theme-dark-ember #city-search:focus {
    border-color: rgba(251, 113, 133, 0.7);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.2);
}

body.theme-dark-ember #search-btn i,
body.theme-dark-ember #settings-btn i,
body.theme-dark-ember #history-btn i,
body.theme-dark-ember #gps-btn i,
body.theme-dark-ember #compact-toggle i,
body.theme-dark-ember #theme-toggle i,
body.theme-dark-ember #audio-toggle i {
    color: #fb7185;
}

body.theme-dark-ember .glass-panel:hover i {
    color: #ffe4e6;
}

/* Dark Ember content text tuning */
body.theme-dark-ember #date-time,
body.theme-dark-ember .text-gray-300,
body.theme-dark-ember .text-gray-200,
body.theme-dark-ember .text-gray-100 {
    color: #f9a8d4;
}

body.theme-dark-ember #weather-desc {
    color: #fb7185;
}

body.theme-dark-ember #forecast-container .glass-panel {
    background: rgba(34, 16, 13, 0.85);
}

body.theme-dark-ember .toast {
    background: rgba(28, 14, 11, 0.9);
    border-color: rgba(251, 113, 133, 0.28);
}

/* Light Sky header controls + search styling */
body.theme-light-sky .glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(233, 244, 255, 0.92));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.12);
}

body.theme-light-sky .glass-panel:hover {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.98), rgba(191, 219, 254, 0.98));
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

body.theme-light-sky #city-search {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light-sky #city-search:focus {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

body.theme-light-sky #search-btn {
    color: #2563eb;
}

body.theme-light-sky #search-btn:hover {
    color: #1d4ed8;
}

/* Light Sky content text tuning */
body.theme-light-sky #date-time,
body.theme-light-sky .text-gray-300,
body.theme-light-sky .text-gray-200,
body.theme-light-sky .text-gray-100 {
    color: #475569;
}

body.theme-light-sky #weather-desc {
    color: #2563eb;
}

body.theme-light-sky #forecast-container .glass-panel {
    background: rgba(255, 255, 255, 0.9);
}

body.theme-light-sky .toast {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.15);
}

body.theme-light-sand .glass-panel:hover {
    background: linear-gradient(135deg, rgba(255, 231, 198, 0.98), rgba(255, 210, 170, 0.96));
    border-color: rgba(217, 119, 6, 0.55);
    box-shadow: 0 20px 40px rgba(120, 76, 35, 0.24);
    transform: translateY(-1px);
}

body.theme-light-sand #city-search {
    background: rgba(255, 250, 240, 0.98);
    border-color: rgba(180, 130, 70, 0.35);
}

body.theme-light-sand #city-search:focus {
    border-color: rgba(180, 83, 9, 0.6);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18);
}

body.theme-light-sand #search-btn {
    color: #b45309;
}

body.theme-light-sand #search-btn:hover {
    color: #7c2d12;
}

/* Light Sand content text tuning */
body.theme-light-sand #date-time,
body.theme-light-sand .text-gray-300,
body.theme-light-sand .text-gray-200,
body.theme-light-sand .text-gray-100 {
    color: #8b6a46;
}

body.theme-light-sand #weather-desc {
    color: #b45309;
}

body.theme-light-sand #forecast-container .glass-panel {
    background: rgba(255, 245, 228, 0.95);
}

body.theme-light-sand .toast {
    background: rgba(255, 245, 228, 0.95);
    border-color: rgba(180, 130, 70, 0.35);
    box-shadow: 0 16px 30px rgba(120, 76, 35, 0.15);
}

body.theme-light-sky #search-btn i,
body.theme-light-sky #settings-btn i,
body.theme-light-sky #history-btn i,
body.theme-light-sky #gps-btn i,
body.theme-light-sky #compact-toggle i,
body.theme-light-sky #theme-toggle i,
body.theme-light-sky #audio-toggle i {
    color: #2563eb;
}

body.theme-light-sand #search-btn i,
body.theme-light-sand #settings-btn i,
body.theme-light-sand #history-btn i,
body.theme-light-sand #gps-btn i,
body.theme-light-sand #compact-toggle i,
body.theme-light-sand #theme-toggle i,
body.theme-light-sand #audio-toggle i {
    color: #b45309;
}

body.theme-light-sky .glass-panel:hover i,
body.theme-light-sand .glass-panel:hover i {
    color: white;
}

/* Settings modal buttons text contrast */
body.theme-light-sky #reset-app-btn,
body.theme-light-sand #reset-app-btn {
    color: #9a3412;
    background: rgba(248, 113, 113, 0.15);
}

body.theme-light-sky #reset-app-btn:hover,
body.theme-light-sand #reset-app-btn:hover {
    color: #7f1d1d;
    background: rgba(248, 113, 113, 0.25);
}
