/* Shiphty — Consumer vessel tracking. Light, clean, mobile-first */

:root {
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --orange: #ea580c;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Inter", -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }

/* Nav */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; position: relative; z-index: 20; }
.logo { font-size: 20px; font-weight: 800; text-decoration: none; color: var(--text); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { text-decoration: none; color: var(--text-light); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.hero-content { position: relative; z-index: 10; text-align: center; padding: 60px 24px 40px; }
.hero h1 { font-size: clamp(36px, 8vw, 64px); font-weight: 900; margin-bottom: 12px; line-height: 1.1; }
.hero-sub { font-size: 18px; color: var(--text-light); margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }
.hero-hint { font-size: 13px; color: var(--text-light); margin-top: 12px; }
.hint { background: none; border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--blue); font-family: inherit; }
.hint:hover { background: var(--blue-light); }

/* Hero map background */
.hero-map { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; opacity: 0.25; }

/* Search */
.search-box { max-width: 560px; margin: 0 auto; position: relative; z-index: 20; }
.search-input-wrap { display: flex; align-items: center; background: white; border: 2px solid var(--border); border-radius: var(--radius); padding: 4px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); transition: border-color 0.2s; }
.search-input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 4px 24px rgba(37,99,235,0.15); }
.search-icon { margin: 0 12px; flex-shrink: 0; }
.search-input { flex: 1; border: none; outline: none; font-size: 16px; padding: 14px 8px; font-family: inherit; background: transparent; }
.search-input::placeholder { color: #aaa; }

/* Autocomplete */
.autocomplete { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.1); z-index: 30; max-height: 350px; overflow-y: auto; }
.ac-item { padding: 12px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; }
.ac-item:hover { background: #f8fafc; }
.ac-item:last-child { border-bottom: none; }
.ac-name { font-weight: 600; font-size: 15px; }
.ac-meta { font-size: 12px; color: var(--text-light); }
.ac-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--blue-light); color: var(--blue); }

