body {
    background: #f8f9fa;
    background-image:
        var(--weather-gradient),
        repeating-linear-gradient(135deg, #ececec 0px, #ececec 1.5px, transparent 2.5px, transparent 48px),
        repeating-linear-gradient(45deg, #f2f3f4 0px, #f2f3f4 1px, transparent 2px, transparent 32px),
        radial-gradient(circle at 32px 32px, #ececec 0.4px, transparent 1px);
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    transition: background 0.3s, color 0.3s;
}
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 1100;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #333;
}
.theme-toggle.dark {
    background: rgba(30,32,34,0.15);
    border-color: rgba(255,255,255,0.1);
    color: #f8f9fa;
}
body.dark {
    background: #23272b;
    background-image:
        var(--weather-gradient),
        repeating-linear-gradient(135deg, #2c3035 0px, #2c3035 1.5px, transparent 1.5px, transparent 48px),
        repeating-linear-gradient(45deg, #26292c 0px, #26292c 1px, transparent 1px, transparent 32px),
        radial-gradient(circle at 32px 32px, #2c3035 0.4px, transparent 1px);
    color: #f8f9fa;
}
@media (prefers-color-scheme: dark) {
    body:not(.light) {
        background: #23272b;
        background-image:
            var(--weather-gradient),
            repeating-linear-gradient(135deg, #2c3035 0px, #2c3035 1.5px, transparent 1.5px, transparent 48px),
            repeating-linear-gradient(45deg, #26292c 0px, #26292c 2px, transparent 1px, transparent 32px),
            radial-gradient(circle at 32px 32px, #2c3035 0.4px, transparent 1px);
        color: #f8f9fa;
    }
}
.container {
    text-align: center;
}
img {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 32px;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.4)) drop-shadow(0 0 40px rgba(255,255,255,0.1));
    border-radius: 16px;
}
h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}
a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
a:hover {
    text-decoration: underline;
}
.weather-box {
    position: fixed;
    top: 24px;
    left: 32px;
    z-index: 1100;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #333;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: max-content;
    min-width: max-content;
    max-width: 320px;
    padding: 0.5em 1em;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s, height 0.3s cubic-bezier(.4,0,.2,1);
    overflow: visible;
}
.weather-box.expanded {
    width: 100%;
}
.weather-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8em;
    border-radius: 16px 16px 0 0;
    width: 100%;
}
.weather-main.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.weather-icon {
    font-size: 2rem;
    margin-right: 0;
    margin-left: 0.2em;
    transition: transform 0.2s;
    cursor: pointer;
}
.weather-icon:hover {
    transform: scale(1.18);
}
.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
    flex: 1;
}
.weather-city {
    font-size: 1.0em;
    font-weight: bold;
    text-align: center;
}
.weather-details {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.weather-temp, .weather-wind {
    font-size: 0.95em;
    color: #555;
}
body.dark .weather-temp, body.dark .weather-wind {
    color: #cbd1d6;
}
.weather-row {
    display: flex;
    gap: 0.5em;
    align-items: center;
    justify-content: center;
}
.weather-expand-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 0.5em;
    margin-right: 0;
    padding: 0.2em 0.5em;
}
.weather-details-card {
    width: 100%;
    color: #222;
    border-radius: 0 0 16px 16px;
    display: none;
    opacity: 0;
    height: auto;
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
}
.weather-details-card.show {
    display: block;
    width: 100%;
    opacity: 1;
    height: auto;
}
.details-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-bottom: 1em;;
}
.details-title {
    font-size: 1.1em;
    font-weight: bold;
    text-align: left;
    margin: 1.5em 0 0.2em 0;
}
.details-day {
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 0.2em;
}
.details-emoji {
    font-size: 1.3em;
    margin-right: 0.3em;
}
.details-label-fixed {
    min-width: 2.2em;
    text-align: center;
}
.details-temp {
    min-width: 6em;
    text-align: left;
}
.details-bar-bg {
    position: relative;
    flex: 1;
    height: 1.2em;
    background: rgb(200, 200, 200, 0.4);
    border-radius: 0.6em;
    margin-left: 0.5em;
    display: flex;
    align-items: center;
}
.details-bar {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #90caf9, #fbc02d);
    border-radius: 0.6em;
    z-index: 1;
}
.details-bar-label {
    position: absolute;
    top: 100%;
    font-size: 0.8em;
    color: #555;
    z-index: 2;
}
body.dark .details-bar-label {
    color: #cbd1d6;
    text-shadow: 0 1px 4px #23272b;
}
body.dark .details-bar-bg {
    background: rgb(80, 80, 80, 0.4);
}
.details-bar-label-min { left: 0; }
.details-bar-label-max { right: 0; }
body.dark .weather-box {
    background: rgba(30,32,34,0.1);
    border-color: rgba(255,255,255,0.1);
    color: #f8f9fa;
}
.weather-details-card, .weather-details-card.show {
    color: #222;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}
body.dark .weather-details-card, body.dark .weather-details-card.show {
    color: #cbd1d6;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}
.refresh-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5em;
    padding: 0.1em 0.2em;
    background: none;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    color: #007bff;
    transition: color 0.2s, transform 0.2s;
    border-radius: 4px;
}
.refresh-icon:hover {
    color: #0056b3;
    background: rgba(0,123,255,0.1);
    transform: scale(1.18);
}
body.dark .refresh-icon {
    color: #90caf9;
}
body.dark .refresh-icon:hover {
    color: #42a5f5;
    background: rgba(144,202,249,0.1);
}
.weather-icon-menu {
    position: fixed;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    min-width: 180px;
    max-width: 220px;
    display: none;
    pointer-events: auto;
    transform: translateZ(0);
}
.weather-icon-menu.show {
    display: block;
}
.icon-option {
    padding: 0.5em 0.75em;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
    color: #333;
}
.icon-option:last-child {
    border-bottom: none;
}
.icon-option:hover {
    background: rgba(255,255,255,0.1);
}
body.dark .weather-icon-menu {
    background: rgba(30,32,34,0.15);
    border-color: rgba(255,255,255,0.1);
}
body.dark .icon-option {
    color: #f8f9fa;
    border-bottom-color: rgba(255,255,255,0.1);
}
body.dark .icon-option:hover {
    background: rgba(255,255,255,0.05);
}

/* Image placeholder styles */
.image-placeholder {
    display: block;
    pointer-events: none;
    visibility: hidden;
    background: transparent !important;
    border: none !important;
    opacity: 0 !important;
}

/* Configuration UI styles */
.config-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #333;
}

body.dark .config-btn {
    background: rgba(30,32,34,0.15);
    border-color: rgba(255,255,255,0.1);
    color: #f8f9fa;
}

.config-menu {
    position: absolute;
    left: 50%;
    bottom: 280px;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    color: #333;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 20px;
    min-width: 280px;
    display: none;
    z-index: 1001;
    font-size: 14px;
    font-family: 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.dark .config-menu {
    background: rgba(30,32,34,0.1);
    color: #f8f9fa;
    border-color: rgba(255,255,255,0.1);
}

.config-reset-btn {
    width: 100%;
    padding: 8px;
    background: rgba(0, 123, 255, 0.2);
    color: inherit;
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}
