/* ================================================
   TravelTips - Responsive Stylesheet
   响应式样式表
   ================================================ */

/* ---------- Mobile (< 640px) ---------- */
@media (max-width: 639px) {
  /* Typography */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .header-title {
    font-size: 1.75rem;
  }

  .header-subtitle {
    font-size: 0.875rem;
  }

  /* Container */
  .container {
    padding: 0 var(--space-md);
  }

  /* Navigation */
  .nav-tabs {
    gap: var(--space-xs);
    padding: var(--space-md) 0;
  }

  .nav-tab {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
  }

  /* Grid */
  .dest-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Category */
  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .category-icon {
    font-size: 1.5rem;
  }

  .category-title {
    font-size: 1.25rem;
  }

  /* Detail Header */
  .detail-header {
    height: 280px;
  }

  .detail-header-content {
    padding: var(--space-lg);
  }

  .detail-title {
    font-size: 2rem;
  }

  .detail-meta {
    flex-direction: column;
    gap: var(--space-sm);
    font-size: 0.875rem;
  }

  /* Tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
  }

  /* Info Grid */
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .info-card {
    padding: var(--space-md);
  }

  .info-card-icon {
    font-size: 1.75rem;
  }

  .info-card-value {
    font-size: 1rem;
  }

  /* Card Download */
  .card-download-section {
    bottom: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
  }

  .card-download-btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-md);
  }

  /* Section Title */
  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  /* Search */
  .search-box {
    max-width: 100%;
  }
}

/* ---------- Tablet (640px - 1024px) ---------- */
@media (min-width: 640px) and (max-width: 1023px) {
  /* Grid */
  .dest-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Detail Header */
  .detail-header {
    height: 320px;
  }

  .detail-title {
    font-size: 2.5rem;
  }

  /* Info Grid */
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Desktop (>= 1024px) ---------- */
@media (min-width: 1024px) {
  /* Grid */
  .dest-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  /* Detail Header */
  .detail-header {
    height: 400px;
  }

  /* Info Grid */
  .info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Large Desktop (>= 1280px) ---------- */
@media (min-width: 1280px) {
  /* Container */
  .container {
    max-width: 1280px;
  }
}

/* ---------- Extra Large Desktop (>= 1536px) ---------- */
@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }

  .dest-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Touch Device Optimizations ---------- */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .dest-card:hover {
    transform: none;
  }

  .nav-tab:hover {
    border-color: var(--color-border);
    color: inherit;
  }

  .nav-tab:active {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }

  /* Larger touch targets */
  .tab-btn {
    padding: var(--space-md);
  }

  .checklist-item {
    padding: var(--space-lg);
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .header {
    background: none;
    color: var(--color-text);
    padding: var(--space-lg) 0;
  }

  .nav-tabs,
  .card-download-section,
  .footer {
    display: none;
  }

  .dest-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--color-border);
  }

  .detail-header {
    height: auto;
    background: var(--color-bg);
  }

  .detail-header-content {
    position: static;
    background: none;
    color: var(--color-text);
    padding: var(--space-lg);
  }

  .detail-title {
    color: var(--color-text);
  }
}

/* ---------- Dark Mode (System Preference) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-bg-card: #1e293b;
    --color-text: #f1f5f9;
    --color-text-light: #94a3b8;
    --color-border: #334155;
  }
}
