/* ══════════════════════════════════════════════════════════════════════
   KoreaPlus Hub Pages — Shared Stylesheet
   Dark theme matching the main index page aesthetic.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #000406;
  --bg2:       #070e1a;
  --bg3:       #0d1628;
  --surface:   rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.13);
  --text:      rgba(255,255,255,0.88);
  --text2:     rgba(255,255,255,0.5);
  --text3:     rgba(255,255,255,0.28);
  --accent:    #3b8eea;
  --accent2:   #74b9ff;
  --gold:      #fbbf24;
  --green:     #10b981;
  --red:       #ef4444;
  --orange:    #f97316;
  --purple:    #a78bfa;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --font:      'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }

/* ── Hub Navigation ─────────────────────────────────────────────────── */
.hub-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,4,6,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 52px;
  display: flex; align-items: center; gap: 0;
}
.hub-nav-logo { font-size: 15px; font-weight: 800; color: #fff; text-decoration: none; margin-right: 24px; white-space: nowrap; }
.hub-nav-logo span { color: var(--accent2); }
.hub-nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.hub-nav-links::-webkit-scrollbar { display: none; }
.hub-nav-link {
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  color: var(--text2); text-decoration: none; white-space: nowrap;
  transition: all 0.18s; border: 1px solid transparent;
}
.hub-nav-link:hover { color: var(--text); background: var(--surface); }
.hub-nav-link.active { color: var(--accent2); background: rgba(116,185,255,0.1); border-color: rgba(116,185,255,0.2); }

/* ── Page Layout ────────────────────────────────────────────────────── */
.hub-hero {
  padding: 40px 20px 24px;
  background: linear-gradient(160deg, #07122a 0%, #000406 100%);
  border-bottom: 1px solid var(--border);
}
.hub-hero-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.hub-hero h1 { font-size: clamp(22px,4vw,36px); font-weight: 800; color: #fff; line-height: 1.2; }
.hub-hero p  { font-size: 14px; color: var(--text2); margin-top: 8px; max-width: 560px; }

.hub-content { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }

/* ── Filter Bar ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.filter-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px; }
.filter-pill {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; transition: all 0.15s; white-space: nowrap; outline: none;
}
.filter-pill:hover { border-color: var(--border2); color: var(--text); }
.filter-pill.active { background: rgba(116,185,255,0.12); border-color: rgba(116,185,255,0.35); color: var(--accent2); }
.filter-select {
  padding: 5px 10px; border-radius: 20px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  padding-right: 24px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.filter-select:focus { border-color: var(--accent); }
.view-toggle { margin-left: auto; display: flex; gap: 4px; }
.view-btn {
  padding: 5px 10px; border-radius: 8px; font-size: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text3);
  transition: all 0.15s;
}
.view-btn.active { background: rgba(116,185,255,0.12); border-color: rgba(116,185,255,0.3); color: var(--accent2); }

/* ── Cards Grid ─────────────────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hub-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.hub-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }
.hub-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--bg3); display: block; }
.hub-card-img-placeholder { width: 100%; height: 160px; background: linear-gradient(135deg, var(--bg3) 0%, #0d2040 100%); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.hub-card-body { padding: 14px; }
.hub-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
}
.badge-festival  { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.badge-show      { background: rgba(167,139,250,0.15); color: #a78bfa; }
.badge-museum    { background: rgba(59,142,234,0.15);  color: var(--accent2); }
.badge-temple    { background: rgba(249,115,22,0.15);  color: #fb923c; }
.badge-gallery   { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-nature    { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-free      { background: rgba(16,185,129,0.12);  color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-paid      { background: rgba(255,255,255,0.05); color: var(--text3); border: 1px solid var(--border); }
.badge-unesco    { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.badge-open      { background: rgba(16,185,129,0.12);  color: #34d399; }
.badge-closed    { background: rgba(239,68,68,0.10);   color: #f87171; }
.hub-card-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.hub-card-sub  { font-size: 11px; color: var(--text2); margin-bottom: 6px; }
.hub-card-date { font-size: 11px; color: var(--accent2); font-weight: 600; margin-bottom: 6px; }
.hub-card-desc { font-size: 11px; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-card-footer { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text3); }

/* ── Calendar ───────────────────────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cal-nav-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  transition: all 0.15s;
}
.cal-nav-btn:hover { border-color: var(--border2); color: var(--text); }
.cal-month-label { font-size: 18px; font-weight: 700; color: #fff; flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-header { text-align: center; font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; padding: 6px 0; letter-spacing: 0.06em; }
.cal-day {
  min-height: 60px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 6px; cursor: pointer; transition: border-color 0.15s;
}
.cal-day:hover { border-color: var(--border2); }
.cal-day.today { border-color: var(--accent); background: rgba(59,142,234,0.08); }
.cal-day.has-events { background: rgba(251,191,36,0.04); }
.cal-day.other-month { opacity: 0.3; }
.cal-day.selected { border-color: var(--gold); background: rgba(251,191,36,0.08); }
.cal-day-num { font-size: 11px; font-weight: 600; color: var(--text2); line-height: 1; }
.cal-day.today .cal-day-num { color: var(--accent2); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot-festival { background: var(--gold); }
.cal-dot-show     { background: var(--purple); }

/* ── Map Layout ─────────────────────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; height: calc(100vh - 200px); min-height: 500px; }
.map-container { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
#leaflet-map { width: 100%; height: 100%; }
.map-sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; display: flex; flex-direction: column; gap: 8px; }
.map-list-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; cursor: pointer; transition: all 0.15s;
}
.map-list-item:hover { border-color: var(--border2); }
.map-list-item.selected { border-color: var(--accent); background: rgba(59,142,234,0.08); }
.map-list-name { font-size: 13px; font-weight: 600; color: var(--text); }
.map-list-sub  { font-size: 11px; color: var(--text2); margin-top: 2px; }
.map-list-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ── Leaflet overrides (dark theme) ─────────────────────────────────── */
.leaflet-popup-content-wrapper { background: #0d1628; color: var(--text); border: 1px solid var(--border2); border-radius: 10px; box-shadow: var(--shadow); }
.leaflet-popup-tip { background: #0d1628; }
.leaflet-popup-content { font-family: var(--font); font-size: 12px; line-height: 1.6; }
.leaflet-control-attribution { background: rgba(0,4,6,0.7) !important; color: rgba(255,255,255,0.3) !important; font-size: 9px; }
.leaflet-control-attribution a { color: rgba(255,255,255,0.4) !important; }

/* ── "Happening This Week" Carousel ────────────────────────────────── */
#week-section { padding: 32px 0; }
.week-header { display: flex; align-items: baseline; gap: 12px; padding: 0 20px; margin-bottom: 16px; }
.week-header h2 { font-size: 20px; font-weight: 800; color: #fff; }
.week-header .week-date-range { font-size: 12px; color: var(--text2); }
.week-carousel-wrap { overflow-x: auto; padding: 4px 20px 12px; scrollbar-width: none; cursor: grab; }
.week-carousel-wrap::-webkit-scrollbar { display: none; }
.week-carousel { display: flex; gap: 12px; }
.week-card {
  flex-shrink: 0; width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.2s, transform 0.15s;
}
.week-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.week-card-thumb { width: 100%; height: 110px; object-fit: cover; background: var(--bg3); display: block; }
.week-card-thumb-ph { width: 100%; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: linear-gradient(135deg, var(--bg3), #0d2040); }
.week-card-body { padding: 10px 12px; }
.week-card-type { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent2); margin-bottom: 4px; }
.week-card-name { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.week-card-date { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* Weather / AQI mini cards */
.weather-mini-card { width: 180px; }
.weather-mini-body { padding: 14px 16px; }
.weather-city { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.weather-temp { font-size: 28px; font-weight: 700; color: #fff; line-height: 1; }
.weather-cond { font-size: 11px; color: var(--text2); margin-top: 2px; }
.aqi-grade { margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.aqi-good         { background: rgba(16,185,129,0.15); color: #34d399; }
.aqi-moderate     { background: rgba(251,191,36,0.15); color: #fbbf24; }
.aqi-unhealthy    { background: rgba(249,115,22,0.15); color: #fb923c; }
.aqi-veryUnhealthy{ background: rgba(239,68,68,0.15);  color: #f87171; }
.aqi-unknown      { background: rgba(255,255,255,0.05);color: var(--text3); }

/* ── Real-Time Dashboard Widget ─────────────────────────────────────── */
#kp-dashboard {
  position: fixed; bottom: 20px; right: 20px; z-index: 9000;
  width: 260px; background: rgba(7,14,30,0.97); border: 1px solid var(--border2);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  font-family: var(--font); overflow: hidden;
  transition: height 0.3s cubic-bezier(0.34,1.15,0.64,1);
}
.kpd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer;
  user-select: none;
}
.kpd-header-left { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); }
.kpd-controls { display: flex; gap: 4px; }
.kpd-ctrl-btn {
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.07); color: var(--text2); font-size: 12px;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.kpd-ctrl-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.kpd-body { padding: 0; }
.kpd-section { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.kpd-section:last-child { border-bottom: none; }
.kpd-section-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); margin-bottom: 6px; }
.kpd-clock { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.kpd-clock-sub { font-size: 10px; color: var(--text2); margin-top: 2px; }
.kpd-weather-row { display: flex; align-items: center; gap: 8px; }
.kpd-temp { font-size: 20px; font-weight: 700; color: #fff; }
.kpd-weather-detail { font-size: 10px; color: var(--text2); line-height: 1.6; }
.kpd-rate-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.kpd-currency { font-size: 11px; font-weight: 600; color: var(--text2); }
.kpd-amount   { font-size: 11px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kpd-events-count { font-size: 13px; font-weight: 700; color: var(--gold); }
.kpd-events-sub   { font-size: 10px; color: var(--text2); margin-top: 2px; }
.kpd-link { color: var(--accent2); text-decoration: none; font-size: 10px; margin-top: 4px; display: inline-block; }
.kpd-loading { font-size: 10px; color: var(--text3); font-style: italic; }
@media (max-width: 480px) {
  #kp-dashboard { bottom: 0; right: 0; left: 0; width: 100%; border-radius: 16px 16px 0 0; }
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.hub-modal-backdrop {
  position: fixed; inset: 0; z-index: 8000; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.hub-modal-backdrop.open { opacity: 1; pointer-events: auto; }
.hub-modal {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 20px;
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7); scrollbar-width: thin;
}
.hub-modal-header { padding: 20px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.hub-modal-close { background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text2); font-size: 14px; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; flex-shrink: 0; margin-left: 12px; }
.hub-modal-body { padding: 16px 20px 24px; }
.hub-modal-img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; background: var(--bg2); }
.hub-modal-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.hub-modal-sub { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.hub-modal-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.hub-modal-info-item { background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.hub-modal-info-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); margin-bottom: 3px; }
.hub-modal-info-value { font-size: 12px; color: var(--text); }
.hub-modal-desc { font-size: 12px; color: var(--text2); line-height: 1.7; }

/* ── Night Views specifics ──────────────────────────────────────────── */
.sunset-banner { background: linear-gradient(90deg, rgba(249,115,22,0.12), rgba(251,191,36,0.06)); border: 1px solid rgba(249,115,22,0.2); border-radius: var(--radius-sm); padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sunset-icon { font-size: 24px; }
.sunset-info { flex: 1; }
.sunset-time { font-size: 16px; font-weight: 700; color: var(--gold); }
.sunset-label { font-size: 11px; color: var(--text2); }
.best-time-badge { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.25); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }

/* ── Temple specifics ───────────────────────────────────────────────── */
.temple-stay-badge { background: rgba(249,115,22,0.12); color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.temple-stay-icon { font-size: 14px; }

/* ── Loading / Empty States ─────────────────────────────────────────── */
.loading-grid { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 12px; }
.loading-spinner { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text2); }
.empty-state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }
.error-state { grid-column: 1/-1; background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm); padding: 16px; text-align: center; color: #f87171; font-size: 12px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-container { height: 340px; }
  .map-sidebar { max-height: 320px; }
  .hub-hero { padding: 28px 16px 18px; }
  .hub-content { padding: 16px 16px 48px; }
  .cards-grid { grid-template-columns: 1fr; }
  .hub-modal-info { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cal-day { min-height: 44px; }
  .filter-bar { gap: 6px; }
}