/* Tracking page */
.tracking { min-height: 100vh; min-height: 100dvh; }
.tracking-header { padding: 12px 24px; border-bottom: 1px solid var(--border); }
.back-btn { background: none; border: none; font-size: 14px; color: var(--blue); cursor: pointer; font-family: inherit; font-weight: 500; }
.tracking-layout { display: flex; height: calc(100vh - 50px); height: calc(100dvh - 50px); }
.track-map { flex: 2; min-width: 0; }
.track-info { flex: 0 0 360px; overflow-y: auto; padding: 24px; border-left: 1px solid var(--border); }
.track-vessel-name { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.track-vessel-meta { font-size: 14px; color: var(--text-light); margin-bottom: 20px; }
.track-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.track-stat-label { color: var(--text-light); }
.track-stat-value { font-weight: 600; }
.track-live-status { margin: 16px 0; }
.track-live-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; margin-bottom: 6px; font-size: 14px; }
.track-live-card--dark { background: #fef2f2; border-color: #fecaca; }
.track-live-card--small { background: #f8fafc; border-color: var(--border); font-size: 12px; color: var(--text-light); }
.track-live-icon { font-size: 18px; flex-shrink: 0; }
.track-live-text { line-height: 1.4; }
.track-warning { margin: 12px 0; padding: 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; font-size: 14px; color: #dc2626; font-weight: 600; }

.track-section { margin-top: 20px; }
.track-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 8px; }
.track-zone { display: inline-block; padding: 4px 12px; background: var(--blue-light); color: var(--blue); border-radius: 20px; font-size: 13px; font-weight: 500; margin: 2px; }
.track-timeline { margin-top: 8px; }
.timeline-item { display: flex; gap: 10px; padding: 8px 0; border-left: 2px solid var(--blue-light); margin-left: 10px; padding-left: 16px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.timeline-icon { font-size: 16px; flex-shrink: 0; }
.timeline-label { font-size: 14px; font-weight: 500; }
.timeline-time { font-size: 12px; color: var(--text-light); }

.track-share { margin-top: 20px; }
.track-share-url { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-light); font-family: monospace; }
.track-alert-btn { width: 100%; padding: 14px; background: var(--blue); color: white; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px; }
.track-alert-btn:hover { background: #1d4ed8; }

/* Sections */
.section { padding: 64px 24px; }
.section--alt { background: var(--bg-alt); }
.container { max-width: 900px; margin: 0 auto; }
h2 { font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 32px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { text-align: center; padding: 24px; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; margin: 0 auto 16px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-light); line-height: 1.5; }

/* Comparison */
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 700px; margin: 0 auto; }
.comp-bad, .comp-good { padding: 20px; border-radius: var(--radius); }
.comp-bad { background: #fef2f2; border: 1px solid #fecaca; }
.comp-good { background: #f0fdf4; border: 1px solid #bbf7d0; }
.comp-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; color: var(--text-light); }
.comp-msg { font-size: 14px; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.comp-msg:last-child { border-bottom: none; }
.comp-msg--dim { color: #999; font-style: italic; }

/* Use cases */
.usecases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.usecase { padding: 20px; background: white; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; line-height: 1.5; }

/* Pricing */
.pricing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; position: relative; }
.price-card--pop { border-color: var(--blue); box-shadow: 0 4px 24px rgba(37,99,235,0.1); }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--blue); color: white; padding: 4px 16px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.price-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.price-amount { font-size: 36px; font-weight: 900; margin-bottom: 16px; }
.price-amount span { font-size: 14px; font-weight: 400; color: var(--text-light); }
.price-card ul { list-style: none; flex: 1; margin-bottom: 20px; }
.price-card li { padding: 6px 0; font-size: 14px; color: var(--text-light); }
.price-card li::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: white; color: var(--text); text-decoration: none; text-align: center; width: 100%; font-family: inherit; }
.btn:hover { background: #f8fafc; }
.btn--primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn--primary:hover { background: #1d4ed8; }
.btn--lg { padding: 16px 32px; font-size: 16px; width: auto; }

/* Footer */
.footer { padding: 32px 24px; border-top: 1px solid var(--border); }
.footer-row { display: flex; justify-content: space-between; align-items: center; max-width: 900px; margin: 0 auto; font-size: 13px; color: var(--text-light); }

/* MapLibre overrides */
.maplibregl-popup-content { border-radius: 8px !important; padding: 12px 16px !important; font-family: "Inter", sans-serif !important; }

/* Modal overlay */
#add-modal { backdrop-filter: blur(4px); }

/* Wizard */
.wiz-card { padding:20px; border:2px solid var(--border); border-radius:var(--radius); cursor:pointer; transition:all 0.2s; text-align:center; }
.wiz-card:hover { border-color:var(--blue); background:var(--blue-light); transform:translateY(-2px); }
.wiz-card-icon { font-size:36px; margin-bottom:8px; }
.wiz-card-label { font-size:15px; font-weight:600; }
.wiz-card-sub { font-size:13px; color:var(--text-light); margin-top:4px; }
.wiz-step { animation: wizFadeIn 0.3s ease; }
@keyframes wizFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* Journey */
.journey-countdown { text-align:center; padding:32px 0; }
.journey-days { font-size:72px; font-weight:900; color:var(--blue); line-height:1; }
.journey-days-label { font-size:16px; color:var(--text-light); margin-top:4px; }
.journey-dest { font-size:18px; font-weight:600; margin-top:8px; }
.journey-progress { margin:20px 0; }
.journey-bar { height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.journey-bar-fill { height:100%; background:var(--blue); border-radius:4px; transition:width 0.6s ease; }
.journey-bar-labels { display:flex; justify-content:space-between; font-size:12px; color:var(--text-light); margin-top:6px; }
.journey-milestone { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #f1f5f9; font-size:14px; }
.journey-milestone-done { color:var(--green); }
.journey-milestone-future { color:var(--text-light); opacity:0.6; }
.journey-share-card { padding:20px; background:linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color:white; border-radius:var(--radius); text-align:center; margin:20px 0; }
.journey-share-card h3 { font-size:24px; font-weight:800; margin-bottom:4px; }
.journey-share-card p { opacity:0.8; font-size:14px; }

/* Dashboard responsive */
@media (max-width: 900px) {
  #dashboard-page [style*="display:flex"][style*="gap:24px"] { flex-direction: column; }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-content { padding: 40px 16px 24px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .search-input { font-size: 16px; padding: 12px 8px; }

  .tracking-layout { flex-direction: column-reverse; }
  .track-info { flex: none; max-height: 45vh; border-left: none; border-top: 1px solid var(--border); padding: 16px; }
  .track-map { flex: 1; min-height: 50vh; }
  .track-vessel-name { font-size: 20px; }

  .steps { grid-template-columns: 1fr; gap: 16px; }
  .comparison { grid-template-columns: 1fr; }
  .usecases { grid-template-columns: 1fr; }
  .pricing-cards { grid-template-columns: 1fr; }
  .footer-row { flex-direction: column; gap: 8px; text-align: center; }
}
