/* route-offline-cache-v1.css
 *
 * Project Myna — offline-cache UI styles. The modal mirrors the Drive Mode
 * launcher's visual language so readers recognize the pattern. The status
 * pill matches the existing breadcrumb action-bar buttons (.btn-green) and
 * gets a "saved" treatment when the route is fully cached.
 *
 * Naming scoped under .hg-routecache- so nothing leaks to other pages.
 */

/* ─── Modal ─────────────────────────────────────────────────────────── */

.hg-routecache-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999998;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hg-routecache-modal.is-active { display: flex; }

.hg-routecache-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.hg-routecache-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: hgRoutecacheIn .22s ease-out;
  text-align: center;
}
@keyframes hgRoutecacheIn {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hg-routecache-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.hg-routecache-close:hover { color: #333; }

.hg-routecache-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}

.hg-routecache-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #222;
  line-height: 1.25;
}

.hg-routecache-lede {
  font-size: 15px;
  line-height: 1.5;
  color: #444;
  margin: 0 0 16px;
  text-align: left;
}

.hg-routecache-warn {
  background: #fff4e5;
  border: 1px solid #ffd6a1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #7a4f0a;
  margin: 0 0 16px;
  text-align: left;
}

.hg-routecache-progress {
  margin: 0 0 18px;
  text-align: left;
}
.hg-routecache-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.hg-routecache-bar-fill {
  height: 100%;
  width: 0;
  background: #1D9771;
  border-radius: inherit;
  transition: width 0.18s ease;
}
.hg-routecache-progress-text {
  font-size: 12px;
  color: #666;
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
}

.hg-routecache-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}
.hg-routecache-btn-primary,
.hg-routecache-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.hg-routecache-btn-primary {
  background: #1D9771;
  color: #fff;
  box-shadow: 0 3px 10px rgba(29,151,113,.3);
}
.hg-routecache-btn-primary:hover { opacity: .92; }
.hg-routecache-btn-primary:active { transform: scale(.97); }
.hg-routecache-btn-secondary {
  background: #f0f0f0;
  color: #444;
}
.hg-routecache-btn-secondary:hover { background: #e6e6e6; }

.hg-routecache-fineprint {
  font-size: 11px;
  color: #888;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .hg-routecache-card { padding: 24px 18px 18px; }
  .hg-routecache-card h3 { font-size: 19px; }
  .hg-routecache-lede { font-size: 14px; }
  .hg-routecache-btn-primary,
  .hg-routecache-btn-secondary {
    padding: 11px 16px;
    font-size: 14px;
    flex: 1 1 auto;
  }
}

/* ─── Status pill in the breadcrumb action bar ──────────────────────── */
/* The pill rides the existing `.btn .btn-green` styling so it matches the
   solid-green look of "All Driving Tours" / "Full Written Guide" / "Save
   Route" sitting next to it. Differentiation between saved/unsaved comes
   from icon + label text changes, not from a visual treatment that would
   make one button stand out from the rest. We only nudge things slightly
   in the saved state so the reader can tell at a glance the cache is in
   place — a darker shade of the same green, no colour swap. */
.hg-routecache-pill .hg-routecache-pill-icon {
  font-size: 13px;
}
.hg-routecache-pill.is-cached {
  /* Slightly darker green than .btn-green's default — feels "active". */
  background: #167a5b !important;
}
.hg-routecache-pill.is-cached:hover {
  background: #105e44 !important;
}

@media print {
  .hg-routecache-modal,
  .hg-routecache-pill {
    display: none !important;
  }
}
