/* ============================================================
   GiPSigo — trip.css  (pagina pubblica viaggio)
   ============================================================ */

html, body { height: 100%; font-family: system-ui, sans-serif; background: #f0f4f8; color: #1e293b; }
#app { display: flex; flex-direction: column; height: 100%; }

/* topbar */
#topbar {
  background: #fff; flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  border-bottom: 1px solid #e9eef4; z-index: 1000;
}
#topbar-brand {
  padding: 5px 14px 4px;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center;
}
#topbar-brand .logo    { font-size: .95rem; }
#topbar-brand .tagline { font-size: .62rem; font-style: italic; color: #22c55e; font-weight: 600; margin-left: 4px; }
#topbar-trip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px 6px;
}
#trip-name {
  font-size: .95rem; font-weight: 700; color: #1e293b;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#topbar-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.badge         { padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.badge-active  { background: #dcfce7; color: #166534; }
.badge-ended   { background: #f1f5f9; color: #64748b; }

/* infobar */
#infobar {
  background: #fff; padding: 4px 14px; display: flex; gap: 14px; flex-wrap: wrap;
  font-size: .75rem; color: #94a3b8; flex-shrink: 0; border-bottom: 1px solid #e9eef4;
}
#infobar b { color: #475569; }

/* addressbar */
#addressbar {
  background: #f8fafc; padding: 4px 14px; display: flex; align-items: center; gap: 6px;
  font-size: .74rem; flex-shrink: 0; border-bottom: 1px solid #edf2f7; min-height: 26px;
}
.addr-ctx { font-size: .8rem; flex-shrink: 0; }
#addr-text {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #334155;
}
#maps-link {
  font-size: .7rem; color: #3b82f6; text-decoration: none;
  white-space: nowrap; flex-shrink: 0; font-weight: 600;
}
#maps-link:hover { text-decoration: underline; }

/* map */
#map { flex: 1; min-height: 0; }

/* no-data overlay */
#no-data {
  display: none; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(255,255,255,.95); padding: 24px 32px;
  border-radius: 16px; text-align: center; z-index: 900;
  border: 1px solid #e9eef4; box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
#no-data.show { display: block; }

/* checkins drawer */
#checkins-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.35); z-index: 1100;
}
#checkins-overlay.open { display: block; }
#checkins-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; max-height: 70vh;
  background: #fff; border-radius: 20px 20px 0 0; z-index: 1101;
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
#checkins-drawer.open { transform: translateY(0); }
#checkins-header {
  padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
#checkins-header h3 { font-size: .95rem; color: #1e293b; }
#checkins-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #94a3b8; }
#checkins-list { overflow-y: auto; flex: 1; }

.ci-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
  transition: background .15s;
}
.ci-item:last-child { border-bottom: none; }
.ci-item:hover, .ci-item.ci-active { background: #fff7ed; }
.ci-num {
  width: 28px; height: 28px; border-radius: 50%; background: #f97316;
  color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ci-body { flex: 1; min-width: 0; }
.ci-date { font-size: .72rem; color: #f97316; font-weight: 600; margin-bottom: 2px; }
.ci-comment { font-size: .88rem; color: #1e293b; line-height: 1.4; }
.ci-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; cursor: zoom-in;
}

/* lightbox */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.92); align-items: center; justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox-img {
  max-width: 96vw; max-height: 90vh;
  border-radius: 10px; object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
