/* Documents, photos and the fullscreen photo viewer — shared by the dagplanner
   (type 'c') and the chunk planner (types 'b' and 'd').

   These rules used to live in day-planner.css. They are page-agnostic (the
   panels render inside an activity card, whatever that card looks like), so
   both planners load this file instead of one copying the other. The --dp-*
   variables are declared on .dp-page, hence the fallbacks: outside the
   dagplanner the literal value applies. */

.text-muted-sm {
  color: var(--dp-muted, #64748b);
  font-size: 0.85rem;
  padding: 0.4rem 0;
  margin: 0;
}

.attach-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.attach-empty {
  text-align: center;
  color: var(--dp-muted, #64748b);
  font-size: 0.9rem;
  padding: 1.5rem 0.5rem;
}

.attach-empty p { margin: 0; }

/* ── Documents ─────────────────────────────── */
.dp-docs-list {
  border-top: 1px dashed var(--dp-border, #e2e8f0);
  margin-top: 0.6rem;
  padding-top: 0.45rem;
}
.dp-doc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 3px 0;
  font-size: 0.87rem;
}
.dp-doc-link {
  color: var(--dp-primary, #43b0b3);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}
.dp-doc-link:hover { text-decoration: underline; }
.dp-doc-size {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-left: auto;
  white-space: nowrap;
}
.dp-upload-btn {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 4px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--dp-muted, #64748b);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.dp-upload-btn:hover {
  border-color: var(--dp-primary, #43b0b3);
  color: var(--dp-primary, #43b0b3);
}

/* Photo panel on a card: the same dashed separator as the documents list. */
.dp-photos-section {
  border-top: 1px dashed var(--dp-border, #e2e8f0);
  margin-top: 0.6rem;
  padding-top: 0.45rem;
}

/* ── Routes (GPX) ──────────────────────────── */
.dp-route-panel {
  border-top: 1px dashed var(--dp-border, #e2e8f0);
  margin-top: 0.6rem;
  padding-top: 0.55rem;
}

/* Text label, not a bare glyph — the row's other icon-free buttons already
   set that convention (project rule: no icon-glyph-only controls). */
.dp-route-delete-btn {
  font-size: 0.78rem;
  white-space: nowrap;
}

.dp-route-name {
  font-size: 0.87rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

/* Inline literal (a menu name, a file name) inside an instruction. */
.dp-code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 4px;
  padding: 0 4px;
}

/* ── Photos (grid + thumbnails) ─────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.photo-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-thumb-wrap { position: relative; }

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--dp-radius-sm, 6px);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s;
  width: 100%;
  display: block;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: dp-skeleton 1.4s infinite;
}
.photo-thumb:hover { transform: scale(1.04); }

@keyframes dp-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.photo-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo-thumb-wrap:hover .photo-thumb-delete { opacity: 1; }

.photo-thumb-caption {
  display: block;
  font-size: 0.72rem;
  color: var(--dp-muted, #64748b);
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Fullscreen viewer ─────────────────────── */
.photo-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}
.photo-viewer.open { display: flex; }
.photo-viewer img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 6px;
}
.photo-viewer-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
.photo-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  width: 48px;
  height: 64px;
  border-radius: 8px;
  cursor: pointer;
}
.photo-viewer-nav:hover { background: rgba(255, 255, 255, 0.25); }
.photo-viewer-prev { left: 1rem; }
.photo-viewer-next { right: 1rem; }
.photo-viewer-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}
