/* homepage.css — 首页样式 */

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  animation: fadeInUp 0.6s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== Hero Weather ===== */
.hero-weather {
  position: relative;
  height: 360px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-weather__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-weather__bg canvas {
  width: 100%;
  height: 100%;
}

.hero-weather__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 28px 32px;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.05) 100%
  );
}

.hero-weather__location {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.location-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.location-time {
  color: var(--text-muted);
  margin-left: auto;
}

.hero-weather__main {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin: 12px 0;
}

.hero-temp {
  display: flex;
  align-items: flex-start;
}

.hero-temp__value {
  font-size: 4.5rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
}

.hero-temp__unit {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.hero-weather__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
}

.weather-desc {
  font-size: 1.3rem;
  color: var(--text-primary);
  font-weight: 500;
}

.weather-feels {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-weather__details {
  display: flex;
  gap: 24px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-icon {
  font-size: 1rem;
}

.detail-label {
  color: var(--text-muted);
  margin-right: 2px;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 日出日落时间轴 ===== */
.sun-timeline {
  margin-top: 8px;
}

.sun-timeline__bar {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  margin-bottom: 6px;
}

.sun-timeline__progress {
  height: 100%;
  background: linear-gradient(90deg, #ff8c42, #ffcc02, #ff8c42);
  border-radius: 3px;
  transition: width 60s linear;
}

.sun-timeline__sun {
  position: absolute;
  top: -12px;
  font-size: 1.2rem;
  transition: left 60s linear;
}

.sun-timeline__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

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

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== 目的地网格 ===== */
.destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

@media (min-width: 1200px) {
  .destinations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .destinations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .destinations-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 目的地卡片 ===== */
.dest-card {
  position: relative;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  animation: fadeInUp 0.5s ease both;
}

.dest-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.dest-card:nth-child(1) { animation-delay: 0.05s; }
.dest-card:nth-child(2) { animation-delay: 0.10s; }
.dest-card:nth-child(3) { animation-delay: 0.15s; }
.dest-card:nth-child(4) { animation-delay: 0.20s; }
.dest-card:nth-child(5) { animation-delay: 0.25s; }
.dest-card:nth-child(6) { animation-delay: 0.30s; }
.dest-card:nth-child(7) { animation-delay: 0.35s; }
.dest-card:nth-child(8) { animation-delay: 0.40s; }
.dest-card:nth-child(9) { animation-delay: 0.45s; }
.dest-card:nth-child(10) { animation-delay: 0.50s; }

.dest-card__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.dest-card__canvas canvas {
  width: 100%;
  height: 100%;
}

.dest-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.05) 40%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.dest-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dest-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dest-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}

.dest-card__temp {
  font-size: 1.4rem;
  font-weight: 300;
  color: #fff;
}

.dest-card__weather {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.dest-card__weather-icon {
  font-size: 1.2rem;
}

.dest-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dest-card__score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #ffcc02;
}

.dest-card__badge {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.dest-card__badge--bloom {
  background: rgba(255, 107, 138, 0.3);
  color: #ffb8c6;
}

.dest-card__desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 加载状态 ===== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-muted);
}

.loading-state.hidden {
  display: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== 分页 ===== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 24px 48px;
  flex-wrap: wrap;
}

.pagination-container .page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #b0aca5;
  font-weight: 500;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pagination-container .page-btn:hover {
  border-color: #c8960c;
  color: #c8960c;
}

.pagination-container .page-btn.active {
  background: #c8960c;
  border-color: #c8960c;
  color: #0a0a0a;
  font-weight: 700;
}

.pagination-container .page-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-container .page-info {
  font-size: 13px;
  color: #706c65;
  padding: 0 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero-weather {
    height: 300px;
  }

  .hero-weather__content {
    padding: 20px;
  }

  .hero-temp__value {
    font-size: 3.5rem;
  }

  .hero-weather__details {
    gap: 12px;
    flex-wrap: wrap;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
