:root {
    --background: #f0f2f5;
    --surface: #ffffff;
    --text: #1c1e21;
    --text-secondary: #65676b;
    --accent: #1877f2;
    --error: #e63946;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --max-width: 480px;
    --max-width-desktop: 1200px;
    --column-gap: 24px;
    --gradient-blue: linear-gradient(135deg, #0077b6, #00b4d8);
    --gradient-pink: linear-gradient(135deg, #ff9a9e, #fad0c4);
    --gradient-sunset: linear-gradient(135deg, #ffd3a5, #fd6585);
    --text-light: rgba(255, 255, 255, 0.95);
    --text-light-secondary: rgba(255, 255, 255, 0.8);
    --surface-transparent: rgba(255, 255, 255, 0.9);
}

/* Dark theme variables */
[data-theme="dark"] {
    --background: #1a1a2e;
    --surface: #16213e;
    --text: #e9ecef;
    --text-secondary: #adb5bd;
    --accent: #00b4d8;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

.card {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

/* Search Card */
.search-card {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 20px;
    padding: 16px;
}

[data-theme="dark"] .search-card {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.1);
}

.search-card h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text);
}

.search-input-group {
    display: flex;
    gap: 8px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: var(--background);
    color: var(--text);
}

[data-theme="dark"] .search-input-group input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.search-input-group input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .search-input-group input::placeholder {
    color: var(--text-secondary);
}

.search-input-group button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background-color: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Weather Card */
.weather-card {
    background: var(--gradient-pink);
    padding: 24px;
    color: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.weather-main {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(5px);
}

.weather-info {
    flex: 1;
}

.weather-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.temperature {
    font-size: 48px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.weather-condition {
    font-size: 20px;
    font-weight: 600;
    margin-top: 4px;
}

.feels-like {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* Update for desktop layout */
@media (min-width: 1024px) {
    .weather-details {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .weather-main {
        gap: 32px;
    }
    
    .weather-icon {
        width: 100px;
        height: 100px;
    }
}

/* Weather Detail Items */
.weather-detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    height: 100px;
    width: 100%;
    box-sizing: border-box;
}

.weather-detail-item i {
    font-size: 20px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #1a1a1a;
    flex-shrink: 0;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    width: 100%;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    word-wrap: break-word;
}

/* Map Card */
.map-card {
    height: 300px;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
}

.map-container {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Custom Map Styles */
.leaflet-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    border-radius: 20px;
    background: var(--surface) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 12px;
}

.map-popup {
    min-width: 200px;
}

.map-popup h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text);
}

.map-popup p {
    font-size: 14px;
    margin: 4px 0;
    color: var(--text-secondary);
}

.custom-popup .leaflet-popup-content-wrapper {
    background: var(--surface);
    box-shadow: var(--card-shadow);
    color: var(--text);
}

.custom-popup .leaflet-popup-tip {
    background: var(--surface);
    color: var(--text);
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--card-shadow) !important;
}

.leaflet-control-zoom a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--background) !important;
}

/* Map Responsive Styles */
@media (max-width: 480px) {
    .map-card {
        height: 250px;
    }

    .map-popup {
        min-width: 180px;
    }

    .map-popup h3 {
        font-size: 14px;
    }

    .map-popup p {
        font-size: 12px;
    }
}

/* Loading State */
.loading-card {
    text-align: center;
    padding: 32px;
    background: var(--surface);
    color: var(--text);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* Error Card */
.error-card {
    background: var(--error);
    color: var(--text-light);
    text-align: center;
    padding: 16px;
    font-weight: 500;
}

/* Active States */
.card:active {
    transform: scale(0.98);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 12px;
    }

    .card {
        border-radius: 16px;
        padding: 16px;
    }

    .search-card h1 {
        font-size: 20px;
    }

    .clock {
        font-size: 36px;
    }

    .temperature {
        font-size: 42px;
    }
}

/* Pull-to-refresh effect */
.content-wrapper {
    overscroll-behavior-y: contain;
}

/* Tap highlight color */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Add these styles to your CSS */
.radio-group {
    display: flex;
    background: var(--background);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}

