/* 天气组件基础样式 */
.weather-widget {
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    margin: 5px 10px;
    height: 36px;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.weather-widget:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主要天气信息 */
.weather-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* 天气弹出框 */
.weather-popup {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 16px;
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.weather-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 预报样式 */
.forecast {
    display: flex;
    gap: 12px;
    padding: 4px;
}

.forecast-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 75px;
}

.forecast-item:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.forecast-item.today {
    background: rgba(33, 150, 243, 0.08);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.forecast-date {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.forecast-icon i {
    font-size: 26px;
    margin: 4px 0;
}

.forecast-temp {
    display: flex;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.forecast-temp .high {
    color: #ff4757;
}

.forecast-temp .low {
    color: #2196f3;
}

/* 图标样式 */
/* 统一的天气图标基础样式 */
.weather-widget i,
.forecast-icon i {
    transition: all 0.3s ease;
}

.weather-widget i {
    font-size: 18px;
}

/* 统一的天气图标颜色 */
.weather-widget .fa-location-dot,
.forecast-icon .fa-location-dot { color: #ff4757; }

.weather-widget .fa-temperature-half,
.forecast-icon .fa-temperature-half { color: #ff6b81; }

.weather-widget .fa-sun,
.forecast-icon .fa-sun { color: #ffd43b; }

.weather-widget .fa-cloud,
.forecast-icon .fa-cloud { color: #74b9ff; }

.weather-widget .fa-cloud-sun,
.forecast-icon .fa-cloud-sun { color: #ffa502; }

.weather-widget .fa-cloud-rain,
.forecast-icon .fa-cloud-rain { color: #0984e3; }

.weather-widget .fa-cloud-showers-heavy,
.forecast-icon .fa-cloud-showers-heavy { color: #0652DD; }

.weather-widget .fa-snowflake,
.forecast-icon .fa-snowflake { color: #74b9ff; }

.weather-widget .fa-smog,
.forecast-icon .fa-smog { color: #a4b0be; }

.weather-widget .fa-spinner,
.forecast-icon .fa-spinner { color: #2196f3; }

/* 深色模式下的图标颜色调整 */
@media (prefers-color-scheme: dark) {
    .weather-widget .fa-sun,
    .forecast-icon .fa-sun { color: #ffd43b; }
    
    .weather-widget .fa-cloud-sun,
    .forecast-icon .fa-cloud-sun { color: #ffa502; }
    
    .weather-widget .fa-cloud,
    .forecast-icon .fa-cloud { color: #74b9ff; }
    
    .weather-widget .fa-smog,
    .forecast-icon .fa-smog { color: #c8d6e5; }
}


/* 加载状态 */
.weather-widget.loading {
    opacity: 0.7;
}

.weather-widget.loading span,
.weather-widget.loading i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .weather-popup {
        background: rgba(28, 28, 28, 0.95);
        color: #fff;
    }

    .forecast-date {
        color: #e0e0e0;
    }

    .forecast-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .forecast-item.today {
        background: rgba(33, 150, 243, 0.15);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .weather-popup {
        position: fixed;
        left: 50% !important;
        transform: translateX(-50%) translateY(10px);
        width: 90%;
        max-width: 300px;
    }

    .weather-popup.show {
        transform: translateX(-50%) translateY(0);
    }
}

.weather-details {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    background: rgba(0, 0, 0, 0.03);
}

.weather-details .detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.weather-details .detail-item:last-child {
    margin-bottom: 0;
}

.weather-details .detail-label {
    color: #666;
    font-size: 15px;
    min-width: 70px;
    font-weight: 500;
}

.weather-details .detail-value {
    color: #333;
    font-size: 15px;
    font-weight: 500;
}

.current-weather {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 8px;
}

.current-weather .temp {
    font-size: 38px;
    font-weight: 500;
    color: #333;
    letter-spacing: -1px;
}

.current-weather .description {
    font-size: 16px;
    color: #666;
    margin-top: 6px;
    font-weight: 500;
}

.current-weather .weather-icon i {
    font-size: 42px;
    color: #ffa116;
}

/* 深色模式下的样式 */
@media (prefers-color-scheme: dark) {
    .weather-details {
        background: rgba(255, 255, 255, 0.05);
    }

    .weather-details .detail-label {
        color: #bbb;
    }

    .weather-details .detail-value {
        color: #f5f5f5;
    }

    .current-weather .temp {
        color: #f5f5f5;
    }

    .current-weather .description {
        color: #e0e0e0;
    }
}
