/* ============================================================
   HESPERIDES PASSPORT — Stamp / Route / Badge UI
   + Mobile App Mode overrides for public pages
   ============================================================ */

/* ── Mobile App Mode ─────────────────────────────────────── */

/* Public pages: app bar only, no nav links */
.navbar-links,
.navbar-actions,
.navbar-toggle,
.navbar-mobile { display: none !important; }

/* Always show bottom nav on all screen sizes */
.bottom-nav { display: flex !important; }

body { padding-bottom: 64px; }

/* Hide traditional footer — app doesn't have one */
.footer { display: none !important; }

/* Bottom nav additions: 5 items (passport) */
.bottom-nav {
  justify-content: space-around;
}

/* Passport icon link in app bar */
.app-bar-passport {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-7);
  transition: all 0.2s;
}
.app-bar-passport:hover {
  background: var(--gray-9);
}

/* Ensure navbar has app-bar actions visible */
.navbar .app-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ── Stamp Action Card (city detail sidebar) ─────────────── */

.stamp-action-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stamp-visual {
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px dashed var(--gray-6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--gray-10);
}

.stamp-visual.stamped {
  border: 3px solid var(--black);
  background: var(--black);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.08);
}

.stamp-inner {
  text-align: center;
  padding: 8px;
}

.stamp-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.3;
}

.stamp-text-top,
.stamp-text-bottom {
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
  color: var(--gray-3);
  display: block;
}

.stamp-visual.stamped .stamp-text-top,
.stamp-visual.stamped .stamp-text-bottom,
.stamp-visual.stamped .stamp-ring {
  color: white;
  opacity: 0.7;
}

.stamp-city-name {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--gray-2);
  margin: 3px 0;
}

.stamp-visual.stamped .stamp-city-name {
  color: white;
}

.stamp-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.collect-stamp-btn {
  background: var(--black);
  color: white;
}

.collect-stamp-btn:hover {
  background: var(--gray-2);
  transform: translateY(-1px);
}

.stamped-btn {
  background: var(--gray-8);
  color: var(--gray-4);
  cursor: default;
}

.stamp-hint {
  font-size: 0.75rem;
  color: var(--gray-4);
  margin-top: 0.6rem;
  line-height: 1.4;
}

.stamp-info-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fff8ec;
  border: 1px solid #f0c97a;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #7a4f1a;
  line-height: 1.5;
  text-align: left;
}

.stamp-info-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: #7a4f1a;
  text-decoration: underline;
}

/* ── Route Progress in city sidebar ─────────────────────── */

.city-route-card {
  border: 1px solid var(--gray-8);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
}

.city-route-card:hover {
  border-color: var(--gray-5);
  background: var(--gray-10);
}

.city-route-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--black);
}

.city-route-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-route-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-8);
  border-radius: 2px;
  overflow: hidden;
}

.city-route-bar-fill {
  height: 100%;
  background: var(--black);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.city-route-pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-4);
  min-width: 32px;
  text-align: right;
}

/* ── Badge Toast ─────────────────────────────────────────── */

.badge-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: white;
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 240px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.badge-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.badge-toast-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.badge-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-toast-text strong {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.badge-toast-text span {
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── Passport Page ───────────────────────────────────────── */

.passport-page-header {
  background: var(--black);
  padding: 5rem 0 2rem;
  color: white;
}

.passport-page-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.passport-page-header p {
  opacity: 0.6;
  font-size: 0.95rem;
}

.passport-stats {
  display: flex;
  gap: 0;
  background: var(--black);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.pstat {
  flex: 1;
  text-align: center;
  padding: 1.25rem 0.5rem;
  color: white;
  position: relative;
}

.pstat + .pstat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255,255,255,0.15);
}

.pstat-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.pstat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.5;
  text-transform: uppercase;
  margin-top: 4px;
}

.passport-section {
  margin-bottom: 2.5rem;
}

.passport-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.passport-section-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.passport-section-count {
  background: var(--gray-9);
  color: var(--gray-3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.passport-stamps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.passport-stamp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.passport-stamp-visual {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--gray-7);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-9);
  transition: transform 0.2s;
}

.passport-stamp-visual.stamped {
  border-color: var(--black);
  background: var(--black);
}

.passport-stamp-visual.stamped .stamp-city-name { color: white; }
.passport-stamp-visual.stamped .stamp-text-top,
.passport-stamp-visual.stamped .stamp-text-bottom,
.passport-stamp-visual.stamped .stamp-ring { color: white; opacity: 0.6; }

.passport-stamp-item:hover .passport-stamp-visual { transform: scale(1.05); }

.passport-stamp-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--gray-2);
}

/* Route cards */
.passport-routes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.passport-route-card {
  border: 1px solid var(--gray-8);
  border-radius: 16px;
  overflow: hidden;
  background: white;
  transition: box-shadow 0.2s;
}

.passport-route-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.passport-route-card.completed { border-color: var(--black); }

.passport-route-cover {
  height: 120px;
  background-size: cover;
  background-position: center;
  filter: grayscale(60%);
}

.passport-route-body { padding: 1rem; }

.passport-route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.passport-route-region {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-4);
}

.passport-route-done {
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  background: var(--black);
  padding: 2px 10px;
  border-radius: 20px;
}

.passport-route-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.passport-route-desc {
  font-size: 0.85rem;
  color: var(--gray-3);
  line-height: 1.5;
  margin-bottom: 0.875rem;
}