[data-theme="dark"] .radio-group {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .radio-label {
    color: var(--text-secondary);
}

.radio-label i {
    font-size: 16px;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: var(--surface);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .radio-option input[type="radio"]:checked + .radio-label {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Update search input placeholder based on selection */
#locationInput::placeholder {
    opacity: 0.6;
}

.search-input-group input.invalid {
    border-color: var(--error);
    background-color: rgba(230, 57, 70, 0.1);
}

.search-input-group input.invalid::placeholder {
    color: var(--error);
    opacity: 0.7;
}

/* Add these new styles for the time card */
.time-card {
    background: var(--gradient-blue);
    color: var(--text-light);
}

.time-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.location-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

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

.clock {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-light);
}

.date {
    font-size: 16px;
    color: var(--text-light-secondary);
    font-weight: 500;
}

/* Update media queries for mobile optimization */
@media (max-width: 480px) {
    .clock {
        font-size: 40px;
    }
    
    .location-title {
        font-size: 20px;
    }
    
    .date {
        font-size: 14px;
    }
}

/* Add these styles for the temperature unit toggle */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.unit-toggle {
    margin-left: 16px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 40px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: .3s;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
}

[data-theme="dark"] .slider {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 66px;
    left: 4px;
    background: var(--surface);
    transition: .3s;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 1;
}

.slider .c,
.slider .f,
.slider .h12,
.slider .h24,
.theme-slider i {
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
    color: var(--text-secondary);
    transition: color 0.3s;
    width: 50%;
    text-align: center;
}

/* Active states */
input:checked + .slider:before {
    transform: translateX(66px);
}

input:not(:checked) + .slider .c,
input:not(:checked) + .slider .h12,
.theme-slider input:not(:checked) + .slider .fa-sun {
    color: var(--accent);
}

input:checked + .slider .f,
input:checked + .slider .h24,
.theme-slider input:checked + .slider .fa-moon {
    color: var(--accent);
}

/* Language selector styles */
.settings-select {
    width: 160px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    transition: all 0.2s ease;
}

.settings-select:hover {
    border-color: var(--accent);
    background-color: var(--background);
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
}

[data-theme="dark"] .settings-select {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Update settings group spacing */
.settings-group {
    padding: 16px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.settings-group:last-child {
    border-bottom: none;
}

/* Make switches wider in settings */
.switch.large {
    width: 160px;
}

.switch.large .slider:before {
    width: 76px;
}

.switch.large input:checked + .slider:before {
    transform: translateX(76px);
}

/* Update the max-width variable and add desktop variables */
:root {
    --max-width: 480px; /* Mobile width */
    --max-width-desktop: 1200px; /* Desktop width */
    --column-gap: 24px;
}

/* Update the content wrapper for desktop */
@media (min-width: 1024px) {
    .content-wrapper {
        max-width: var(--max-width-desktop);
        padding: 32px;
    }

    /* Create two-column layout for results */
    .cards-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--column-gap);
    }

    /* Make the search card span full width */
    .search-card {
        margin-bottom: var(--column-gap);
    }

    /* Adjust map height for desktop */
    .map-card {
        height: 400px;
    }

    /* Make cards taller on desktop */
    .weather-card,
    .time-card {
        min-height: 300px;
    }

    /* Enhance typography for desktop */
    .location-title {
        font-size: 28px;
    }

    .clock {
        font-size: 56px;
    }

    .temperature {
        font-size: 56px;
    }

    /* Improve spacing in weather details */
    .weather-details {
        gap: 24px;
        margin-top: 32px;
        padding-top: 32px;
    }

    /* Enhance search interface */
    .search-card h1 {
        font-size: 32px;
    }

    .search-input-group input {
        padding: 16px 20px;
        font-size: 18px;
    }

    .search-input-group button {
        padding: 16px 24px;
        font-size: 16px;
    }

    .radio-label {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Add styles for extra large screens */
@media (min-width: 1440px) {
    .content-wrapper {
        max-width: var(--max-width-desktop);
        padding: 48px;
    }

    .map-card {
        height: 500px;
    }
}

/* Add these styles for the sun card */
.sun-card {
    background: var(--gradient-sunset);
    color: #1a1a1a;
    padding: 24px;
}

.sun-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.sun-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.sun-event {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    position: relative;
    padding: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.sun-event i {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: block;
}

.sun-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.sun-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sun-time {
    font-size: 24px;
    font-weight: 700;
}

.sun-divider {
    display: none;
}

/* Update media queries for the sun card */
@media (max-width: 480px) {
    .sun-title {
        font-size: 16px;
    }

    .sun-time {
        font-size: 18px;
    }

    .sun-event i {
        font-size: 20px;
    }
}

/* Update the sun card styles for desktop */
@media (min-width: 1024px) {
    /* ... existing desktop styles ... */

    /* New sun card desktop layout */
    .sun-info {
        flex-direction: column;
        gap: 16px;
    }

    .sun-event {
        width: 100%;
        padding: 24px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }

    .sun-event i {
        margin-bottom: 0;
        font-size: 36px;
        width: 60px;
    }

    .sun-details {
        text-align: left;
    }

    .sun-time {
        font-size: 32px;
    }

    .sun-label {
        font-size: 16px;
    }

    /* Make the sun card taller */
    .sun-card {
        min-height: 300px;
        display: flex;
        flex-direction: column;
    }

    .sun-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    /* Make the sun info take up remaining space */
    .sun-info {
        flex: 1;
        justify-content: space-evenly;
    }
}

/* Add styles for the header controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme toggle specific styles */
.theme-toggle .switch {
    width: 64px;
}

.theme-slider {
    background-color: #4a5568;
}

.theme-slider i {
    color: #fff;
    font-size: 14px;
    z-index: 1;
}

.theme-slider .fa-sun {
    margin-left: 8px;
}

.theme-slider .fa-moon {
    margin-right: 8px;
}

[data-theme="dark"] .theme-slider {
    background-color: #2d3748;
}

/* Update existing switch styles to work with both toggles */
.switch {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 32px;
}

/* Adjust the transform for theme toggle */
.theme-toggle .switch input:checked + .slider:before {
    transform: translateX(32px);
}

/* Update the header controls layout */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Enhanced switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 76px;
    height: 36px;
}

/* Updated slider styles for both switches */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface);
    border: 2px solid var(--accent);
    transition: .3s;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background-color: var(--accent);
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Theme toggle specific styles */
.theme-slider {
    background-color: var(--surface);
}

.theme-slider i {
    font-size: 16px;
    z-index: 1;
    color: var(--text);
}

.theme-slider .fa-sun {
    color: #ff9800;
}

.theme-slider .fa-moon {
    color: #5c6bc0;
}

/* Temperature toggle specific styles */
.slider .c,
.slider .f {
    font-size: 15px;
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s;
}

/* Active states for both switches */
input:checked + .slider {
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(40px);
}

/* Theme toggle transform */
.theme-toggle .switch input:checked + .slider:before {
    transform: translateX(40px);
}

/* Temperature unit colors */
input:checked + .slider .c {
    color: var(--text-secondary);
}

input:checked + .slider .f {
    color: var(--accent);
}

.slider .c {
    color: var(--accent);
}

.slider .f {
    color: var(--text-secondary);
}

/* Hover effects */
.switch:hover .slider {
    border-color: var(--accent);
    opacity: 0.9;
}

.switch:hover .slider:before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Active click effect */
.switch:active .slider:before {
    transform: scale(0.95);
}

/* Update the header controls and switch styles */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Enhanced switch styles - make all switches wider */
.switch {
    position: relative;
    display: inline-block;
    width: 70px;  /* Increased width */
    height: 32px;
}

/* Updated slider styles for all switches */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4a5568;
    transition: .3s;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;  /* Increased padding */
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Common text styles for all toggles */
.slider .c,
.slider .f,
.slider .h12,
.slider .h24,
.theme-slider i {
    font-size: 14px;  /* Increased font size */
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s;
}

/* Active states for all switches */
input:checked + .slider:before {
    transform: translateX(38px);  /* Adjusted for wider switch */
}

/* Text positioning */
.slider .c,
.slider .h12 {
    margin-left: 6px;
    color: white;
}

.slider .f,
.slider .h24 {
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.5);
}

/* Active text colors */
input:checked + .slider .c,
input:checked + .slider .h12 {
    color: rgba(255, 255, 255, 0.5);
}

input:checked + .slider .f,
input:checked + .slider .h24 {
    color: white;
}

/* Theme toggle specific */
.theme-slider .fa-sun {
    color: #ffd700;
    margin-left: 6px;
}

.theme-slider .fa-moon {
    color: #f8f9fa;
    margin-right: 6px;
}

/* Hover and active states */
.switch:hover .slider:before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.switch:active .slider:before {
    transform: scale(0.95);
}

/* Dark theme adjustments */
[data-theme="dark"] .slider {
    background-color: #2d3748;
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .switch {
        width: 80px;  /* Even wider on desktop */
    }

    .slider:before {
        height: 26px;
        width: 26px;
    }

    input:checked + .slider:before {
        transform: translateX(46px);
    }

    .slider .c,
    .slider .f,
    .slider .h12,
    .slider .h24,
    .theme-slider i {
        font-size: 15px;
    }
}

/* Settings Button */
.settings-button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.settings-button:hover {
    background: var(--background);
    transform: rotate(30deg);
}

/* Settings Modal Styles */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
    /* Center content using flexbox */
    display: none;
    justify-content: center;
    align-items: center;
}

