/* =============================================
   天气组件样式 - 美化版
   ============================================= */

/* 导航栏天气小组件 */
#weatherWidget {
    display: flex;
    align-items: center;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.weather-info:hover {
    background: var(--primary-bg);
    transform: translateY(-1px);
}

.weather-icon {
    font-size: 1.1rem;
}

.weather-temp {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-city {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.weather-info:hover .weather-arrow {
    transform: rotate(180deg);
}

/* 天气弹窗 */
.weather-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 70px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.weather-modal.show {
    opacity: 1;
    visibility: visible;
}

.weather-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.weather-modal-content {
    position: relative;
    width: 94%;
    max-width: 630px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.weather-modal.show .weather-modal-content {
    transform: translateY(0) scale(1);
}

/* 弹窗头部 */
.weather-modal-header {
    padding: 20px;
    color: white;
}

.weather-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
}

.weather-location svg {
    opacity: 0.9;
}

.weather-locate-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.weather-locate-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.weather-locate-btn.loading svg {
    animation: spin 1s linear infinite;
}

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

.weather-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.weather-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 当前天气 */
.weather-current-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.weather-current-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-current-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.weather-temp-large {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1;
}

.weather-current-right {
    flex: 1;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-desc {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.weather-temp-range {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* 天气详情网格 */
.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.weather-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.weather-detail-card .detail-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.weather-detail-card .detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.weather-detail-card .detail-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* 更新时间 */
.weather-update-time {
    margin-top: 12px;
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
}

/* 弹窗主体 */
.weather-modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 城市搜索区域 */
.weather-city-section {
    margin-bottom: 16px;
}

.city-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.city-search-wrapper input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 21px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.city-search-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
    outline: none;
}

.city-search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.city-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 10;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
}

.city-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.city-result-item:hover {
    background: var(--bg-secondary);
}

.city-name {
    font-weight: 500;
    color: var(--text-primary);
}

.city-adm {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.city-result-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 热门城市 */
.hot-cities {
    padding-top: 8px;
}

.hot-cities-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.hot-cities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hot-city-tag {
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hot-city-tag:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

/* 天气预报区域 */
.weather-forecast-section {
    margin-bottom: 16px;
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.forecast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.forecast-more:hover {
    opacity: 0.8;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forecast-item {
    display: grid;
    grid-template-columns: 70px 80px 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

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

.forecast-item.today {
    background: var(--primary-bg);
}

.forecast-date {
    display: flex;
    flex-direction: column;
}

.forecast-day {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.forecast-date-num {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.forecast-weather {
    display: flex;
    align-items: center;
    gap: 6px;
}

.forecast-icon {
    font-size: 1.3rem;
}

.forecast-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.forecast-temp-bar {
    display: flex;
    align-items: center;
}

.temp-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.temp-bar .temp-low,
.temp-bar .temp-high {
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 32px;
}

.temp-bar .temp-low {
    color: var(--primary-color);
    text-align: right;
}

.temp-bar .temp-high {
    color: var(--danger-color);
    text-align: left;
}

.temp-range-bar {
    flex: 1;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--danger-color));
    border-radius: 2px;
}

.forecast-loading,
.forecast-error,
.indices-loading,
.indices-error {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 生活指数 */
.weather-indices-section {
    margin-bottom: 8px;
}

.indices-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.indices-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.index-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: background var(--transition-fast);
}

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

.index-icon {
    font-size: 1.3rem;
}

.index-info {
    display: flex;
    flex-direction: column;
}

.index-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.index-category {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* 天气提醒 - Windows 系统通知样式 */
.weather-reminder {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    animation: slideInFromRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.weather-reminder.hide {
    animation: slideOutToRight 0.3s ease forwards;
}

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

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

.weather-reminder-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 320px;
    border: 1px solid var(--border-color);
}

.reminder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.reminder-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.reminder-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.reminder-title {
    flex: 1;
}

.reminder-title h4 {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.reminder-title p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.5rem;
    font-weight: 700;
}

.reminder-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.reminder-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.reminder-body {
    padding: 12px 16px;
}

.special-advice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-left: 3px solid #FF9800;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #E65100;
    margin-bottom: 8px;
}

.special-advice svg {
    flex-shrink: 0;
}

.clothing-advice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.advice-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .weather-info {
        padding: 4px 8px;
    }
    
    .weather-city {
        display: none;
    }
    
    .weather-modal {
        padding-top: 60px;
    }
    
    .weather-modal-content {
        width: 96%;
        border-radius: 16px;
    }
    
    .weather-current-icon {
        font-size: 2.8rem;
    }
    
    .weather-temp-large {
        font-size: 2.8rem;
    }
    
    .weather-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .weather-detail-card {
        padding: 8px;
    }
    
    .forecast-item {
        grid-template-columns: 60px 70px 1fr;
        padding: 8px 10px;
    }
    
    .forecast-text {
        display: none;
    }
    
    .indices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 天气提醒移动端适配 */
    .weather-reminder {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    .weather-reminder-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .weather-current-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .weather-current-right {
        padding-left: 0;
        border-left: none;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
    }
    
    .forecast-item {
        grid-template-columns: 50px 60px 1fr;
    }
    
    .forecast-day {
        font-size: 0.8rem;
    }
    
    .temp-bar .temp-low,
    .temp-bar .temp-high {
        font-size: 0.8rem;
        min-width: 28px;
    }
    
    /* 天气提醒小屏适配 */
    .weather-reminder {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    
    .reminder-header {
        padding: 12px;
    }
    
    .reminder-icon {
        width: 36px;
        height: 36px;
    }
    
    .reminder-title h4 {
        font-size: 0.85rem;
    }
    
    .reminder-title p {
        font-size: 1.3rem;
    }
    
    .reminder-body {
        padding: 10px 12px;
    }
}