.passport-route-progress {
  margin-bottom: 0.75rem;
}

.route-progress-bar {
  height: 6px;
  background: var(--gray-8);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.route-progress-fill {
  height: 100%;
  background: var(--black);
  border-radius: 3px;
  transition: width 0.8s ease;
}

.route-progress-label {
  font-size: 0.75rem;
  color: var(--gray-4);
  font-weight: 600;
}

.passport-route-reward {
  font-size: 0.8rem;
  color: var(--gray-4);
  padding: 6px 10px;
  background: var(--gray-9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.passport-route-reward.earned {
  background: var(--black);
  color: white;
}

.reward-earned-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.passport-route-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.passport-route-city {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-3);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--gray-7);
  border-radius: 20px;
  transition: all 0.15s;
}

.passport-route-city:hover { background: var(--gray-9); }

.passport-route-city.visited {
  border-color: var(--black);
  background: var(--black);
  color: white;
}

.prc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-5);
  flex-shrink: 0;
}

.prc-dot.visited { background: white; }

/* Badges */
.passport-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.875rem;
}

.passport-badge {
  border: 1px solid var(--gray-8);
  border-radius: 14px;
  padding: 1.25rem 0.75rem;
  text-align: center;
  background: white;
  transition: all 0.2s;
}

.passport-badge.earned {
  border-color: var(--black);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.passport-badge.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-emoji {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.badge-emoji.locked { filter: grayscale(1); opacity: 0.4; }

/* Badge image styles */
.badge-card-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.6rem;
  border-radius: 8px;
}

.badge-card-img.locked {
  filter: grayscale(1);
  opacity: 0.25;
}

.badge-card-placeholder {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
}

.badge-card-placeholder.locked {
  background: #f0f0f0;
  color: #ccc;
}

.badge-title {
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  color: var(--black);
}

.badge-desc {
  font-size: 0.72rem;
  color: var(--gray-4);
  line-height: 1.4;
}

.badge-earned-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--black);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
}

.passport-empty {
  font-size: 0.875rem;
  color: var(--gray-4);
  padding: 2rem 0;
}

/* ── Content Blocks (public renderer) ───────────────────── */

.content-block-heading {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  color: var(--black);
}

.content-block-heading:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.content-block-subheading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--black);
}

.content-block-paragraph {
  color: var(--gray-2);
  line-height: 1.85;
  margin-bottom: 1rem;
  font-size: 0.975rem;
}

.content-block-figure {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
}

.content-block-figure img {
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.content-block-figure figcaption {
  font-size: 0.8rem;
  color: var(--gray-4);
  text-align: center;
  padding: 0.5rem 0 0;
  font-style: italic;
}

.content-block-quote {
  border-left: 3px solid var(--black);
  padding: 1rem 1.25rem;
  background: var(--gray-10);
  border-radius: 0 10px 10px 0;
  margin: 1.5rem 0;
  font-style: italic;
}

.content-block-quote p {
  color: var(--gray-2);
  line-height: 1.7;
  margin: 0 0 0.4rem;
}

.content-block-quote cite {
  font-size: 0.8rem;
  color: var(--gray-4);
  font-style: normal;
}

.content-block-infobox {
  background: var(--gray-9);
  border: 1px solid var(--gray-8);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.infobox-icon {
  font-size: 1.2rem;
  margin-right: 6px;
}

.infobox-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.4rem;
}

.content-block-infobox p {
  font-size: 0.875rem;
  color: var(--gray-3);
  line-height: 1.6;
  margin: 0;
}

.content-block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.content-block-gallery figure {
  border-radius: 10px;
  overflow: hidden;
}

.content-block-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.content-block-gallery figcaption {
  font-size: 0.72rem;
  color: var(--gray-4);
  padding: 4px 2px;
  text-align: center;
}

/* ── Admin Block Editor ──────────────────────────────────── */

.block-editor {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.block-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f9f9f9;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.block-editor-toolbar select {
  font-size: 0.82rem;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  background: white;
}

.block-list {
  min-height: 60px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-item {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.block-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #e5e5e5;
  user-select: none;
}

.block-item-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
  flex: 1;
}

.block-item-actions { display: flex; gap: 4px; }

.block-item-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.15s;
}

.block-item-btn:hover { background: #e0e0e0; }
.block-item-btn.danger:hover { background: #ffe0e0; color: #c00; }

.block-item-body { padding: 10px; }

.block-field {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 7px 10px;
  resize: vertical;
  margin-bottom: 6px;
  background: #fafafa;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.block-field:focus {
  outline: none;
  border-color: #000;
  background: white;
}

.block-field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.block-field-row .block-field { margin-bottom: 0; flex: 1; }

.block-gallery-images { display: flex; flex-direction: column; gap: 6px; }

.block-gallery-item {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.block-gallery-item .block-field { flex: 1; margin-bottom: 0; }

/* ── Route / Badge Admin Cards ───────────────────────────── */

.route-city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.route-city-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 3px 10px;
  background: #f0f0f0;
  border-radius: 20px;
  border: 1px solid #ddd;
}

.route-city-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0 2px;
}

.badge-emoji-preview {
  font-size: 2rem;
  margin: 0.5rem 0;
}

/* Badge image preview in admin form */
.badge-image-preview {
  margin-top: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-image-preview img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 6px;
}

.badge-image-placeholder {
  margin-top: 10px;
  border: 1.5px dashed #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: #bbb;
  font-size: 0.78rem;
}

/* Toast image */
.badge-toast-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}