.settings-content {
    position: relative; /* Changed from absolute */
    background: var(--surface);
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px; /* Added margin for mobile spacing */
}

/* Visible state */
.settings-modal.visible {
    display: flex;
}

.settings-modal.visible .settings-content {
    opacity: 1;
    transform: scale(1);
}

/* Mobile Responsive adjustments */
@media (max-width: 480px) {
    .settings-content {
        width: 85%;
        padding: 24px;
        margin: 16px;
        /* Remove any fixed positioning or transforms */
        position: relative;
        top: auto;
        left: auto;
        transform: scale(0.95);
    }

    .settings-modal.visible .settings-content {
        transform: scale(1);
    }
}

/* Settings Content Layout */
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.settings-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Add theme-specific styles for the modal */
[data-theme="dark"] .settings-content {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="ocean"] .settings-content {
    background: var(--surface);
    border: 1px solid rgba(0, 131, 143, 0.2);
}

[data-theme="forest"] .settings-content {
    background: var(--surface);
    border: 1px solid rgba(56, 142, 60, 0.2);
}

[data-theme="desert"] .settings-content {
    background: var(--surface);
    border: 1px solid rgba(255, 111, 0, 0.2);
}

[data-theme="night"] .settings-content {
    background: var(--surface);
    border: 1px solid rgba(92, 107, 192, 0.2);
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.settings-group label {
    font-size: 16px;
    color: var(--text);
}

/* Settings Switch Styles */
.settings-control {
    width: 160px;
}

.switch.large {
    width: 160px;
    height: 40px;
    position: relative;
    display: inline-block;
}

.switch.large .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: .3s;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
}

[data-theme="dark"] .switch.large .slider {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.switch.large .slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 76px;
    left: 4px;
    background: var(--surface);
    transition: .3s;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 1;
}

/* Switch Text Styles */
.switch.large .slider .c,
.switch.large .slider .f,
.switch.large .slider .h12,
.switch.large .slider .h24,
.switch.large .theme-slider i {
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
    width: 50%;
    text-align: center;
    color: var(--text-secondary);
}

/* Active States */
.switch.large input:checked + .slider:before {
    transform: translateX(76px);
}

.switch.large input:not(:checked) + .slider .c,
.switch.large input:not(:checked) + .slider .h12,
.switch.large .theme-slider .fa-sun {
    color: var(--accent);
}

.switch.large input:checked + .slider .f,
.switch.large input:checked + .slider .h24,
.switch.large .theme-slider .fa-moon {
    color: var(--accent);
}

/* Remove any conflicting styles */
.switch,
.slider,
.slider:before {
    all: unset;
    box-sizing: border-box;
}

/* Settings Group Layout */
.settings-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-group label {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
}

/* Add Holiday Theme Variables */
[data-theme="christmas"] {
    --background: #ffffff;
    --surface: #ffffff;
    --text: #2c3e50;
    --text-secondary: #34495e;
    --accent: #d42426;  /* Christmas red */
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --gradient-blue: #2d5a27;    /* Solid Christmas green */
    --gradient-pink: #d42426;    /* Solid Christmas red */
    --gradient-sunset: #2d5a27;  /* Solid Christmas green */
}

/* Add emoji to theme options */
.settings-select option {
    padding: 8px;
    font-size: 14px;
}

.settings-select option[value="light"]::before {
    content: "☀️ ";
}

.settings-select option[value="dark"]::before {
    content: "🌙 ";
}

/* Holiday theme options already have emojis in the HTML */

/* Update Holiday Theme Variables */
[data-theme="halloween"] {
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --text: #ffffff;
    --text-secondary: #bdc3c7;
    --accent: #ff6d00;          /* Halloween orange */
    --card-shadow: 0 2px 12px rgba(255, 109, 0, 0.2);
    --gradient-blue: #6b1b1b;   /* Solid blood red */
    --gradient-pink: #ff6d00;   /* Solid Halloween orange */
    --gradient-sunset: #2d0536; /* Solid deep purple */
}

