/* ═══════════════════════════════════════════════
   CRUISEPORT — Main Stylesheet
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:wght@500;600;700&display=swap');

/* ─── RESET & VARS ──────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ocean: #0A2540;
  --ocean2: #0F3460;
  --ocean3: #1B3A5C;
  --sky: #E8F4FD;
  --sky-deep: #C5E4F7;
  --white: #FFFFFF;
  --coral: #FF6B4A;
  --coral-hover: #E85D3A;
  --coral-glow: rgba(255,107,74,0.25);
  --sand: #FFF5EB;
  --bg: #F4F6F9;
  --g50: #FAFBFC;
  --g100: #F1F3F6;
  --g200: #E2E6EC;
  --g300: #C4CAD4;
  --g400: #9CA3AF;
  --g500: #6B7280;
  --g700: #374151;
  --g900: #111827;
  --green: #10B981;
  --green-bg: #D1FAE5;
  --amber: #F59E0B;
  --amber-bg: #FEF3C7;
  --red: #EF4444;
  --red-bg: #FEE2E2;
  --blue: #3B82F6;
  --blue-bg: #DBEAFE;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 2px 16px rgba(10,37,64,0.06);
  --shadow-lg: 0 8px 40px rgba(10,37,64,0.10);
  --shadow-glow: 0 4px 24px rgba(255,107,74,0.30);
  --max-w: 480px;
  --nav-h: 72px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--g900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── LAYOUT ────────────────────────────────── */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.page-content {
  padding: 0 20px;
}

/* ─── HEADER ────────────────────────────────── */
.app-header {
  background: linear-gradient(145deg, var(--ocean), var(--ocean3));
  padding: 48px 24px 28px;
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

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

.header-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}

.header-title {
  font-family: var(--serif);
  font-size: 26px;
  color: white;
  letter-spacing: -0.02em;
}

.header-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.header-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  border: none;
  transition: background 0.2s;
}
.header-icon:hover { background: rgba(255,255,255,0.18); }

/* Progress bar */
.progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--coral), #FF8A6E);
  transition: width 0.8s ease-out;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ─── ALERT BANNER ──────────────────────────── */
.alert-banner {
  background: linear-gradient(135deg, var(--coral), var(--coral-hover));
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-glow);
  margin: 16px 0;
  cursor: pointer;
  transition: transform 0.2s;
}
.alert-banner:hover { transform: translateY(-1px); }

.alert-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.alert-text {
  flex: 1;
}
.alert-text strong {
  display: block;
  color: white;
  font-size: 14px;
  font-weight: 700;
}
.alert-text span {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
}

.alert-badge {
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── SECTION TITLES ────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 16px;
}

.section-title {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--g900);
}

.section-link {
  font-size: 13px;
  color: var(--coral);
  font-weight: 600;
}

/* ─── STOP CARDS ────────────────────────────── */
.stop-card {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.stop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stop-card.is-active {
  border: 2px solid var(--coral);
}
.stop-card.is-completed {
  opacity: 0.55;
  pointer-events: none;
}

.stop-card-img {
  width: 95px;
  min-height: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.stop-card-body {
  padding: 12px 16px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.stop-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stop-card-name {
  font-size: 16px;
  font-weight: 700;
}

.stop-card-country {
  font-size: 12px;
  color: var(--g500);
}

.stop-card-times {
  font-size: 12px;
  color: var(--g500);
  display: flex;
  gap: 10px;
}

.stop-card-aboard {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  margin-top: 2px;
}

/* Status badges */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-completed { background: var(--g200); color: var(--g500); }
.badge-active { background: var(--green-bg); color: #059669; }
.badge-upcoming { background: var(--sky); color: var(--ocean3); }

/* ─── QUICK ACTIONS ─────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.quick-card {
  background: var(--white);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: block;
  transition: transform 0.2s;
  border: none;
  text-align: left;
  width: 100%;
}
.quick-card:hover { transform: translateY(-2px); }
.quick-card-icon { font-size: 28px; margin-bottom: 8px; }
.quick-card-label { font-size: 14px; font-weight: 700; color: var(--g900); }
.quick-card-desc { font-size: 12px; color: var(--g500); }

/* ─── STOP PAGE ─────────────────────────────── */
.stop-hero {
  height: 220px;
  position: relative;
  background-size: cover;
  background-position: center;
  margin: 0 -20px;
}
.stop-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.6));
}
.stop-hero-content {
  position: absolute;
  bottom: 20px; left: 20px; right: 20px;
}
.stop-hero-title {
  font-family: var(--serif);
  font-size: 28px;
  color: white;
}
.stop-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}

.btn-back {
  position: absolute;
  top: 16px; left: 16px;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* Risk score */
.risk-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}
.risk-label { font-size: 13px; font-weight: 600; color: var(--g700); }
.risk-gauge { display: flex; align-items: center; gap: 10px; }
.risk-bar {
  width: 100px; height: 6px;
  border-radius: 3px;
  background: var(--g200);
  overflow: hidden;
}
.risk-fill { height: 100%; border-radius: 3px; transition: width 1s ease-out; }
.risk-text { font-size: 12px; font-weight: 600; }

