/* Hike/walk tracker UI */
.auth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-btn:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); }
.auth-btn .auth-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9AA0B4;
  border: 2px solid var(--indigo-900);
}
.auth-btn.in { color: #FFFFFF; }
.auth-btn.in .auth-dot { background: #4CAF50; }
/* lives inside the page hero, under the title */
.tracker-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}
.fab {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #2E7D32;
  color: #FFFFFF;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.35);
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}
.fab:hover { background: #1B5E20; }
.fab:active { transform: scale(0.94); }
.fab:disabled, .fab.busy { opacity: 0.6; cursor: default; }
.fab.play { font-size: 1.1rem; padding-left: 3px; }
.fab.pause {
  background: #F9A825;
  box-shadow: 0 4px 12px rgba(249, 168, 37, 0.35);
  font-size: 0.9rem;
}
.fab.pause:hover { background: #F57F17; }
.fab.stop {
  background: #C62828;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35);
  font-size: 1rem;
}
.fab.stop:hover { background: #B71C1C; }
.fab.small { width: 34px; height: 34px; }
.fab.small.play { font-size: 0.8rem; padding-left: 2px; }
.fab.small.pause { font-size: 0.7rem; }
.fab.small.stop { font-size: 0.75rem; }

/* controls row inside the active entry card */
.entry-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 0;
}
.entry-controls .started {
  margin-right: auto;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
}
.live-chip.paused { background: #F9A825; color: #4E342E; }
.ghost-btn {
  background: none;
  border: 1px solid #D8DCF0;
  color: var(--indigo-800);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.ghost-btn:hover { background: var(--indigo-50); }
.danger-btn {
  background: none;
  border: none;
  color: #B3261E;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 8px;
  cursor: pointer;
  margin-right: auto;
}
/* tracker pages only: pull entries closer to the hero */
.section { padding-top: 36px; }

.live-chip {
  background: var(--indigo-a200);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 12px;
}
.live-chip.big { font-size: 0.85rem; padding: 8px 16px; text-transform: none; letter-spacing: 0; }
.empty-note { text-align: center; color: var(--text-muted); padding: 32px 0; }
.entry-map { color: var(--indigo-500); text-decoration: none; font-weight: 600; white-space: nowrap; }
.entry-map:hover { text-decoration: underline; }
.muted { color: var(--text-muted); }

/* Entry cards — responsive row of cards */
.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
}
.entries .empty-note { grid-column: 1 / -1; }
.entry-card {
  background: #FFFFFF;
  border: 1px solid #E3E6F5;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(26, 35, 126, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.entry-card:hover { box-shadow: 0 6px 22px rgba(26, 35, 126, 0.1); }
.entry-card .entry-desc { flex: 1; }
.entry-card.active { border-color: var(--indigo-a200); box-shadow: 0 6px 22px rgba(83, 109, 254, 0.18); }
.entry-media {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 14px 20px 0;
  scrollbar-width: thin;
}
.entry-media img,
.entry-media video {
  height: 140px;
  width: auto;
  max-width: 240px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  background: var(--indigo-50);
}
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--indigo-50);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--indigo-900);
}
.entry-actions-inline { display: flex; gap: 6px; }
.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #D8DCF0;
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--indigo-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--bg-light); }
.icon-btn.danger { color: #B3261E; border-color: #EDD5D3; }
.icon-btn.danger:hover { background: #FBEDEC; }
.entry-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  padding: 14px 20px 0;
}
.entry-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.entry-desc { padding: 14px 18px; color: var(--text-dark); font-size: 0.95rem; line-height: 1.55; }
.entry-actions { padding: 0 18px 14px; }
.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--indigo-50);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(26, 31, 54, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(26, 35, 126, 0.35);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
}
.modal-box h3 { margin-bottom: 16px; font-size: 1.2rem; }
.modal-box label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-dark);
  margin-bottom: 14px;
}
.modal-box input, .modal-box textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #D8DCF0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--bg-light);
}
.modal-box input:focus, .modal-box textarea:focus {
  outline: 2px solid var(--indigo-a200);
  border-color: var(--indigo-a200);
}
.modal-error { color: #B3261E; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.photo-upload {
  display: inline-block;
  background: var(--indigo-50);
  color: var(--indigo-800);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}
.photo-upload input { display: none; }
.edit-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.edit-photo { position: relative; }
.edit-photo img,
.edit-photo video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--indigo-50);
}
.edit-photo button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--indigo-900);
  color: #FFFFFF;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== v5: unified Training page ===== */

