/* =========================================================
   BibleHike Journal Features: Badges, Expedition Card & Trail Log
   ========================================================= */

/* Dark modal theme for Journal & dialogs */
#modal {
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;
  width: min(580px, calc(100vw - 24px)) !important;
  max-width: 580px !important;
  max-height: 86dvh !important;
  border: 1px solid rgba(220, 196, 149, 0.45) !important;
  border-radius: 24px !important;
  background: radial-gradient(ellipse at top, #1a3127 0%, #0d1a1e 85%) !important;
  color: #fff6e4 !important;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.85), 0 0 30px rgba(220, 196, 149, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  padding: 26px 20px 30px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1000 !important;
}
#modal::backdrop {
  background: rgba(3, 11, 18, 0.82) !important;
  backdrop-filter: blur(8px) !important;
}
#modal .close-modal {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(220, 196, 149, 0.35);
  color: #f7e6c4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
#modal .close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #f8c976;
  transform: scale(1.08);
}

/* Journal Header Overview */
.journal-header {
  text-align: center;
  margin-bottom: 6px;
}
.journal-header .dialog-icon {
  font-size: 32px;
  color: #f8b56d;
  margin-bottom: 2px;
}
.journal-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif !important;
  font-size: clamp(26px, 4vw, 34px) !important;
  font-weight: 800 !important;
  color: #fff6e4 !important;
  margin: 0 0 4px !important;
  line-height: 1.1 !important;
}
.journal-header p {
  font-size: 12px !important;
  color: #eeddbb !important;
  margin: 0 !important;
  opacity: 0.85;
}

