/* style.css */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --bg: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: rgba(226, 232, 240, 0.8);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
  --glass-border: rgba(255, 255, 255, 0.4);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: #0c4a6e;
  --accent: #fbbf24;
  --accent-light: #78350f;
  --bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(51, 65, 85, 0.5);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 10;
  position: sticky;
  top: 0;
}

.logo-section h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Font Size Controls */
.font-size-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.font-size-btn {
  background: none;
  border: none;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  transition: var(--transition);
  border-right: 1px solid var(--border);
}

.font-size-btn:last-child {
  border-right: none;
}

.font-size-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.font-size-btn:active {
  transform: scale(0.95);
}

.font-size-btn i {
  font-size: 0.7rem;
}

.font-size-btn[data-size="decrease"] span {
  font-size: 0.72rem;
}

.font-size-btn[data-size="increase"] span {
  font-size: 0.95rem;
}

.font-size-reset {
  padding: 0.4rem 0.55rem;
}

.font-size-label {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
  color: var(--primary);
}

/* Font Scale Steps via CSS variable */
body {
  --font-scale: 1;
}

/* ── Font Scale: 제목(h1~h4) 제외, 전체 텍스트에 적용 ── */

/* 기본 텍스트 요소 전체에 scale 적용 */
body {
  --font-scale: 1;
}

.detail-section p,
.detail-section span:not(.eng),
.detail-section li,
.detail-section label,
.detail-section td,
.detail-section th,
.detail-section a,
.detail-section .tab-btn span,
.welcome-card p,
.logo-section p,
.food-card p,
.food-card h4,
.history-box p,
.history-box h3,
.spot-card-desc,
.spot-card-title h4,
.snippet-text,
.snippet-author,
.spot-review-snippet,
.banner-review-quote,
.banner-review-author,
.banner-score-sub,
.review-text,
.reviewer-name,
.review-meta,
.review-count-label,
.tab-content p,
.tab-content li,
.tab-content span,
.tab-content label,
.tab-content td,
.tab-content th,
.cost-note,
.daytrip-desc,
.transport-info p,
.route-calculator p,
.route-calculator label,
.result-card .value,
.result-card .label,
.detail-desc,
.spot-cat-badge,
.spot-action-btn,
.map-btn,
.start-selector label,
.start-selector select,
.modal-caption p,
.font-size-label,
.tab-btn span,
.marker-label {
  font-size: calc(var(--base-font-size, 0.85rem) * var(--font-scale));
}

/* 각 요소의 기본 사이즈 지정 */
.detail-desc { --base-font-size: 0.95rem; }
.welcome-card p { --base-font-size: 0.9rem; }
.logo-section p { --base-font-size: 0.85rem; }
.food-card p { --base-font-size: 0.85rem; }
.food-card h4 { --base-font-size: 1.05rem; }
.history-box p { --base-font-size: 0.95rem; }
.history-box h3 { --base-font-size: 1.2rem; }
.spot-card-desc { --base-font-size: 0.8rem; }
.spot-card-title h4 { --base-font-size: 0.97rem; }
.snippet-text { --base-font-size: 0.78rem; }
.snippet-author { --base-font-size: 0.68rem; }
.banner-review-quote { --base-font-size: 0.78rem; }
.banner-review-author { --base-font-size: 0.68rem; }
.banner-score-sub { --base-font-size: 0.62rem; }
.review-text { --base-font-size: 0.85rem; }
.reviewer-name { --base-font-size: 0.85rem; }
.review-meta { --base-font-size: 0.75rem; }
.review-count-label { --base-font-size: 0.8rem; }
.result-card .value { --base-font-size: 1.5rem; }
.result-card .label { --base-font-size: 0.75rem; }
.spot-cat-badge { --base-font-size: 0.68rem; }
.spot-action-btn { --base-font-size: 0.73rem; }
.map-btn { --base-font-size: 0.85rem; }
.start-selector label { --base-font-size: 0.85rem; }
.start-selector select { --base-font-size: 0.95rem; }
.tab-btn span { --base-font-size: 0.85rem; }
.marker-label { --base-font-size: 0.75rem; }
.modal-caption p { --base-font-size: 0.9rem; }
.cost-note { --base-font-size: 0.8rem; }
.daytrip-desc { --base-font-size: 0.85rem; }