/* hero start buttons */
.start-chip {
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.start-chip:hover { background: rgba(255, 255, 255, 0.24); }
.start-chip:active { transform: scale(0.96); }
.start-chip:disabled { opacity: 0.55; cursor: default; }

/* compact horizontal cards, single column */
.entries {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 10px;
  max-width: 680px;
}
.entry-card {
  flex-direction: row;
  align-items: stretch;
  border-radius: 14px;
}

/* left media square + carousel */
.entry-side {
  position: relative;
  flex: 0 0 148px;
  width: 148px;
  align-self: stretch;
  background: var(--indigo-50);
}
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  height: 100%;
  min-height: 148px;
}
.carousel::-webkit-scrollbar { display: none; }
.car-item {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.car-item img, .car-item video {
  width: 100%;
  height: 100%;
  min-height: 148px;
  object-fit: cover;
  display: block;
  background: var(--indigo-50);
}
.car-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 148px;
  font-size: 2rem;
  opacity: 0.35;
}
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(26, 31, 54, 0.55);
  color: #FFFFFF;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 2px;
}
.car-arrow.prev { left: 6px; }
.car-arrow.next { right: 6px; }
.car-arrow:hover { background: rgba(26, 31, 54, 0.8); }

/* type medallion overlapping the media square */
.medallion {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--indigo-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(26, 35, 126, 0.25);
  pointer-events: none;
}
.medallion.walk { border-color: #2E7D32; }
.medallion.jog { border-color: #E65100; }

/* right column: compact */
.entry-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.entry-main .entry-head {
  padding: 8px 14px;
  background: none;
  font-size: 0.85rem;
}
.entry-main .entry-controls { padding: 0 14px; }
.entry-note {
  flex: 1;
  padding: 2px 14px 8px;
  color: var(--text-dark);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
}
button.entry-note.empty {
  background: none;
  border: none;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
}
button.entry-note.empty:hover { color: var(--indigo-500); }
.entry-main .entry-foot {
  padding: 7px 14px;
  gap: 8px;
  font-size: 0.78rem;
  justify-content: flex-start;
}
.entry-main .entry-foot span + span { border-left: 1px solid #E3E6F5; padding-left: 8px; }
.entry-main .entry-foot .entry-map { margin-left: auto; }

@media (max-width: 480px) {
  .entry-side { flex-basis: 116px; width: 116px; }
  .carousel, .car-item img, .car-item video, .car-empty { min-height: 116px; }
  .medallion { width: 28px; height: 28px; font-size: 0.85rem; }
}

/* edit modal: type picker + dropzone */
.type-picker { display: flex; gap: 8px; margin-bottom: 14px; }
.type-picker button {
  flex: 1;
  border: 1px solid #D8DCF0;
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--text-dark);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 0;
  cursor: pointer;
}
.type-picker button.on {
  background: var(--indigo-500);
  border-color: var(--indigo-500);
  color: #FFFFFF;
}
.dropzone {
  border: 2px dashed #C4CAE8;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.over { border-color: var(--indigo-a200); background: var(--indigo-50); }
.dropzone-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ===== v6: card = header / body / footer ===== */
.entry-card { flex-direction: column; }

.entry-card > .entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: none;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--indigo-50);
}
.entry-date {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: var(--indigo-900);
}
.medallion-sm {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--indigo-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.medallion-sm.walk { border-color: #2E7D32; }
.medallion-sm.jog { border-color: #E65100; }
/* active entry: the medallion pulses — state is shown, not written */
.entry-card.active .medallion-sm { animation: ozh-pulse 1.6s ease-in-out infinite; }
@keyframes ozh-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(83, 109, 254, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(83, 109, 254, 0); }
}

.entry-body { display: flex; align-items: stretch; }
.entry-body .entry-side { flex: 0 0 132px; width: 132px; }
.entry-body .carousel,
.entry-body .car-item img,
.entry-body .car-item video,
.entry-body .car-empty { min-height: 132px; }
.entry-body .entry-note { flex: 1; min-width: 0; padding: 10px 12px; }

.entry-card > .entry-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  padding: 8px 12px;
  border-top: 1px solid var(--indigo-50);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.entry-card > .entry-foot span + span,
.entry-card > .entry-foot span + a { border-left: 1px solid #E3E6F5; padding-left: 8px; }
.entry-card > .entry-foot .entry-map { margin-left: auto; border-left: none; padding-left: 0; }

@media (max-width: 480px) {
  .entry-body .entry-side { flex-basis: 108px; width: 108px; }
  .entry-body .carousel,
  .entry-body .car-item img,
  .entry-body .car-item video,
  .entry-body .car-empty { min-height: 108px; }
  .entry-card > .entry-foot { font-size: 0.76rem; gap: 7px; }
}
