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

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #0B0E14;
  --card: #151920;
  --card-hover: #1C2129;
  --glass: rgba(21, 25, 32, 0.85);
  --text: #CBD5E1;
  --text-bright: #F1F5F9;
  --text-dim: #64748B;
  --border: rgba(255,255,255,0.06);
  --r: 20px;
  --r-sm: 14px;
}

html {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  padding-bottom: calc(72px + var(--safe-bottom));
  overflow-x: hidden;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: calc(var(--safe-top) + 20px) 20px 28px;
  min-height: 220px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  z-index: 0;
  transition: background 0.6s ease;
}
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-day {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-map-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s, background 0.2s;
}
.hero-map-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.15); }

.hero-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-summary {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  margin-bottom: 14px;
}

.hero-hotel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(171, 71, 188, 0.12);
  border: 1px solid rgba(171, 71, 188, 0.2);
  border-radius: 12px;
  font-size: 13px;
  color: #CE93D8;
}
.hero-hotel:empty { display: none; }

/* ===== Now Banner ===== */
.now-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid rgba(91, 141, 239, 0.25);
  border-radius: var(--r);
  box-shadow: 0 0 30px rgba(91, 141, 239, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}
.now-banner:active { transform: scale(0.98); }
.now-banner.hidden { display: none; }

.now-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5B8DEF;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 141, 239, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(91, 141, 239, 0); }
}

.now-text { flex: 1; min-width: 0; }
.now-label { font-size: 11px; color: #5B8DEF; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.now-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #5B8DEF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.now-nav .material-icons-round { font-size: 18px; transform: rotate(45deg); }
.now-nav.hide { display: none; }

/* ===== Timeline ===== */
.timeline {
  padding: 0 16px;
}

.spot-card {
  position: relative;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.spot-card:active { transform: scale(0.985); }
.spot-card.geo-active {
  border-color: rgba(91, 141, 239, 0.4);
  box-shadow: 0 0 30px rgba(91, 141, 239, 0.1);
}

.spot-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 0 2px 2px 0;
}

.spot-inner {
  padding: 16px 16px 16px 20px;
}

.spot-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spot-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spot-icon .material-icons-round { font-size: 20px; color: #fff; }

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

.spot-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.spot-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
}

.spot-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.spot-nav-btn:active { background: rgba(255,255,255,0.12); color: var(--text-bright); }
.spot-nav-btn .material-icons-round { font-size: 18px; transform: rotate(45deg); }

.spot-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-top: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spot-card.expanded .spot-desc {
  -webkit-line-clamp: unset;
}

.spot-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 5px 10px;
  background: rgba(38, 166, 154, 0.1);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #4DB6AC;
}
.spot-highlight::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4DB6AC;
}

.spot-drive {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.spot-drive .material-icons-round { font-size: 14px; }

.spot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.spot-tag {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

.spot-who {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.spot-who-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.spot-who-badge.yy {
  background: rgba(255, 183, 197, 0.1);
  color: #FFB7C5;
  border: 1px solid rgba(255, 183, 197, 0.15);
}
.spot-who-badge.hh {
  background: rgba(129, 199, 245, 0.1);
  color: #81C7F5;
  border: 1px solid rgba(129, 199, 245, 0.15);
}

.spot-extra {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.spot-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  border-top: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}
.spot-expand .material-icons-round { font-size: 18px; transition: transform 0.3s; }
.spot-card.expanded .spot-expand .material-icons-round { transform: rotate(180deg); }

/* ===== Day Bar ===== */
.day-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  gap: 6px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.day-bar::-webkit-scrollbar { display: none; }

.day-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition: all 0.3s ease;
}
.day-pill.active {
  background: var(--text-bright);
  color: var(--bg);
  border-color: var(--text-bright);
}
.day-pill.today {
  border-color: rgba(91, 141, 239, 0.4);
  color: #5B8DEF;
}
.day-pill.today.active {
  background: #5B8DEF;
  color: #fff;
  border-color: #5B8DEF;
}

/* ===== Map Overlay ===== */
.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}
.map-overlay.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.map-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: linear-gradient(to bottom, var(--bg), transparent);
}
.map-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.map-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}
.map-container { width: 100%; height: 100%; }

/* ===== Geo Popup ===== */
.geo-popup {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  z-index: 100;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}
.geo-popup.hidden {
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
}

.geo-popup-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid rgba(91, 141, 239, 0.3);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.geo-popup-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #5B8DEF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.geo-popup-content { flex: 1; min-width: 0; }
.geo-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}
.geo-popup-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-popup-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #5B8DEF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.geo-popup-nav .material-icons-round { font-size: 18px; transform: rotate(45deg); }
.geo-popup-close {
  position: absolute;
  top: -8px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.geo-popup-close .material-icons-round { font-size: 14px; }
.geo-popup-next {
  margin-top: 8px;
  padding: 10px 16px;
  background: var(--card);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.geo-popup-next:empty { display: none; }

/* ===== Countdown (pre-trip) ===== */
.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}
.countdown-num {
  font-size: 80px;
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1;
  background: linear-gradient(135deg, #5B8DEF, #26A69A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.countdown-label {
  font-size: 18px;
  color: var(--text-dim);
  margin-top: 8px;
}
.countdown-flight {
  margin-top: 32px;
  padding: 20px 28px;
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.countdown-flight .route {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
}
.countdown-flight .meta {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.spot-card {
  animation: fadeUp 0.5s ease both;
}
.spot-card:nth-child(1) { animation-delay: 0s; }
.spot-card:nth-child(2) { animation-delay: 0.06s; }
.spot-card:nth-child(3) { animation-delay: 0.12s; }
.spot-card:nth-child(4) { animation-delay: 0.18s; }
.spot-card:nth-child(5) { animation-delay: 0.24s; }
.spot-card:nth-child(6) { animation-delay: 0.30s; }
.spot-card:nth-child(7) { animation-delay: 0.36s; }

/* ===== Scrollbar ===== */
body::-webkit-scrollbar { display: none; }
body { scrollbar-width: none; }

/* ===== No-data ===== */
.trip-done {
  text-align: center;
  padding: 80px 20px;
}
.trip-done h2 {
  font-size: 24px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.trip-done p { color: var(--text-dim); }

.hidden { display: none !important; }
