/* Offline viewer (issue #58). Standalone on purpose: the shell is cached and shown without the
   app's bootstrap/app.css bundle (those are fingerprinted and not part of the offline cache), so
   everything it needs lives here. Colors follow layout.css's top bar. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #212529;
  background: #f8f9fa;
  line-height: 1.45;
}

a {
  color: #052767;
}

.offline-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background-image: linear-gradient(90deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.offline-brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.offline-retry {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.offline-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 16px;
  background: #fff3cd;
  color: #664d03;
  font-size: 0.9rem;
}

.offline-last-sync {
  opacity: 0.85;
}

.offline-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.offline-title {
  font-size: 1.6rem;
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
}

.offline-subtitle {
  font-size: 1.15rem;
  margin: 24px 0 8px;
}

.offline-muted {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 2px 0;
}

.offline-empty {
  color: #6c757d;
  font-style: italic;
}

/* Notes, sight descriptions and the trip text keep their line breaks, like the online pages. */
.offline-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 6px 0;
}

.offline-back {
  display: inline-block;
  margin-bottom: 4px;
  text-decoration: none;
}

.offline-trip-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.offline-trip-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.offline-trip-card-title {
  font-weight: 600;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.offline-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 12px;
  border-bottom: 1px solid #dee2e6;
  overflow-x: auto;
}

.offline-tab {
  padding: 8px 12px;
  text-decoration: none;
  color: #495057;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.offline-tab--active {
  color: #052767;
  font-weight: 600;
  border-bottom-color: #052767;
}

.offline-day {
  margin-bottom: 20px;
}

.offline-day-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
  padding: 6px 10px;
  background: #343a40;
  color: #fff;
  border-radius: 6px;
}

.offline-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.offline-entry {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 2px 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 6px;
}

.offline-entry-time {
  font-variant-numeric: tabular-nums;
  color: #495057;
}

.offline-entry-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.offline-travel {
  grid-column: 2;
  color: #6c757d;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.offline-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.offline-card-title {
  font-size: 1.05rem;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.offline-todos {
  list-style: none;
  margin: 0;
  padding: 0;
}

.offline-todo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 6px;
}

.offline-todo-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.offline-todo--done .offline-todo-text {
  text-decoration: line-through;
  color: #6c757d;
}

.offline-todo-meta {
  width: 100%;
  padding-left: 1.6rem;
}

@media (max-width: 420px) {
  .offline-entry {
    grid-template-columns: 1fr;
  }

  .offline-travel {
    grid-column: 1;
  }
}

/* Issue #59 */
.offline-map-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Issue #61: the map tab (map styles themselves come from tripMap.css). */
.offline-map-toolbar {
  margin-bottom: 0.75rem;
}

.offline-map-select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccd3dc;
  font: inherit;
}

.trip-map.offline-map {
  height: 70vh;
}
