/* DATA-DROP :: 50-photos.css
 * Photo module UI: placement dialog, camera, viewer/gallery, lightbox.
 * Blueprint-dark aesthetic, high-contrast, big touch targets for field use.
 * Everything namespaced .ddph-. Owner: photos agent.
 */

:root {
  --ddph-accent: #ffca3a;   /* photo amber (matches the map pins) */
  --ddph-ink: #0b1220;      /* deep blueprint navy */
  --ddph-panel: #12203a;
  --ddph-panel-2: #0e192c;
  --ddph-line: #24406b;
  --ddph-text: #eaf2ff;
  --ddph-dim: #9db4d8;
  --ddph-danger: #ff5d5d;
}

/* ---- overlay backdrop ---- */
.ddph-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 8, 18, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: ddph-fade 0.12s ease-out;
}
@keyframes ddph-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- modal shell ---- */
.ddph-modal {
  width: min(560px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ddph-panel);
  color: var(--ddph-text);
  border: 1px solid var(--ddph-line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ddph-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ddph-line);
  background: linear-gradient(180deg, rgba(255, 202, 58, 0.08), transparent);
}
.ddph-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex: 1;
}
.ddph-x {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--ddph-line);
  background: var(--ddph-panel-2);
  color: var(--ddph-dim);
  font-size: 18px;
  cursor: pointer;
}
.ddph-x:hover { color: #fff; border-color: var(--ddph-accent); }

.ddph-body {
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ddph-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--ddph-line);
  background: var(--ddph-panel-2);
}

/* ---- attach row + hints ---- */
.ddph-attach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ddph-line);
  border-radius: 12px;
  background: var(--ddph-panel-2);
  font-size: 16px;
  cursor: pointer;
}
.ddph-attach input {
  width: 24px;
  height: 24px;
  accent-color: var(--ddph-accent);
  flex: 0 0 auto;
}
.ddph-hint {
  font-size: 13px;
  color: var(--ddph-dim);
  line-height: 1.4;
}

/* ---- big source buttons ---- */
.ddph-source {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 460px) {
  .ddph-source { grid-template-columns: 1fr; }
}

.ddph-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--ddph-line);
  background: var(--ddph-panel-2);
  color: var(--ddph-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, border-color 0.12s ease, background 0.12s ease;
}
.ddph-btn:hover { border-color: var(--ddph-accent); }
.ddph-btn:active { transform: scale(0.97); }
.ddph-btn-ic { font-size: 30px; line-height: 1; }
.ddph-btn-tx { font-size: 15px; }

.ddph-primary {
  background: var(--ddph-accent);
  color: #201700;
  border-color: var(--ddph-accent);
}
.ddph-primary:hover { background: #ffd45f; }

.ddph-ghost {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--ddph-line);
  background: transparent;
  color: var(--ddph-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.ddph-ghost:hover { border-color: var(--ddph-accent); }

/* ---- camera ---- */
.ddph-camwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ddph-line);
}
.ddph-camwrap video,
.ddph-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ddph-cambar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
}
.ddph-cambar .ddph-btn { min-height: 64px; flex: 1; max-width: 180px; }
.ddph-shoot { border-radius: 999px; }
.ddph-shoot .ddph-btn-ic { font-size: 34px; }

/* ---- viewer gallery ---- */
.ddph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.ddph-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ddph-line);
  background: var(--ddph-panel-2);
}
.ddph-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.ddph-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(11, 18, 32, 0.82);
  color: var(--ddph-danger);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.ddph-del:hover { background: var(--ddph-danger); color: #fff; }
.ddph-empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--ddph-dim);
  border: 1px dashed var(--ddph-line);
  border-radius: 12px;
}

/* ---- lightbox ---- */
.ddph-lightbox {
  width: min(96vw, 1100px);
  max-height: 92vh;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  align-items: center;
  justify-content: center;
}
.ddph-lightbox img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  cursor: zoom-out;
}
.ddph-lightbox-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--ddph-line);
  background: var(--ddph-ink);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* ---- busy spinner ---- */
.ddph-busy { z-index: 4100; }
.ddph-spin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 34px;
  background: var(--ddph-panel);
  border: 1px solid var(--ddph-line);
  border-radius: 14px;
  color: var(--ddph-text);
  font-size: 15px;
}
.ddph-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid var(--ddph-line);
  border-top-color: var(--ddph-accent);
  animation: ddph-spin 0.8s linear infinite;
}
@keyframes ddph-spin { to { transform: rotate(360deg); } }