[data-theme="july4th"] {
    --background: #ffffff;      /* White background */
    --surface: #ffffff;         /* White surface */
    --text: #041e42;           /* Navy blue text */
    --text-secondary: #666666;
    --accent: #be0032;         /* American red */
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    
    /* Create red and blue gradient backgrounds for cards */
    --gradient-blue: linear-gradient(135deg, #041e42, #0a2e5c);  /* Navy blue gradient */
    --gradient-pink: linear-gradient(135deg, #be0032, #e41b3f);  /* Red gradient */
    --gradient-sunset: linear-gradient(135deg, #be0032, #041e42); /* Red to blue gradient */
}

/* July 4th specific card styles */
[data-theme="july4th"] .weather-card,
[data-theme="july4th"] .time-card,
[data-theme="july4th"] .sun-card {
    border: 2px solid #041e42;
    position: relative;
    overflow: hidden;
}

/* Add stars effect to cards */
[data-theme="july4th"] .weather-card::before,
[data-theme="july4th"] .time-card::before,
[data-theme="july4th"] .sun-card::before {
    content: '★';
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ffffff;
    font-size: 24px;
    opacity: 0.8;
}

/* July 4th specific text colors */
[data-theme="july4th"] .weather-card,
[data-theme="july4th"] .time-card,
[data-theme="july4th"] .sun-card {
    color: #ffffff;
}

[data-theme="july4th"] .weather-condition,
[data-theme="july4th"] .detail-label,
[data-theme="july4th"] .detail-value,
[data-theme="july4th"] .sun-title,
[data-theme="july4th"] .sun-label,
[data-theme="july4th"] .sun-time,
[data-theme="july4th"] .location-title,
[data-theme="july4th"] .clock,
[data-theme="july4th"] .date {
    color: #ffffff;
}

/* Style the sun events for July 4th theme */
[data-theme="july4th"] .sun-event {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

/* Add patriotic accents */
[data-theme="july4th"] .search-card {
    border-bottom: 3px solid #be0032;
}

[data-theme="july4th"] .weather-detail-item i {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Add subtle animation for the star */
@keyframes starTwinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

[data-theme="july4th"] .weather-card::before,
[data-theme="july4th"] .time-card::before,
[data-theme="july4th"] .sun-card::before {
    animation: starTwinkle 2s infinite ease-in-out;
}

/* Style the settings modal for July 4th theme */
[data-theme="july4th"] .settings-modal .settings-content {
    background: #ffffff;
    border: 2px solid #041e42;
}

[data-theme="july4th"] .settings-modal .settings-header h2 {
    color: #041e42;
}

[data-theme="july4th"] .settings-group label {
    color: #041e42;
}

/* Style the radio buttons for July 4th theme */
[data-theme="july4th"] .radio-group {
    border: 1px solid #041e42;
}

[data-theme="july4th"] .radio-option input[type="radio"]:checked + .radio-label {
    background: #041e42;
    color: #ffffff;
}

/* Add these new styles for the history card */
.history-card {
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.history-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.history-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.history-title i {
    font-size: 20px;
    color: var(--accent);
}

.expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

.history-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    opacity: 0;
}

.history-content.expanded {
    max-height: 800px;
    opacity: 1;
    padding: 16px;
}

.history-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

.history-text p {
    margin-bottom: 16px;
}

.history-text p:last-child {
    margin-bottom: 0;
}

.history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-secondary);
}

.history-loading .spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

.error-message {
    color: var(--error);
    text-align: center;
    padding: 16px;
}

/* Theme-specific styles for the history card */
[data-theme="dark"] .history-card,
[data-theme="halloween"] .history-card {
    background: var(--surface);
}

[data-theme="july4th"] .history-card {
    border: 2px solid #041e42;
    background: var(--surface);
}

[data-theme="july4th"] .history-card::before {
    content: '★';
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--accent);
    font-size: 24px;
    opacity: 0.8;
    animation: starTwinkle 2s infinite ease-in-out;
}

/* Desktop styles */
@media (min-width: 1024px) {
    .history-card {
        grid-column: span 2;
    }

    .history-content.expanded {
        max-height: 1000px;
    }

    .history-title {
        font-size: 20px;
    }

    .history-text {
        font-size: 16px;
    }
}

/* Add these styles for the Wikipedia link */
.wiki-link {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 16px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wiki-link:hover {
    background: var(--accent);
    color: white;
}

.wiki-link i {
    font-size: 20px;
}

/* Update theme-specific styles for the wiki link */
[data-theme="dark"] .wiki-link,
[data-theme="halloween"] .wiki-link {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="july4th"] .wiki-link {
    background: #041e42;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="july4th"] .wiki-link:hover {
    background: #be0032;
    border-color: transparent;
}

/* Update the history content scrollbar */
.history-content {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--background);
}

.history-content::-webkit-scrollbar {
    width: 8px;
}

.history-content::-webkit-scrollbar-track {
    background: var(--background);
}

.history-content::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
    border: 2px solid var(--background);
}

/* Add these styles for the footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 32px;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}

.footer span {
    display: inline-block;
    margin: 0 8px;
    opacity: 0.7;
}

.footer .version {
    color: var(--accent);
    font-weight: 500;
}

.footer .brand {
    font-weight: 600;
    color: var(--text);
}

/* Theme-specific footer styles */
[data-theme="july4th"] .footer {
    border-top-color: rgba(4, 30, 66, 0.1);
}

[data-theme="dark"] .footer,
[data-theme="halloween"] .footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    /* Weather Card Layout */
    .weather-card {
        padding: 32px;
    }

    .weather-main {
        gap: 32px;
        margin-bottom: 32px;
    }
    
    .weather-icon {
        width: 120px;
        height: 120px;
    }

    .temperature {
        font-size: 64px;
    }

    .weather-condition {
        font-size: 24px;
    }

    .feels-like {
        font-size: 18px;
        margin-top: 12px;
    }

    /* Weather Details Grid */
    .weather-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding-top: 24px;
    }

    /* Weather Detail Items */
    .weather-detail-item {
        height: 90px;
        padding: 16px;
    }

    .weather-detail-item i {
        font-size: 20px;
        min-width: 40px;
        height: 40px;
    }

    .detail-label {
        font-size: 13px;
    }

    .detail-value {
        font-size: 18px;
    }

    /* Map Card */
    .map-card {
        height: 400px;
    }

    /* Time Card */
    .time-card {
        padding: 32px;
    }

    .location-title {
        font-size: 32px;
    }

    .clock {
        font-size: 64px;
    }

    .date {
        font-size: 20px;
    }

    /* Sun Card */
    .sun-card {
        padding: 32px;
    }

    .sun-title {
        font-size: 24px;
    }

    .sun-time {
        font-size: 32px;
    }

    .sun-label {
        font-size: 16px;
    }

    /* History Card */
    .history-card {
        padding: 32px;
    }

    .history-title {
        font-size: 24px;
    }

    .history-text {
        font-size: 18px;
        line-height: 1.6;
    }
}