@media (max-width: 768px) {
  header {
    padding: 0.45rem 0.75rem;
    gap: 0.4rem;
  }

  .logo-section h1 {
    font-size: 0.8rem;
    gap: 0.25rem;
  }

  .logo-section h1 i {
    font-size: 0.85rem;
  }

  .logo-section p {
    display: none;
  }

  .controls {
    gap: 0.4rem;
  }

  .font-size-controls {
    border-radius: 6px;
  }

  .font-size-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.65rem;
  }

  .font-size-btn[data-size="decrease"] span {
    font-size: 0.6rem;
  }

  .font-size-btn[data-size="increase"] span {
    font-size: 0.75rem;
  }

  .font-size-label {
    font-size: 0.6rem;
    min-width: 24px;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--primary-light);
  transform: rotate(15deg);
}

/* App Container Layout */
.app-container {
  display: grid;
  grid-template-columns: 1.2fr auto 1fr;
  flex: 1;
  height: calc(100vh - 78px);
  position: relative;
  transition: grid-template-columns 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Map Hidden State — PC */
.app-container.map-hidden {
  grid-template-columns: 0fr auto 1fr;
}

.app-container.map-hidden .map-section {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.app-container.map-hidden .map-toggle-btn i {
  transform: rotate(180deg);
}

/* =============================================
   Map Toggle Button — PC (세로 바)
   ============================================= */
.map-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 34px;
  min-width: 34px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 0.5rem 0;
  transition: var(--transition);
  z-index: 5;
  box-shadow: 2px 0 12px rgba(2, 132, 199, 0.2), -2px 0 12px rgba(2, 132, 199, 0.2);
}

.map-toggle-btn i {
  font-size: 1.15rem;
  writing-mode: horizontal-tb;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.map-toggle-btn span {
  writing-mode: vertical-rl;
  font-size: 0.72rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.map-toggle-btn:hover {
  width: 40px;
  min-width: 40px;
  background: linear-gradient(180deg, var(--primary-hover) 0%, #024e7c 100%);
  box-shadow: 2px 0 18px rgba(2, 132, 199, 0.35), -2px 0 18px rgba(2, 132, 199, 0.35);
}

.map-toggle-btn:active {
  transform: scaleX(0.92);
}

/* 다크모드 */
[data-theme="dark"] .map-toggle-btn {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 2px 0 12px rgba(56, 189, 248, 0.2), -2px 0 12px rgba(56, 189, 248, 0.2);
}
[data-theme="dark"] .map-toggle-btn:hover {
  box-shadow: 2px 0 18px rgba(56, 189, 248, 0.4), -2px 0 18px rgba(56, 189, 248, 0.4);
}

/* =============================================
   모바일 (1024px 이하) — 가로 바
   ============================================= */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: 40vh auto 1fr;
    height: auto;
    min-height: calc(100vh - 40px);
  }

  /* 모바일 map-hidden */
  .app-container.map-hidden {
    grid-template-columns: 1fr;
    grid-template-rows: 0fr auto 1fr;
  }
  .app-container.map-hidden .map-section {
    min-height: 0;
  }
  .app-container.map-hidden .map-toggle-btn i {
    transform: rotate(90deg);
  }

  /* 토글 버튼 → 가로 바 */
  .map-toggle-btn {
    width: 100%;
    min-width: unset;
    height: 36px;
    flex-direction: row;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    padding: 0 1rem;
    gap: 0.5rem;
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
    border-radius: 0;
  }

  .map-toggle-btn i {
    font-size: 1.1rem;
    writing-mode: horizontal-tb;
    transform: rotate(-90deg);
  }

  .map-toggle-btn span {
    writing-mode: horizontal-tb;
    font-size: 0.78rem;
    letter-spacing: 1px;
  }

  .map-toggle-btn:hover {
    width: 100%;
    min-width: unset;
    height: 40px;
    background: linear-gradient(90deg, var(--primary-hover) 0%, #024e7c 100%);
    box-shadow: 0 3px 14px rgba(2, 132, 199, 0.35);
  }

  .map-toggle-btn:active {
    transform: scaleY(0.94);
  }

  [data-theme="dark"] .map-toggle-btn {
    background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
  }
  [data-theme="dark"] .map-toggle-btn:hover {
    box-shadow: 0 3px 14px rgba(56, 189, 248, 0.4);
  }
}

/* Left Map Section */
.map-section {
  position: relative;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
  min-width: 0;
}

#main-map {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* Custom Marker Styling */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  background: var(--primary);
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -10px 0 0 -10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.marker-pin::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  position: absolute;
}

.marker-label {
  position: absolute;
  bottom: -22px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  white-space: nowrap;
  pointer-events: none;
  transition: var(--transition);
}

.custom-marker.active .marker-pin {
  background: var(--accent);
  transform: rotate(-45deg) scale(1.2);
  box-shadow: 0 0 15px var(--accent);
}

.custom-marker.active .marker-label {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Right Detail Section */
.detail-section {
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Welcome Dashboard */
.welcome-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.welcome-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

.welcome-card p {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 400px;
}

.welcome-card img {
  width: 150px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

/* Detail Dashboard */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.detail-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-title .eng {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Nav Tabs */
.tabs-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: var(--bg);
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-btn:hover {
  background: var(--border);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

/* Tab Content */
.tab-content {
  display: none;
  min-height: 250px;
}

.tab-content.active {
  display: block;
}

/* Tourism Spot Tab Layout */
.spots-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 지역 리뷰 배너 (상단 즉시 표시) */
.region-review-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg,
    rgba(var(--primary-rgb, 99,102,241), 0.08),
    rgba(var(--primary-rgb, 99,102,241), 0.03));
  border: 1px solid rgba(var(--primary-rgb, 99,102,241), 0.2);
  border-radius: 12px;
  margin-bottom: 0.25rem;
}

.banner-score {
  text-align: center;
  flex-shrink: 0;
}

.banner-score-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.banner-score-stars {
  font-size: 0.75rem;
  letter-spacing: 1px;
  margin-top: 2px;
}

.banner-score-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.banner-divider {
  width: 1px;
  height: 50px;
  background: var(--border);
  flex-shrink: 0;
}

.banner-review-text {
  flex: 1;
  min-width: 0;
}

.banner-review-quote {
  font-size: 0.78rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-review-author {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 4px;
}

.banner-naver-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 5px 10px;
  background: #03c75a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.banner-naver-link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ============================================
   새 스팟 카드 (사진 스트립 + 리뷰 바로 표시)
   ============================================ */

.spot-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.spot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  border-color: var(--primary);
}

/* 📸 사진 스트립 — 항상 보임 */
.spot-photo-strip {
  display: flex;
  height: 145px;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: var(--border);
  flex-shrink: 0;
}

.spot-photo-strip::-webkit-scrollbar { display: none; }

.spot-photo-strip img {
  height: 145px;
  width: 200px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.35s ease, filter 0.35s;
}

.spot-photo-strip img:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.spot-photo-strip.loaded {
  background: #000;
}

/* 스켈레톤 */
.photo-skeleton {
  height: 145px;
  width: 200px;
  flex-shrink: 0;
  border-radius: 0;
  background: linear-gradient(90deg,
    var(--border) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--border) 75%);
  background-size: 400% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}

.photo-skeleton.wide { width: 250px; }

/* 카드 본문 */
.spot-card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spot-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.spot-card-title h4 {
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.spot-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  background: var(--primary-light);
  color: var(--primary);
}

.cat-sea    { background: #dbeafe; color: #1d4ed8; }
.cat-mountain { background: #dcfce7; color: #15803d; }
.cat-temple { background: #fef3c7; color: #b45309; }
.cat-palace { background: #ede9fe; color: #7c3aed; }
.cat-hanok  { background: #fef9c3; color: #a16207; }
.cat-theme  { background: #fce7f3; color: #be185d; }
.cat-history { background: #ffedd5; color: #c2410c; }
.cat-valley { background: #d1fae5; color: #059669; }
.cat-island { background: #cffafe; color: #0e7490; }
.cat-wetland { background: #d1fae5; color: #047857; }
.cat-garden { background: #fce7f3; color: #9d174d; }
.cat-market { background: #fff7ed; color: #c2410c; }
.cat-museum { background: #ede9fe; color: #6d28d9; }
.cat-bridge { background: #e0f2fe; color: #0369a1; }
.cat-cable  { background: #fef3c7; color: #92400e; }
.cat-trail  { background: #dcfce7; color: #166534; }

.spot-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* 리뷰 미리보기 스니펫 */
.spot-review-snippet {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(135deg,
    rgba(var(--primary-rgb, 99,102,241), 0.06),
    rgba(var(--primary-rgb, 99,102,241), 0.02));
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

.spot-review-snippet > i {
  font-size: 0.9rem;
  color: var(--primary);
  line-height: 1;
}

.snippet-text {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

.snippet-author {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-align: right;
}

/* 액션 버튼 */
.spot-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.spot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.spot-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.naver-btn  { background: #03c75a; color: #fff; }
.blog-btn   { background: var(--border); color: var(--text); }
.youtube-btn { background: #ff0000; color: #fff; }

/* 구형 호환 스타일 (fallback) */
.spot-main-content { display: flex; width: 100%; }
.spot-card .spot-img { width: 110px; height: 110px; object-fit: cover; flex-shrink: 0; }
.spot-info { padding: 0.75rem 1rem; display: flex; flex-direction: column; flex: 1; }
.spot-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.spot-info p  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.spot-detail-expand { display: none; }
.spot-card.expanded .spot-detail-expand { display: block; }

/* Foods Tab Layout */
.foods-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .foods-list {
    grid-template-columns: 1fr;
  }
}

.food-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.food-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.food-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.food-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* History Tab Layout */
.history-box {
  background: var(--bg);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 1.5rem;
  line-height: 1.7;
}

.history-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.history-box p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Route Calculator Tab Layout */
.route-calculator {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.start-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.start-selector label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.start-selector select {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.start-selector select:focus {
  border-color: var(--primary);
}

.route-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.result-card .label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.map-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  transition: var(--transition);
  cursor: pointer;
}

.map-btn.kakao {
  background-color: #fee500;
  color: #1e1e1e;
}

.map-btn.kakao:hover {
  background-color: #e2cb00;
}

.map-btn.naver {
  background-color: #03c75a;
  color: white;
}

.map-btn.naver:hover {
  background-color: #02a84c;
}

/* Regional Map Panel inside Spot view */
.mini-map-container {
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 1rem;
}

#mini-map {
  width: 100%;
  height: 100%;
}

/* Leaflet Custom Styles to fit themes */
.leaflet-container {
  font-family: inherit !important;
}

.leaflet-bar {
  border: none !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-bar a {
  background-color: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: var(--transition) !important;
}

.leaflet-bar a:hover {
  background-color: var(--primary-light) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
}

/* Sidebar Custom Scrollbar */
.detail-section::-webkit-scrollbar {
  width: 8px;
}

.detail-section::-webkit-scrollbar-track {
  background: transparent;
}

.detail-section::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.detail-section::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Lightbox Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(15, 23, 42, 0.9); /* Dark blue tinted transparent bg */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
  width: 90%;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .modal-content img {
    height: 250px;
  }
}

.modal-caption {
  padding: 1.5rem;
  background: var(--card-bg);
  color: var(--text-main);
}

.modal-caption h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.modal-caption p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #f1f5f9;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10000;
}

.modal-close:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* ============================================
   NEW TABS: 맛집·카페, 교통편, 당일코스, 예상비용
   ============================================ */

/* ---- 맛집·카페 탭 ---- */
.restaurants-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.restaurant-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.restaurant-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.restaurant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.restaurant-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.restaurant-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
}

.restaurant-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.restaurant-menu {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.restaurant-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.restaurant-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
}

/* ---- 모바일 레이아웃 최적화 (맛집·카페 + 전반적 가독성) ---- */
@media (max-width: 640px) {
  /* 상세 섹션 패딩 축소 */
  .detail-section {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .detail-card {
    padding: 0.85rem;
    gap: 1rem;
  }

  /* 탭 버튼 3열 → 더 컴팩트 */
  .tabs-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.3rem;
  }

  .tab-btn {
    padding: 0.45rem 0.2rem;
    font-size: 0.72rem;
    gap: 0.15rem;
  }

  .tab-btn i {
    font-size: 0.95rem;
  }

  /* 맛집·카페 카드 - 모바일 최적화 */
  .restaurant-card {
    padding: 0.75rem 0.85rem;
    gap: 0.4rem;
  }

  .restaurant-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .restaurant-name {
    font-size: 0.9rem;
    flex-wrap: wrap;
    word-break: keep-all;
    line-height: 1.4;
  }

  .restaurant-type-badge {
    font-size: 0.62rem;
    padding: 1px 6px;
    flex-shrink: 0;
  }

  .restaurant-price {
    font-size: 0.78rem;
  }

  .restaurant-menu {
    font-size: 0.75rem;
  }

  .restaurant-tags {
    gap: 0.25rem;
  }

  .restaurant-tag {
    font-size: 0.62rem;
    padding: 1px 6px;
  }

  /* 음식 카드 1열로 */
  .foods-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .food-card {
    padding: 0.85rem;
  }

  .food-card h4 {
    font-size: 0.95rem;
  }

  /* 관광지 카드 모바일 */
  .spot-card-body {
    padding: 0.65rem 0.75rem;
  }

  .spot-card-title h4 {
    font-size: 0.88rem;
  }

  .spot-photo-strip {
    height: 120px;
  }

  .spot-photo-strip img {
    height: 120px;
    width: 160px;
  }

  /* 경로 계산 1열 */
  .route-results {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .map-buttons-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  /* 역사 */
  .history-box {
    padding: 1rem;
  }

  /* 웰컴 카드 */
  .welcome-card {
    padding: 1.25rem;
  }

  .welcome-card h2 {
    font-size: 1.2rem;
  }

  .welcome-card img {
    width: 100px;
  }

  /* 제목 영역 */
  .detail-title h2 {
    font-size: 1.3rem;
  }

  .detail-title .eng {
    font-size: 0.8rem;
  }
}

/* ---- 교통편 탭 ---- */
.transport-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transport-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transport-card-title {
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.6rem;
}

.transport-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.transport-row:last-child {
  border-bottom: none;
}

.transport-label {
  color: var(--text-muted);
  font-weight: 600;
}

.transport-value {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.traffic-realtime-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  transition: var(--transition);
  border: none;
  cursor: pointer;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,53,0); }
}

.traffic-realtime-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ---- 당일코스 탭 ---- */
.daytrip-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.daytrip-summary {
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.daytrip-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.daytrip-summary-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.daytrip-summary-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.65rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  padding: 0.85rem 0.75rem 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.timeline-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.timeline-cost {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

/* ---- 예상비용 탭 ---- */
.costs-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cost-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cost-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.6rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}

.cost-label {
  color: var(--text-muted);
  font-weight: 500;
}

.cost-amount {
  font-weight: 700;
  color: var(--text-main);
}

.cost-amount.free {
  color: #16a34a;
}

.cost-amount.paid {
  color: var(--accent);
}

.cost-total-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover, #0369a1));
  border-radius: 12px;
  padding: 1.25rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cost-total-label {
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.9;
}

.cost-total-amount {
  font-size: 1.6rem;
  font-weight: 900;
}

.cost-person-select {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.cost-person-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}

.cost-person-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   갤러리 스켈레톤 로딩
   ============================================ */

.gallery-skeleton {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.08) 50%, var(--border) 75%);
  background-size: 400% 100%;
  animation: skelShimmer 1.5s infinite;
  flex-shrink: 0;
}

@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gallery-loading-state {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

/* ============================================
   여행리뷰 탭 스타일
   ============================================ */

.reviews-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 점수 개요 */
.review-overview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.review-score-big {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.review-stars-big {
  font-size: 1.3rem;
  letter-spacing: 2px;
}

.review-count-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.review-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.breakdown-star {
  width: 22px;
  text-align: right;
  color: var(--text-muted);
  font-weight: 700;
}

.breakdown-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  animation: fillBar 0.8s ease-out;
}

@keyframes fillBar {
  from { width: 0 !important; }
}

.breakdown-pct {
  width: 28px;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* 플랫폼 링크 */
.review-platform-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.platform-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  transition: var(--transition);
}

.platform-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.platform-link i {
  font-size: 1.1rem;
}

.naver-link  { background: linear-gradient(135deg, #03c75a, #02a84c); }
.kakao-link  { background: linear-gradient(135deg, #fee500, #e2cd00); color: #1a1a1a; }
.youtube-link { background: linear-gradient(135deg, #ff0000, #cc0000); }
.google-link { background: linear-gradient(135deg, #4285f4, #2b69c9); }

/* 리뷰 카드 */
.review-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.review-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.review-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.reviewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.reviewer-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.review-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.review-rating-stars {
  font-size: 0.8rem;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.review-spot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  width: fit-content;
}

.review-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* 리뷰 없는 지역 플레이스홀더 */
.review-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
  border: 1px solid var(--border);
  border-radius: 14px;
}

.review-placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.review-placeholder h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.review-placeholder p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ================================================
   당일코스 시간 분석 위젯
   ================================================ */

.daytrip-time-widget {
  background: linear-gradient(135deg,
    rgba(var(--primary-rgb, 99,102,241), 0.08),
    rgba(var(--primary-rgb, 99,102,241), 0.03));
  border: 1px solid rgba(var(--primary-rgb, 99,102,241), 0.2);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.dtw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dtw-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dtw-total {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
}

/* 시간 분포 바 */
.dtw-bar-row {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 0.6rem;
}

.dtw-seg {
  height: 100%;
  min-width: 2%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.dtw-seg.go   { background: #6366f1; }
.dtw-seg.on   { background: #10b981; }
.dtw-seg.back { background: #f59e0b; }

/* 범례 */
.dtw-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.dtw-leg-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dtw-leg-item b { color: var(--text); }

.dtw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dtw-leg-item.go   .dtw-dot { background: #6366f1; }
.dtw-leg-item.on   .dtw-dot { background: #10b981; }
.dtw-leg-item.back .dtw-dot { background: #f59e0b; }

/* 하단 요약 비용 행 */
.dtw-cost-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.dtw-cost-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  border-radius: 8px;
  text-align: center;
}

.dtw-cost-item i {
  font-size: 1.1rem;
  color: var(--primary);
}

.dtw-cost-item span {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dtw-cost-item b {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

.dtw-cost-item.highlight {
  background: rgba(var(--primary-rgb, 99,102,241), 0.1);
  border: 1px solid rgba(var(--primary-rgb, 99,102,241), 0.2);
}

.dtw-cost-item.highlight b {
  color: var(--primary);
  font-size: 0.9rem;
}

/* 이동 타임라인 아이템 (출발/귀가 강조) */
.timeline-item.transport {
  background: rgba(var(--primary-rgb, 99,102,241), 0.04);
  border-left-color: var(--primary);
  opacity: 0.85;
}

.timeline-item.transport .timeline-title {
  color: var(--primary);
}

/* ================================================
   대표 리뷰 3개 즉시 표시 그리드
   ================================================ */

.top-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 900px) {
  .top-reviews-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .top-reviews-grid { grid-template-columns: 1fr; }
}

.top-rv-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.top-rv-card::before {
  content: '"';
  position: absolute;
  top: -0.2rem;
  right: 0.75rem;
  font-size: 5rem;
  color: var(--primary);
  opacity: 0.06;
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

.top-rv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
  border-color: var(--primary);
}

.top-rv-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-rv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-rv-meta {
  flex: 1;
  min-width: 0;
}

.top-rv-author {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-rv-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.top-rv-platform {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.top-rv-stars {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
}

.top-rv-rating {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f59e0b;
}

.top-rv-text {
  font-size: 0.79rem;
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rv-spot-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(var(--primary-rgb, 99,102,241), 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
}