/* Journal Tabs */
.journal-tabs {
  display: flex !important;
  gap: 6px !important;
  margin: 16px 0 20px !important;
  padding: 5px !important;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(220, 196, 149, 0.25) !important;
  border-radius: 30px !important;
}
.journal-tab-btn {
  flex: 1 !important;
  padding: 8px 10px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 20px !important;
  color: #cad5cc !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  text-align: center !important;
}
.journal-tab-btn.active {
  background: #e3c589 !important;
  color: #17251f !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}
.journal-tab-btn:hover:not(.active) {
  color: #fff6e4 !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Section styling (Explicit toggle) */
.journal-section {
  display: none !important;
}
.journal-section.active {
  display: block !important;
  animation: journal-fade 0.3s ease;
}
@keyframes journal-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Stat Grid */
.journal-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.journal-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(220, 196, 149, 0.2);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}
.journal-stat-box strong {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #ffe6a6;
  line-height: 1.1;
}
.journal-stat-box span {
  font-size: 9px;
  color: #cad5cc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  display: block;
}

/* =========================================================
   FEATURE 3: UNIFIED DAILY EXPEDITION SHARE CARD
   ========================================================= */
.expedition-card-preview {
  background: linear-gradient(145deg, rgba(23, 44, 34, 0.95), rgba(11, 23, 26, 0.98));
  border: 2px solid rgba(220, 196, 149, 0.4);
  border-radius: 18px;
  padding: 20px;
  margin: 12px 0 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.expedition-card-preview::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(220, 196, 149, 0.25);
  border-radius: 14px;
  pointer-events: none;
}
.card-stamp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(220, 196, 149, 0.2);
  padding-bottom: 10px;
}
.card-stamp .stamp-title {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f8b56d;
  font-weight: 700;
}
.card-stamp .stamp-score {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff6e4;
  background: rgba(220, 196, 149, 0.18);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(220, 196, 149, 0.3);
}
.card-trail-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.card-trail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.28);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.card-trail-row .row-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #fff6e4;
}
.card-trail-row .row-score {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}
.row-score.done {
  color: #9bd3a4;
}
.row-score.pending {
  color: #aebbab;
  opacity: 0.65;
}
.card-quote {
  font-size: 12px;
  font-style: italic;
  color: #eeddbb;
  text-align: center;
  margin: 12px 0 0;
  line-height: 1.45;
  opacity: 0.88;
}
.share-action-group {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.share-action-group .primary {
  flex: 1;
  padding: 12px 20px !important;
  font-size: 13.5px !important;
  border-radius: 25px !important;
  font-weight: 700 !important;
}
.share-action-group .secondary-share {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(220, 196, 149, 0.35);
  border-radius: 25px;
  color: #fff6e4;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.share-action-group .secondary-share:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #f8b56d;
}

/* =========================================================
   FEATURE 1: NATIONAL PARK EMBROIDERED TRAIL BADGES
   ========================================================= */
.badge-tracker-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(220, 196, 149, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #cad5cc;
}
.badge-tracker-summary strong {
  color: #ffe6a6;
  font-size: 14px;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.trail-badge-card {
  position: relative;
  background: linear-gradient(145deg, rgba(20, 36, 28, 0.9), rgba(12, 22, 25, 0.95));
  border: 1.5px solid rgba(220, 196, 149, 0.25);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}
.trail-badge-card.unlocked {
  border-color: rgba(238, 199, 114, 0.7);
  background: linear-gradient(145deg, rgba(29, 56, 42, 0.95), rgba(16, 32, 34, 0.98));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 16px rgba(220, 196, 149, 0.15);
}
.trail-badge-card.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
}
.badge-patch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: none;
  background: rgba(0, 0, 0, 0.4);
  border: 2px dashed rgba(220, 196, 149, 0.4);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.trail-badge-card.unlocked .badge-patch {
  background: radial-gradient(circle, #f8b56d 0%, #a26526 100%);
  border: 2px solid #fff2cb;
  box-shadow: 0 0 12px rgba(248, 181, 109, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}
.badge-info {
  flex: 1;
  min-width: 0;
}
.badge-tag {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f8b56d;
  font-weight: 700;
  display: block;
}
.badge-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff6e4;
  line-height: 1.2;
  margin: 2px 0 2px;
}
.badge-desc {
  font-size: 9.5px;
  color: #cad5cc;
  line-height: 1.35;
  margin: 0;
}
.badge-status-stamp {
  font-size: 8.5px;
  font-weight: 700;
  margin-top: 4px;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
}
.trail-badge-card.unlocked .badge-status-stamp {
  background: rgba(155, 211, 164, 0.2);
  color: #9bd3a4;
  border: 1px solid rgba(155, 211, 164, 0.4);
}
.trail-badge-card.locked .badge-status-stamp {
  background: rgba(255, 255, 255, 0.08);
  color: #cad5cc;
}

/* =========================================================
   FEATURE 4: "TRAIL LOG" COMMUNITY STATS & BASECAMP BAR
   ========================================================= */
.trail-log-card {
  background: rgba(10, 24, 28, 0.7);
  border: 1px solid rgba(220, 196, 149, 0.25);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}
.trail-log-card h4 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  color: #ffe6a6;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.community-metric {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(220, 196, 149, 0.15);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.community-metric strong {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  color: #f8b56d;
}
.community-metric span {
  font-size: 8.5px;
  color: #cad5cc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  display: block;
}
.ranger-field-note {
  background: rgba(248, 181, 109, 0.08);
  border-left: 3px solid #f8b56d;
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 11.5px;
  color: #eeddbb;
  margin-top: 12px;
  line-height: 1.45;
}

/* Home Screen Basecamp Trail Log Banner */
.home-trail-log-banner {
  width: min(1080px, 94vw);
  margin: 0 auto 16px;
  background: rgba(8, 20, 23, 0.85);
  border: 1px solid rgba(220, 196, 149, 0.28);
  border-radius: 16px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  animation: journal-fade 0.6s ease;
  z-index: 10;
  position: relative;
}
.home-trail-log-left {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11.5px;
  color: #cad5cc;
}
.home-trail-log-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-trail-log-item strong {
  color: #ffe6a6;
  font-size: 13px;
}
.home-trail-log-divider {
  width: 1px;
  height: 16px;
  background: rgba(220, 196, 149, 0.2);
}
.home-journal-btn {
  background: rgba(220, 196, 149, 0.16);
  border: 1px solid rgba(220, 196, 149, 0.35);
  border-radius: 20px;
  color: #ffe6a6;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.home-journal-btn:hover {
  background: rgba(220, 196, 149, 0.28);
  border-color: #f8b56d;
  transform: translateY(-2px);
}

/* Mobile Responsiveness for Journal & Badges */
@media (max-width: 730px) {
  #modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 20px 12px 24px !important;
    border-radius: 20px !important;
  }
  .journal-tabs {
    gap: 4px !important;
    margin: 12px 0 16px !important;
    padding: 3px !important;
  }
  .journal-tab-btn {
    font-size: 9.5px !important;
    padding: 6px 4px !important;
  }
  .journal-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .journal-stat-box strong {
    font-size: 18px;
  }
  .badge-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .trail-badge-card {
    padding: 10px;
    gap: 10px;
  }
  .badge-patch {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .badge-title {
    font-size: 12px;
  }
  .badge-desc {
    font-size: 8.5px;
  }
  .community-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .community-metric strong {
    font-size: 15px;
  }
  .community-metric span {
    font-size: 7.5px;
  }
  .home-trail-log-banner {
    width: min(360px, 92vw) !important;
    padding: 8px 12px !important;
    margin: 0 auto 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .home-trail-log-left {
    gap: 10px !important;
    font-size: 9.5px !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .home-trail-log-item strong {
    font-size: 11px !important;
  }
  .home-journal-btn {
    font-size: 9px !important;
    padding: 4px 10px !important;
  }
}