/* ─── TABS ──────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  margin: 16px 0;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  color: var(--g700);
}
.tab:hover { border-color: var(--g300); }
.tab.active {
  background: var(--ocean);
  color: white;
  border-color: var(--ocean);
}

/* ─── ITINERARY TIMELINE ────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--g200);
}

.timeline-item {
  position: relative;
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  margin-bottom: 6px;
}

.timeline-dot {
  position: absolute;
  left: -22px; top: 18px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.timeline-dot.start, .timeline-dot.end { background: var(--coral); }
.timeline-dot.visit { background: var(--ocean); }
.timeline-dot.food { background: var(--amber); }

.timeline-time {
  font-size: 11px;
  color: var(--coral);
  font-weight: 700;
}

.timeline-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--g900);
  margin-top: 2px;
}

.timeline-dur {
  font-size: 11px;
  color: var(--g500);
  background: var(--g100);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── LIST CARDS (POI, Transport) ───────────── */
.list-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  transition: transform 0.2s;
}
.list-card:hover { transform: translateY(-1px); }

.list-card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.list-card-body { flex: 1; min-width: 0; }
.list-card-name { font-size: 15px; font-weight: 600; color: var(--g900); }
.list-card-detail { font-size: 12px; color: var(--g500); margin-top: 2px; }

.list-card-action {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ocean);
  flex-shrink: 0;
}

/* ─── BUDGET CARD ───────────────────────────── */
.budget-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.budget-total-label {
  text-align: center;
  font-size: 12px;
  color: var(--g500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.budget-total-amount {
  text-align: center;
  font-family: var(--serif);
  font-size: 38px;
  color: var(--ocean);
  margin: 4px 0 20px;
}

.budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--g100);
}
.budget-row:last-child { border-bottom: none; }

.budget-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.budget-row-left span:first-child { font-size: 18px; }
.budget-row-label { font-size: 14px; color: var(--g700); }

.budget-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.budget-bar {
  width: 60px; height: 6px;
  border-radius: 3px;
  background: var(--g100);
  overflow: hidden;
}
.budget-bar-fill { height: 100%; border-radius: 3px; }
.budget-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--g900);
  min-width: 40px;
  text-align: right;
}

/* ─── TIPS ──────────────────────────────────── */
.tip-card {
  background: var(--sand);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tip-text { font-size: 14px; color: var(--g700); line-height: 1.55; }

/* ─── REVIEWS ───────────────────────────────── */
.review-card {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.review-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--g900);
}
.review-date {
  font-size: 11px;
  color: var(--g400);
}
.review-stars { font-size: 13px; margin-bottom: 6px; }
.review-text { font-size: 14px; color: var(--g700); line-height: 1.55; }

/* ─── AI CHAT ───────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--g200);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  background: var(--white);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 82%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--white);
  border-radius: 18px 18px 18px 4px;
  color: var(--g900);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ocean), var(--ocean3));
  border-radius: 18px 18px 4px 18px;
  color: white;
}

.chat-suggestions {
  padding: 0 20px 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-suggest-btn {
  background: var(--sky);
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ocean);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-input-bar {
  padding: 12px 20px 24px;
  border-top: 1px solid var(--g200);
  display: flex;
  gap: 10px;
  background: var(--white);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--g200);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--coral); }

.chat-send-btn {
  width: 48px; height: 48px;
  background: var(--coral);
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-send-btn:hover { background: var(--coral-hover); }

/* ─── SOUVENIRS ─────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--g300);
  border-radius: 20px;
  padding: 36px 20px;
  text-align: center;
  background: var(--g100);
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.upload-zone:hover { border-color: var(--coral); }
.upload-zone-icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone-title { font-size: 15px; font-weight: 600; color: var(--g700); }
.upload-zone-sub { font-size: 13px; color: var(--g500); margin-top: 4px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.album-option {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  border: none;
  width: 100%;
  text-align: left;
}
.album-option:hover { transform: translateY(-1px); }

/* ─── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-coral {
  background: var(--coral);
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-coral:hover { background: var(--coral-hover); transform: translateY(-1px); }

.btn-ocean {
  background: var(--ocean);
  color: white;
}
.btn-ocean:hover { background: var(--ocean2); }

.btn-ghost {
  background: transparent;
  color: var(--g700);
  border: 1px solid var(--g200);
}
.btn-ghost:hover { border-color: var(--g300); background: var(--g50); }

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-block { width: 100%; }

/* ─── MAP ───────────────────────────────────── */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  height: 250px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.map-container .leaflet-container { height: 100%; width: 100%; }

/* ─── NAV BAR ───────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--g200);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 env(safe-area-inset-bottom, 16px);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 6px 12px;
  opacity: 0.4;
  transition: opacity 0.2s;
  text-decoration: none;
  color: var(--g900);
}
.nav-item.active { opacity: 1; }
.nav-item-icon { font-size: 22px; }
.nav-item-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--g500);
}
.nav-item.active .nav-item-label { color: var(--coral); }

/* ─── FORMS (login/register) ────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, var(--ocean), var(--ocean3));
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ocean);
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--g500);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--g700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--g200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--g50);
}
.form-input:focus { border-color: var(--coral); background: var(--white); }

.form-error {
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 16px;
}

.form-link {
  text-align: center;
  font-size: 13px;
  color: var(--g500);
  margin-top: 20px;
}
.form-link a { color: var(--coral); font-weight: 600; }

/* ─── MAP SECTION ───────────────────────────── */
.stop-map {
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  height: 280px;
  box-shadow: var(--shadow);
}

/* ─── LOADING ───────────────────────────────── */
.loading-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--g300);
  margin: 0 3px;
  animation: dot-pulse 1.2s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (min-width: 520px) {
  .app-shell {
    box-shadow: var(--shadow-lg);
    border-radius: 0;
    margin: 0 auto;
  }
}
