/* ============================================================
   Korea Trip 2026 — Frontend Styles
   Mobile-first, dark aesthetic
   ============================================================ */

/* ── Reset & Variables ─────────────────────────────────── */
:root {
  --bg:          #080c14;
  --bg2:         #0d1320;
  --card:        #111824;
  --card-hover:  #141d2a;
  --gold:        #c9a96e;
  --gold-dim:    rgba(201,169,110,0.12);
  --gold-border: rgba(201,169,110,0.22);
  --teal:        #4db8b0;
  --teal-dim:    rgba(77,184,176,0.1);
  --teal-border: rgba(77,184,176,0.25);
  --red:         #e05c52;
  --cream:       #f0ebe0;
  --muted:       #7a8090;
  --muted2:      #4a5060;
  --white:       #f8f5ef;
  --border:      rgba(255,255,255,0.07);

  --header-h:    64px;
  --tab-h:       52px;
  --radius:      10px;
  --radius-sm:   6px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-kr:      'Noto Serif KR', serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Header ────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(8,12,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-kr {
  font-family: var(--font-kr);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.header-sub {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-weight: 300;
}

.info-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.info-toggle:active,
.info-toggle.active {
  color: var(--gold);
  background: var(--gold-dim);
}

/* ── Info Panel ─────────────────────────────────────────── */
/* ── Info Panel & Accordion ───────────────────────────── */
.info-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.info-panel.open {
  max-height: 1400px;
}

/* Accordion item */
.acc-item {
  border-bottom: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.acc-item:last-child { border-bottom: none; }

.acc-header {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.acc-header:active { background: rgba(255,255,255,0.03); }

.acc-header-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}
.acc-header.acc-open .acc-header-label { color: var(--gold); }

.acc-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.3s ease;
}
.acc-header.acc-open .acc-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
}
.acc-body.acc-open { max-height: 900px; }

.acc-body-inner {
  padding: 4px 16px 16px;
}

/* Hotel cards */
.hotel-card {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  position: relative;
}
.hotel-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--gold);
}
.hotel-period {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.hotel-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 2px;
}
.hotel-area {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.hotel-addr {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.hotel-notes {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 10px;
}

/* Emergency contacts */
.emergency-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.emergency-label {
  flex: 1;
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.4;
}
.emergency-label small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.emergency-phone {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  padding: 4px 0;
}
a.emergency-phone:active { opacity: 0.7; }

/* ── Day Tabs ───────────────────────────────────────────── */
.day-tabs-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(8,12,20,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.day-tabs {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 1;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: var(--tab-h);
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  scroll-snap-align: start;
  position: relative;
}

.day-tab .tab-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 2px;
}
.day-tab .tab-label {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.day-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.day-tab:active { opacity: 0.7; }

/* ── Day Content ────────────────────────────────────────── */
.day-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 100px;
  min-height: calc(100dvh - var(--header-h) - var(--tab-h));
}

.day-header-card {
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(201,169,110,0.08) 0%, transparent 60%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.day-header-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--gold), transparent);
}
.day-header-date {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1.2;
}
.day-header-theme {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}

/* ── Block Cards ────────────────────────────────────────── */
.block-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}
.block-card:active { border-color: var(--gold-border); }

/* Left accent bar */
.block-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.block-card.type-strict::before   { background: var(--gold); }
.block-card.type-free_time::before { background: var(--teal); }

.block-inner {
  padding: 16px 16px 16px 20px;
}

/* Block top row */
.block-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.block-time {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  padding-top: 2px;
}

.block-type-badge {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.type-strict   .block-type-badge {
  color: var(--gold);
  border: 1px solid rgba(201,169,110,0.35);
  background: var(--gold-dim);
}
.type-free_time .block-type-badge {
  color: var(--teal);
  border: 1px solid rgba(77,184,176,0.35);
  background: var(--teal-dim);
}

/* Block title */
.block-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 8px;
}

/* Block notes */
.block-notes {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.block-notes:empty { display: none; margin: 0; }

/* Maps button */
.maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.25);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: background 0.2s;
  text-decoration: none;
}
.maps-btn:active { background: rgba(201,169,110,0.16); }
.maps-btn svg { flex-shrink: 0; }

