/* css/style.css */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局与布局 */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

main {
    flex: 1;
}

footer {
    flex-shrink: 0;
}

/* 标题区域样式 */
header {
    background: linear-gradient(135deg, #165DFF 0%, #0A2463 100%) !important;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="%23ffffff" fill-opacity="0.05" fill-rule="evenodd"/%3E%3C/svg%3E');
    opacity: 0.6;
}

header .container {
    position: relative;
    z-index: 1;
}

/* 首页卡片样式增强 */
.card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card i.bi {
    transition: all 0.3s ease;
}

.card:hover i.bi {
    transform: scale(1.1);
}

/* 导航栏活动链接样式 */
.navbar-nav .nav-link.active {
    font-weight: bold;
    color: #fff !important;
    position: relative;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #d4e6ff !important;
}

/* 地图页面 (#map.html) */
/* 使地图容器占满父容器高度 */
#leaflet-map {
    height: calc(100vh - 56px); /* 视口高度减去导航栏高度 */
}

/* 响应式地图高度 */
@media (max-width: 768px) {
    #leaflet-map {
        height: 50vh;
    }
}


/* 天气页面 (#weather.html) */
/* 确保图表响应式 */
#forecastChart {
    max-height: 300px;
    height: 300px;
}

/* 天气页面标题样式 */
h2.text-center {
    background: linear-gradient(135deg, #165DFF 0%, #0A2463 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 城市选择器样式增强 */
.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.form-select:focus {
    border-color: #165DFF;
    box-shadow: 0 0 0 0.25rem rgba(22, 93, 255, 0.1);
    outline: none;
}

/* 查询按钮样式增强 */
#getWeatherBtn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#getWeatherBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

#getWeatherBtn:active {
    transform: translateY(0);
}

/* 天气信息卡片样式 */
.card h5.card-title {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 天气指标列表样式 */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: #f8fafc;
}

/* 航拍推荐指数样式 */
.recommendation-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.recommendation-card h5.card-title {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.recommendation-card h5.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #165DFF, #36BFFA);
    border-radius: 3px;
}

/* 推荐指数列表样式 */
.recommendation-card .list-group {
    gap: 0.75rem;
    width: 100%;
}

.recommendation-card .list-group-item {
    border: none;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    display: block;
}

.recommendation-card .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

/* 进度条样式增强 */
.recommendation-card .progress {
    height: 1.4rem;
    border-radius: 20px;
    overflow: hidden;
    background-color: #f1f5f9;
    margin-top: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.recommendation-card .progress-bar {
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 600;
    text-align: right;
    padding-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.95rem;
    min-width: 30px;
}

/* 不同指数的颜色区分 */
.recommendation-card .progress-bar.bg-danger {
    background: linear-gradient(90deg, #ff6b6b, #ee5253);
}

.recommendation-card .progress-bar.bg-info {
    background: linear-gradient(90deg, #48dbfb, #0abde3);
}

.recommendation-card .progress-bar.bg-warning {
    background: linear-gradient(90deg, #feca57, #ff9f43);
}

.recommendation-card .progress-bar.bg-success {
    background: linear-gradient(90deg, #10ac84, #1dd1a1);
}

/* 进度条闪光动画 */
.recommendation-card .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 指数标签样式 */
.index-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
}

/* 天气状态徽章样式 */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* 日出日落指示器样式 */
#daylight-indicator .bg-yellow-400 {
    background-color: #fbbf24 !important;
}

#daylight-indicator .bg-yellow-500 {
    background-color: #f59e0b !important;
}

#daylight-indicator .bg-gray-200 {
    background-color: #e5e7eb !important;
}

#daylight-indicator .text-gray-500 {
    color: #6b7280 !important;
}

#sun-position {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    #forecastChart {
        height: 250px;
    }
}