/* Extra Large Screens */
@media (min-width: 1440px) {
    .content-wrapper {
        max-width: var(--max-width-desktop);
        padding: 48px;
    }

    .weather-details {
        gap: 20px;
    }

    .weather-detail-item {
        height: 100px;
        padding: 20px;
    }

    .detail-label {
        font-size: 14px;
    }

    .detail-value {
        font-size: 20px;
    }

    .map-card {
        height: 500px;
    }
}

/* Weather Details Grid Layout */
.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Weather Detail Items Base Styles */
.weather-detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    height: 80px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.weather-detail-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.weather-detail-item i {
    font-size: 18px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #1a1a1a;
    flex-shrink: 0;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .weather-details {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
        gap: 10px; /* Reduced gap */
        padding-top: 24px;
    }

    .weather-detail-item {
        height: 70px; /* Smaller height */
        padding: 10px; /* Reduced padding */
    }

    .weather-detail-item i {
        font-size: 16px; /* Smaller icon */
        min-width: 32px;
        height: 32px;
    }

    .detail-label {
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .detail-value {
        font-size: 15px;
        font-weight: 600;
    }
}

/* Extra Large Screens */
@media (min-width: 1440px) {
    .weather-details {
        gap: 12px;
    }

    .weather-detail-item {
        height: 75px;
        padding: 12px;
    }

    .detail-label {
        font-size: 12px;
    }

    .detail-value {
        font-size: 16px;
    }
}

/* Weather Card Main Section Enhancement */
.weather-main {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    margin-bottom: 20px;
    padding: 20px;
    backdrop-filter: blur(8px);
}

/* Detail Info Layout */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    text-transform: uppercase;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-value {
    font-weight: 600;
    color: #1a1a1a;
}

/* Advanced Weather Toggle Styles */
.switch.large .slider .h12,
.switch.large .slider .h24 {
    font-size: 12px;
    width: 50%;
    text-align: center;
}

/* Update the weather details transition */
.weather-detail-item {
    transition: all 0.3s ease;
}

/* Weather Details Grid Layout */
.weather-details {
    transition: grid-template-columns 0.3s ease;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .switch.large .slider .h12,
    .switch.large .slider .h24 {
        font-size: 13px;
    }
}

/* Time Card Timezone Styles */
.timezone-info,
.timezone-offset {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    margin-top: 8px;
}

.timezone-info i,
.timezone-offset i {
    font-size: 14px;
    opacity: 0.8;
}

.timezone-info {
    margin-right: auto;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .timezone-info,
    .timezone-offset {
        font-size: 16px;
        padding: 8px 16px;
    }

    .timezone-info i,
    .timezone-offset i {
        font-size: 16px;
    }
}

/* Theme-specific styles */
[data-theme="dark"] .timezone-info,
[data-theme="dark"] .timezone-offset {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="halloween"] .timezone-info,
[data-theme="halloween"] .timezone-offset {
    background: rgba(255, 165, 0, 0.1);
}

[data-theme="christmas"] .timezone-info,
[data-theme="christmas"] .timezone-offset {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="july4th"] .timezone-info,
[data-theme="july4th"] .timezone-offset {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Add these animation keyframes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

/* Enhanced Search Card */
.search-card {
    position: relative;
    overflow: hidden;
}

.search-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.search-card:hover::after {
    left: 100%;
}

.search-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.search-button i {
    animation: float 2s infinite ease-in-out;
}

/* Enhanced Settings Button */
.settings-button {
    transition: all 0.3s ease;
}

.settings-button:hover i {
    animation: spin 1s linear infinite;
}

/* Enhanced Weather Icons */
.weather-icon {
    transition: all 0.3s ease;
}

.weather-icon:hover {
    animation: pulse 1s infinite ease-in-out;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

/* Enhanced Weather Details */
.weather-detail-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.weather-detail-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, 
        rgba(255, 255, 255, 0.2) 0%,
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.weather-detail-item:hover::before {
    opacity: 1;
}

.weather-detail-item i {
    transition: all 0.3s ease;
}

.weather-detail-item:hover i {
    transform: scale(1.2);
    animation: glow 2s infinite;
}

/* Enhanced Temperature Display */
.temperature {
    position: relative;
    transition: all 0.3s ease;
}

.temperature:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Enhanced Toggle Switches */
.switch {
    position: relative;
    cursor: pointer;
}

.slider {
    position: relative;
    overflow: hidden;
}

.slider::before {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch:hover .slider::before {
    box-shadow: 0 0 10px rgba(24, 119, 242, 0.5);
}

/* Enhanced Radio Options */
.radio-option {
    position: relative;
    overflow: hidden;
}

.radio-label {
    transition: all 0.3s ease;
}

.radio-label:hover {
    transform: translateY(-2px);
}

.radio-label i {
    transition: all 0.3s ease;
}

.radio-option:hover .radio-label i {
    animation: float 2s infinite ease-in-out;
}

/* Interactive Feedback */
.search-input-group input:focus {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Settings Modal Enhancement */
.settings-modal .settings-content {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-modal.visible .settings-content {
    transform: scale(1);
    opacity: 1;
}

/* Enhanced Theme Select */
.settings-select {
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Loading Animation Enhancement */
.spinner {
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

.spinner::after {
    width: 80%;
    height: 80%;
    border-top-color: rgba(255, 255, 255, 0.5);
    animation-duration: 0.5s;
    animation-direction: reverse;
}

/* Card Hover Effects */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Interactive Icons */
.fas, .fab {
    transition: all 0.3s ease;
}

.fas:hover, .fab:hover {
    transform: scale(1.2);
    color: var(--accent);
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    display: inline-block;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

/* Add smooth transitions for theme changes */
:root {
    transition: all 0.3s ease;
}

/* Add loading shimmer effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1)
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Responsive hover effects */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-5px);
    }
    
    .weather-detail-item:hover {
        transform: translateY(-2px);
    }
}

/* New Theme Variables */
[data-theme="ocean"] {
    --background: #e0f7fa;
    --surface: #ffffff;
    --text: #01579b;
    --text-secondary: #0277bd;
    --accent: #00838f;
    --error: #d32f2f;
    --card-shadow: 0 2px 12px rgba(0, 131, 143, 0.1);
    --gradient-blue: linear-gradient(135deg, #006064, #00acc1);
    --gradient-pink: linear-gradient(135deg, #00838f, #4dd0e1);
    --gradient-sunset: linear-gradient(135deg, #00acc1, #26c6da);
}

[data-theme="forest"] {
    --background: #e8f5e9;
    --surface: #ffffff;
    --text: #1b5e20;
    --text-secondary: #2e7d32;
    --accent: #388e3c;
    --error: #c62828;
    --card-shadow: 0 2px 12px rgba(56, 142, 60, 0.1);
    --gradient-blue: linear-gradient(135deg, #1b5e20, #43a047);
    --gradient-pink: linear-gradient(135deg, #2e7d32, #66bb6a);
    --gradient-sunset: linear-gradient(135deg, #388e3c, #81c784);
}

[data-theme="desert"] {
    --background: #fff3e0;
    --surface: #ffffff;
    --text: #bf360c;
    --text-secondary: #e65100;
    --accent: #ff6f00;
    --error: #dd2c00;
    --card-shadow: 0 2px 12px rgba(255, 111, 0, 0.1);
    --gradient-blue: linear-gradient(135deg, #ff6f00, #ffa000);
    --gradient-pink: linear-gradient(135deg, #f57c00, #ffb74d);
    --gradient-sunset: linear-gradient(135deg, #ff8f00, #ffd180);
}

[data-theme="night"] {
    --background: #1a237e;
    --surface: #283593;
    --text: #e8eaf6;
    --text-secondary: #c5cae9;
    --accent: #5c6bc0;
    --error: #ef5350;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --gradient-blue: linear-gradient(135deg, #1a237e, #3949ab);
    --gradient-pink: linear-gradient(135deg, #283593, #5c6bc0);
    --gradient-sunset: linear-gradient(135deg, #303f9f, #7986cb);
}

/* Theme-specific card styles */
[data-theme="ocean"] .weather-card,
[data-theme="ocean"] .time-card {
    background: var(--gradient-blue);
    position: relative;
    overflow: hidden;
}

[data-theme="ocean"] .weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="rgba(255,255,255,0.1)" d="M0 50 Q 25 60, 50 50 T 100 50 T 150 50" transform="translate(0,0)"><animate attributeName="d" dur="5s" repeatCount="indefinite" values="M0 50 Q 25 60, 50 50 T 100 50 T 150 50;M0 50 Q 25 40, 50 50 T 100 50 T 150 50;M0 50 Q 25 60, 50 50 T 100 50 T 150 50"/></path></svg>');
    animation: wave 10s linear infinite;
    opacity: 0.5;
}

[data-theme="forest"] .weather-card::before {
    content: '🌿';
    position: absolute;
    font-size: 100px;
    opacity: 0.1;
    right: -20px;
    bottom: -20px;
    transform: rotate(-15deg);
}

[data-theme="desert"] .weather-card {
    background: var(--gradient-sunset);
}

[data-theme="desert"] .weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><path fill="rgba(255,255,255,0.1)" d="M0 40 L80 40 L40 0 Z"/></svg>');
    background-size: 20px 20px;
    opacity: 0.1;
}

[data-theme="night"] .weather-card,
[data-theme="night"] .time-card {
    background: var(--gradient-blue);
    position: relative;
    overflow: hidden;
}

/* Night theme star background */
[data-theme="night"] .weather-card::before,
[data-theme="night"] .time-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, white, transparent),
        radial-gradient(1px 1px at 40px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 160px, white, transparent),
        radial-gradient(2px 2px at 80px 120px, white, transparent),
        radial-gradient(2px 2px at 110px 50px, white, transparent);
    background-repeat: repeat;
    animation: twinkle 4s infinite;
    opacity: 0.3;
}

/* Theme animations */
@keyframes wave {
    0% { background-position: 0 0; }
    100% { background-position: 100% 0; }
}

/* Update existing theme-specific styles to include new themes */
[data-theme="ocean"] .weather-detail-item,
[data-theme="forest"] .weather-detail-item,
[data-theme="desert"] .weather-detail-item,
[data-theme="night"] .weather-detail-item {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Theme-specific hover effects */
[data-theme="ocean"] .card:hover {
    box-shadow: 0 8px 25px rgba(0, 131, 143, 0.2);
}

[data-theme="forest"] .card:hover {
    box-shadow: 0 8px 25px rgba(56, 142, 60, 0.2);
}

[data-theme="desert"] .card:hover {
    box-shadow: 0 8px 25px rgba(255, 111, 0, 0.2);
}

[data-theme="night"] .card:hover {
    box-shadow: 0 8px 25px rgba(92, 107, 192, 0.3);
}

/* Welcome Card Styles */
.welcome-card {
    text-align: center;
    padding: 48px 24px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    margin: 24px 0;
    animation: fadeIn 0.3s ease;
}

.welcome-content {
    max-width: 500px;
    margin: 0 auto;
}

.welcome-card i {
    font-size: 64px;
    color: var(--accent);
    margin-bottom: 24px;
    animation: float 3s infinite ease-in-out;
}

.welcome-card h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 600;
}

.welcome-card p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Hide welcome card when results are shown */
.cards-container.has-results ~ .welcome-card {
    display: none;
}

/* Desktop Adjustments */
@media (min-width: 1024px) {
    .welcome-card {
        padding: 64px 48px;
        margin: 48px 0;
    }

    .welcome-card i {
        font-size: 84px;
        margin-bottom: 32px;
    }

    .welcome-card h2 {
        font-size: 36px;
        margin-bottom: 20px;
    }

    .welcome-card p {
        font-size: 20px;
    }
}

/* Theme-specific welcome card styles */
[data-theme="dark"] .welcome-card {
    background: var(--surface);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

[data-theme="ocean"] .welcome-card i {
    background: linear-gradient(135deg, #006064, #00acc1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="forest"] .welcome-card i {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="night"] .welcome-card i {
    animation: twinkle 2s infinite;
}

/* Forecast Card Styles - Compact Design */
.forecast-card {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
    padding: 20px;
    overflow: hidden;
    position: relative;
    grid-column: span 2;
}

.forecast-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.forecast-container {
    position: relative;
    overflow: hidden;
}

.forecast-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 12px;
}

.forecast-items {
    display: flex;
    gap: 12px;
    padding: 2px;
}

.forecast-item {
    flex: 0 0 auto;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.forecast-day {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.forecast-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.forecast-temp {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.temp-value {
    font-size: 20px;
    font-weight: 700;
}

.temp-unit {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.forecast-condition {
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    min-height: 30px;
    line-height: 1.2;
}

.forecast-details {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.forecast-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.forecast-detail i {
    font-size: 11px;
    opacity: 0.8;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .forecast-card {
        padding: 24px;
    }

    .forecast-items {
        justify-content: center;
        gap: 16px;
    }

    .forecast-item {
        min-width: 110px;
        padding: 14px;
    }

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

    .temp-value {
        font-size: 22px;
    }

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

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

/* Hover effects */
.forecast-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Add scroll indicator animation */
@keyframes scrollIndicator {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

.forecast-scroll::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.forecast-scroll::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 33%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    animation: scrollIndicator 2s infinite;
}

/* Add these new animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Enhanced Weather Icons */
.weather-icon {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: float 6s infinite ease-in-out;
}

/* Enhanced Weather Details */
.weather-detail-item i {
    animation: sparkle 3s infinite ease-in-out;
}

.weather-detail-item:hover i {
    animation: rotate 2s infinite linear;
}

/* Enhanced Temperature Display */
.temperature {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
}

.temperature::after {
    content: '🌡️';
    position: absolute;
    right: -30px;
    top: 0;
    font-size: 24px;
    animation: bounce 2s infinite ease-in-out;
}

/* Enhanced Forecast Items */
.forecast-item {
    position: relative;
    overflow: hidden;
}

.forecast-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 10s infinite linear;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forecast-item:hover::before {
    opacity: 1;
}

/* Enhanced Search Button */
.search-button {
    position: relative;
    overflow: hidden;
}

.search-button i {
    margin-right: 8px;
    animation: bounce 2s infinite ease-in-out;
}

.search-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 4s infinite linear;
}

/* Enhanced Settings Button */
.settings-button i {
    animation: rotate 4s infinite linear;
}

/* Enhanced Radio Labels */
.radio-label i {
    animation: float 3s infinite ease-in-out;
}

/* Enhanced Theme Select */
.settings-select option::before {
    margin-right: 8px;
    animation: bounce 2s infinite ease-in-out;
}

/* Enhanced Loading Animation */
.spinner {
    animation: rotate 1s infinite linear;
}

/* Enhanced Card Animations */
.card {
    animation: slideIn 0.5s ease-out;
}

/* Enhanced Weather Condition Text */
.weather-condition {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.weather-condition::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
    animation: float 3s infinite ease-in-out;
}

/* Weather condition icons */
.weather-condition:contains('rain')::before { content: '\f73d'; }
.weather-condition:contains('cloud')::before { content: '\f0c2'; }
.weather-condition:contains('sun')::before { content: '\f185'; }
.weather-condition:contains('clear')::before { content: '\f185'; }
.weather-condition:contains('snow')::before { content: '\f2dc'; }
.weather-condition:contains('thunder')::before { content: '\f0e7'; }
.weather-condition:contains('fog')::before { content: '\f75f'; }
.weather-condition:contains('mist')::before { content: '\f75f'; }
.weather-condition:contains('wind')::before { content: '\f72e'; }

/* Enhanced Time Display */
.clock {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.clock::before {
    content: '\f017';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    animation: rotate 10s infinite linear;
}

/* Enhanced Date Display */
.date {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.date::before {
    content: '\f133';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    animation: float 3s infinite ease-in-out;
}

/* Enhanced Location Title */
.location-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.location-title::before {
    content: '\f3c5';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    animation: bounce 2s infinite ease-in-out;
}

/* Enhanced Error Display */
.error-card {
    position: relative;
    overflow: hidden;
}

.error-card::before {
    content: '\f071';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 24px;
    animation: bounce 2s infinite ease-in-out;
}

/* Add these new animation keyframes */
@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced Card Animations */
.card {
    animation: fadeInUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.card:hover::after {
    transform: translateX(100%);
}

/* Enhanced Weather Icon */
.weather-icon {
    animation: float 6s infinite ease-in-out;
    transition: all 0.3s ease;
}

.weather-icon:hover {
    animation: heartbeat 1.5s infinite ease-in-out;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.7));
}

/* Enhanced Search Button */
.search-button {
    position: relative;
    overflow: hidden;
}

.search-button::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 1s infinite;
}

/* Enhanced Settings Button */
.settings-button i {
    transition: all 0.3s ease;
}

.settings-button:hover i {
    animation: shake 0.5s ease-in-out;
    color: var(--accent);
}

/* Enhanced Temperature Display */
.temperature {
    background: linear-gradient(90deg, var(--accent), #ff6b6b, var(--accent));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s infinite linear;
}

/* Enhanced Weather Details */
.weather-detail-item {
    position: relative;
    transition: all 0.3s ease;
}

.weather-detail-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.weather-detail-item:hover::before {
    opacity: 1;
    animation: pulse 2s infinite;
}

/* Enhanced Radio Options */
.radio-option input:checked + .radio-label {
    animation: heartbeat 0.5s ease-in-out;
}

/* Enhanced Loading State */
.spinner {
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner::before {
    inset: -10px;
    border-top-color: var(--accent);
    animation-duration: 1s;
}

.spinner::after {
    inset: -5px;
    border-top-color: rgba(255, 255, 255, 0.5);
    animation-duration: 0.5s;
    animation-direction: reverse;
}

/* Enhanced Modal Animations */
.settings-modal .settings-content {
    animation: fadeInUp 0.3s ease-out;
}

/* Enhanced Theme Select */
.settings-select {
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
    background-size: 200% 100%;
    animation: gradientShift 3s infinite linear;
}

/* Enhanced Error Message */
.error-card {
    animation: shake 0.5s ease-in-out;
}

/* Enhanced Welcome Message */
.welcome-card i {
    position: relative;
}

.welcome-card i::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: ripple 2s infinite;
}

/* Enhanced Map Controls */
.leaflet-control-zoom a {
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
    animation: pulse 1s infinite;
}

/* Enhanced Forecast Items */
.forecast-item {
    transform-origin: center bottom;
}

.forecast-item:hover {
    animation: bounce 0.5s ease-in-out;
}

/* Enhanced Switch Toggles */
.switch input:checked + .slider::before {
    animation: heartbeat 0.5s ease-in-out;
}

/* Add hover effect for all interactive elements */
button, select, input[type="radio"] + label {
    transition: all 0.3s ease;
}

button:hover, select:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Add pulse effect for important information */
.location-title, .clock {
    position: relative;
}

.location-title::after, .clock::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    opacity: 0;
    animation: pulse 2s infinite;
}

/* Card Layout - Default (Desktop) */
.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Keep your existing desktop card order */
.time-card {
    grid-column: 1 / 2;
    grid-row: 1;
}

.weather-card {
    grid-column: 2 / 3;
    grid-row: 1;
}

.history-card {
    grid-column: 1 / 3;
    grid-row: 2;
}

.sun-card {
    grid-column: 1 / 2;
    grid-row: 3;
}

.map-card {
    grid-column: 2 / 3;
    grid-row: 3;
}

.forecast-card {
    grid-column: 1 / 3;
    grid-row: 4;
}

/* Mobile Layout - Stack all cards */
@media (max-width: 768px) {
    .cards-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Reset all grid properties */
    .time-card,
    .weather-card,
    .history-card,
    .sun-card,
    .map-card,
    .forecast-card {
        grid-column: unset;
        grid-row: unset;
        width: 100%;
    }

    /* Adjust map height for mobile */
    .map-card {
        height: 250px;
    }

    /* Adjust padding for mobile */
    .content-wrapper {
        padding: 16px;
    }
}

/* Desktop Layout */
.cards-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Desktop card positions */
.cards-container .time-card {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
}

.cards-container .weather-card {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
}

.cards-container .history-card {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
}

.cards-container .sun-card {
    grid-column: 1 / 2 !important;
    grid-row: 3 !important;
}

.cards-container .map-card {
    grid-column: 2 / 3 !important;
    grid-row: 3 !important;
}

.cards-container .forecast-card {
    grid-column: 1 / 3 !important;
    grid-row: 4 !important;
}

/* Mobile Layout */
@media screen and (max-width: 768px) {
    .cards-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Reset all grid properties for mobile */
    .cards-container .time-card,
    .cards-container .weather-card,
    .cards-container .history-card,
    .cards-container .sun-card,
    .cards-container .map-card,
    .cards-container .forecast-card {
        grid-column: unset !important;
        grid-row: unset !important;
        width: 100% !important;
        margin-bottom: 16px !important;
    }

    .cards-container .map-card {
        height: 250px !important;
    }

    .content-wrapper {
        padding: 16px !important;
    }
}

/* Hide cards by default */
.cards-container {
    display: none !important;
}

/* Show cards only when has-results class is present */
.cards-container.has-results {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Mobile Layout */
@media screen and (max-width: 768px) {
    .cards-container.has-results {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* Add these styles for the sun card interaction */
.sun-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    perspective: 1000px;
}

.sun-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.sun-card.flipped .sun-card-inner {
    transform: rotateY(180deg);
}

.sun-card-front,
.sun-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    padding: 24px;
}

.sun-card-back {
    transform: rotateY(180deg);
    background: var(--gradient-blue);
}

.moon-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-light);
}

.moon-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.moon-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.moon-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.moon-phase-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
}

.moon-illumination {
    font-size: 14px;
    color: var(--text-light-secondary);
}

/* Add flip indicator */
.flip-indicator {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 14px;
    color: var(--text-light-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
}

.flip-indicator i {
    font-size: 12px;
}

/* Hover effect */
.sun-card:hover {
    transform: translateY(-2px);
}

/* Mobile optimization */
@media (max-width: 768px) {
    .moon-info {
        flex-direction: column;
        gap: 16px;
    }

    .moon-phase {
        width: 100%;
    }

    .moon-icon {
        font-size: 36px;
    }
}

/* Update moon phase styles */
.moon-info {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 60px); /* Account for title and flip indicator */
}

.moon-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    width: 100%;
    max-width: 200px;
}

/* Update moon icon to match sunset card style */
.moon-phase i {
    font-size: 32px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-bottom: 8px;
    color: var(--text-light);
    animation: float 3s infinite ease-in-out;
}

.moon-phase-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

.moon-illumination {
    font-size: 14px;
    color: var(--text-light-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .moon-phase {
        padding: 20px;
    }

    .moon-phase i {
        font-size: 28px;
        width: 56px;
        height: 56px;
    }

    .moon-phase-name {
        font-size: 16px;
    }
}

/* Mobile Layout - Update sun card size and centering */
@media screen and (max-width: 768px) {
    .sun-card {
        min-height: 450px !important;
        position: relative !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sun-card-inner {
        height: 100% !important;
        position: absolute !important;
        width: 100% !important;
    }

    .sun-card-front,
    .sun-card-back {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 24px !important;
    }

    .sun-info {
        width: 100% !important;
        padding: 20px 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        align-items: center !important;
    }

    .sun-event {
        width: 85% !important;
        padding: 24px !important;
        margin: 0 !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border-radius: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sun-event i {
        font-size: 36px !important;
        width: 72px !important;
        height: 72px !important;
    }

    /* Moon side adjustments */
    .moon-info {
        width: 100% !important;
        height: auto !important;
        padding: 20px 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .moon-phase {
        width: 85% !important;
        padding: 32px !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .moon-phase i {
        font-size: 36px !important;
        width: 72px !important;
        height: 72px !important;
    }

    /* Title adjustments */
    .sun-title,
    .moon-title {
        width: 100% !important;
        text-align: center !important;
        font-size: 22px !important;
        margin-bottom: 20px !important;
    }

    /* Flip indicator adjustments */
    .flip-indicator {
        position: absolute !important;
        bottom: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        font-size: 14px !important;
        padding: 8px 16px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 20px !important;
        backdrop-filter: blur(4px) !important;
        white-space: nowrap !important;
    }
}