/* ── Alternatives ───────────────────────────────────────── */
.alts-section {
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.alts-toggle {
  width: 100%;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.alts-toggle:active { color: var(--cream); }

.alts-toggle-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.alts-toggle.open .alts-toggle-icon {
  transform: rotate(180deg);
}

.alts-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
}
.alts-body.open { max-height: 400px; }

.alt-item {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alt-item-info { flex: 1; min-width: 0; }
.alt-item-name {
  font-size: 0.85rem;
  color: var(--cream);
  line-height: 1.3;
  margin-bottom: 2px;
}
.alt-item-notes {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.4;
}
.alt-maps-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 0.9rem;
  margin-top: 2px;
  transition: background 0.2s;
  text-decoration: none;
}
.alt-maps-btn:active { background: rgba(201,169,110,0.25); }

/* ── POI List (free_time blocks) ────────────────────────── */
.poi-list {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.poi-list-label {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.poi-list-label::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--teal-border);
}

.poi-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.poi-item:last-child { border-bottom: none; }

.poi-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  margin-top: 1px;
}

.poi-info { flex: 1; min-width: 0; }
.poi-name {
  font-size: 0.87rem;
  color: var(--cream);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2px;
}
.poi-cat {
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 3px;
}
.poi-notes {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.poi-map-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(77,184,176,0.08);
  border: 1px solid rgba(77,184,176,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  font-size: 0.9rem;
  margin-top: 2px;
  text-decoration: none;
  transition: background 0.2s;
}
.poi-map-btn:active { background: rgba(77,184,176,0.2); }

/* ── Day transition animation ───────────────────────────── */
.day-content {
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Offline banner ─────────────────────────────────────── */
.offline-banner {
  position: fixed;
  bottom: -50px;
  left: 0; right: 0;
  z-index: 9999;
  padding: 12px 20px;
  background: #2a1f10;
  border-top: 1px solid rgba(201,169,110,0.3);
  text-align: center;
  font-size: 0.8rem;
  color: var(--gold);
  transition: bottom 0.3s ease;
}
.offline-banner.show { bottom: 0; }

/* ── Naver Maps button (large, standalone) ──────────────── */
.maps-btn-teal {
  background: rgba(77,184,176,0.08);
  border: 1px solid rgba(77,184,176,0.3);
  color: var(--teal);
}
.maps-btn-teal:active { background: rgba(77,184,176,0.18); }

/* ── Empty / Error state ────────────────────────────────── */
.state-msg {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.state-msg .state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

/* ── Maps button with icon ──────────────────────────────── */
.pin-icon {
  display: inline-block;
  width: 16px; height: 16px;
}

/* ── Responsive: desktop center ─────────────────────────── */
@media (min-width: 680px) {
  .day-content { padding: 24px 0 100px; }
  .block-title { font-size: 1.3rem; }
}

/* ── Weather Bar ─────────────────────────────────────────── */
.weather-bar-slot { min-height: 0; }

.weather-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 12px;
  background: rgba(77,184,176,0.06);
  border: 1px solid rgba(77,184,176,0.18);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.weather-emoji { font-size: 1rem; line-height: 1; }
.weather-temp  { color: var(--white); font-weight: 500; }
.weather-sep   { color: var(--muted2); }
.weather-label { color: var(--muted); }

/* ── POI Category Accordion ─────────────────────────────── */
.poi-cat-acc {
  border-top: 1px solid var(--border);
}
.poi-cat-acc:first-of-type { border-top: none; }

.poi-cat-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s;
}
.poi-cat-header:active { opacity: 0.7; }

.poi-cat-header-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--cream);
  font-weight: 400;
}

.poi-cat-count {
  font-size: 0.62rem;
  color: var(--muted);
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 300;
}

.poi-cat-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.25s ease;
}
.poi-cat-header.open .poi-cat-chevron {
  transform: rotate(180deg);
  color: var(--teal);
}

.poi-cat-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.poi-cat-body.open { max-height: 800px; }

/* ── Notes: expand/collapse ─────────────────────────────── */
.notes-full {
  display: none;
}
.notes-full.open {
  display: inline;
}
.notes-fade {
  color: var(--muted2);
}
.notes-toggle-btn {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  opacity: 0.85;
  transition: opacity 0.2s;
  letter-spacing: 0.03em;
}
.notes-toggle-btn:active { opacity: 0.5; }