/* Private Photos: "Darkroom" theme. A private gallery, photos carry the color. */
:root {
  --bg: #0b0d11;
  --bg2: #10131a;
  --panel: #141822;
  --panel2: #181d29;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --muted: #9aa3b5;
  --faint: #5f6879;
  --accent: #e8a33d;
  --accent2: #f2b94b;
  --accent-ink: #1c1305;
  --danger: #e56b6b;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scrollbar-color: #2a3140 var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -120px, rgba(232, 163, 61, 0.07), transparent 70%),
    radial-gradient(700px 500px at 85% 110%, rgba(90, 120, 200, 0.05), transparent 70%);
}

/* ---------- header ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
  background: rgba(11, 13, 17, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 8px rgba(232, 163, 61, 0.35)); }
.brand-text h1 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap;
}
.tagline { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

#mainnav {
  display: flex; gap: 2px; margin-left: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.navbtn {
  border: 0; background: transparent; color: var(--muted);
  font: 600 13px/1 var(--font); padding: 9px 18px; border-radius: 999px; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.navbtn:hover { color: var(--text); }
.navbtn.active { background: rgba(232, 163, 61, 0.16); color: var(--accent2); }

/* ---------- buttons / inputs ---------- */
button { font-family: var(--font); }
.primary {
  border: 0; cursor: pointer; font-weight: 700; font-size: 13.5px;
  color: var(--accent-ink); background: linear-gradient(180deg, var(--accent2), var(--accent));
  padding: 10px 20px; border-radius: 11px;
  box-shadow: 0 2px 14px rgba(232, 163, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  white-space: nowrap;
}
.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(232, 163, 61, 0.36); }
.primary:active { transform: translateY(0); }
.primary:disabled { opacity: 0.55; cursor: default; transform: none; }
.primary.big { font-size: 15px; padding: 14px 30px; border-radius: 13px; }
.ghost {
  border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.03); color: var(--text);
  font-weight: 600; font-size: 13px; padding: 9px 16px; border-radius: 11px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.ghost:hover { background: rgba(255, 255, 255, 0.07); }
.ghost.danger { color: var(--danger); border-color: rgba(229, 107, 107, 0.4); }

input, select {
  font: 500 13.5px var(--font); color: var(--text);
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, button:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.22); outline: none;
}
input[type="date"] { color-scheme: dark; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- notices / toasts ---------- */
.notice {
  margin: 14px auto 0; max-width: 1180px; padding: 12px 18px;
  background: rgba(232, 163, 61, 0.1); border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: var(--radius); display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
#statusbar {
  position: fixed; left: 22px; bottom: 22px; z-index: 80;
  max-width: min(480px, 80vw); padding: 12px 18px; border-radius: 12px;
  background: rgba(20, 24, 34, 0.92); border: 1px solid var(--line2);
  backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
}
#statusbar.ok { border-color: rgba(110, 200, 140, 0.45); }
#statusbar.err { border-color: rgba(229, 107, 107, 0.5); color: #f3b8b8; }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }
.view.hidden, .hidden { display: none !important; }
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}
.meta { color: var(--muted); font-size: 12.5px; }

/* ---------- hero (empty state) ---------- */
.hero { text-align: center; padding: 72px 32px 60px; max-width: 640px; margin: 5vh auto 0; }
.hero-mark { width: 76px; height: 76px; filter: drop-shadow(0 6px 24px rgba(232, 163, 61, 0.4)); }
.hero h2 { font-size: 30px; letter-spacing: -0.025em; margin: 22px 0 10px; font-weight: 750; }
.hero .lede { color: var(--muted); font-size: 15.5px; max-width: 480px; margin: 0 auto 28px; }
.trust { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 30px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px;
  background: rgba(255, 255, 255, 0.025);
}
.chip svg { width: 14px; height: 14px; color: var(--accent2); }
.fineprint { font-size: 12px; color: var(--faint); }

/* ---------- photo grid ---------- */
.gridwrap {
  height: calc(100vh - 170px); min-height: 420px; overflow-y: auto; position: relative;
  border-radius: var(--radius); outline: none;
}
.gridwrap:focus-visible { box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.25); }
.grid-spacer { position: relative; }
.grid-row { position: absolute; left: 0; right: 0; display: flex; gap: 12px; padding: 0 4px; }
.date-header {
  position: absolute; left: 0; right: 0; display: flex; align-items: baseline; gap: 12px;
  padding: 14px 4px 6px;
}
.date-header h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.date-header .count {
  font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px;
}
.photo-cell { width: 180px; cursor: pointer; }
.photo-cell img {
  width: 180px; height: 150px; object-fit: cover; display: block;
  border-radius: 10px; background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.photo-cell:hover img {
  transform: scale(1.035); border-color: rgba(232, 163, 61, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 163, 61, 0.25);
}
.photo-cell .cap {
  font-size: 11.5px; color: var(--faint); margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-cell:hover .cap { color: var(--muted); }
.grid-empty { padding: 60px 20px; text-align: center; color: var(--faint); }

/* ---------- search ---------- */
.searchform { margin-bottom: 20px; }
.srow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.srow .grow { flex: 1; min-width: 200px; }
#searchmeta { margin: 12px 0 0; }
#searchmeta:not(:empty) { margin-top: 14px; }

/* ---------- duplicates ---------- */
.dup-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.dup-intro h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.02em; }
.dup-intro p { margin: 0; color: var(--muted); max-width: 560px; }
#dupmeta { margin: 0 0 6px; }
.dup-group {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 14px 0; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.dup-group h3 { margin: 0 0 4px; font-size: 14.5px; }
.dup-group .meta { margin: 0 0 14px; }
.dup-members { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.dup-members .photo-cell { flex: none; }

/* ---------- progress ---------- */
#progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90; pointer-events: none;
}
#progress::before {
  content: ""; display: block; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transform-origin: left; animation: indet 1.4s ease-in-out infinite;
  opacity: 0.9;
}
@keyframes indet { 0% { transform: scaleX(0.1); } 50% { transform: scaleX(0.6); } 100% { transform: scaleX(0.1); } }
.progress-pill {
  pointer-events: auto; position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: rgba(20, 24, 34, 0.94); border: 1px solid var(--line2); border-radius: 999px;
  padding: 10px 10px 10px 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px); max-width: 92vw;
}
#progresstext { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.progress-pill .bar { width: 130px; height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden; flex: none; }
#progressfill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.2s;
}

/* ---------- lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 5, 8, 0.94); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
#lb-img {
  max-width: 88vw; max-height: 84vh; border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); object-fit: contain;
}
#lb-close {
  position: absolute; top: 20px; right: 22px; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line2); cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 24px; line-height: 1;
  transition: background 0.12s, transform 0.12s;
}
#lb-close:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.06); }
#lb-meta {
  position: absolute; left: 22px; bottom: 22px; max-width: 340px;
  padding: 16px 20px; font-size: 12.5px;
}
#lb-meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; }
#lb-meta dt { color: var(--faint); font-weight: 600; white-space: nowrap; }
#lb-meta dd { margin: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 26px 24px 34px;
  text-align: center; color: var(--faint); font-size: 12.5px;
}
footer p { margin: 0; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  #topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .tagline { display: none; }
  #mainnav { order: 3; margin-left: 0; width: 100%; justify-content: center; }
  .navbtn { flex: 1; padding: 9px 0; }
  main { padding: 18px 14px 60px; }
  .hero { padding: 48px 20px; }
  .hero h2 { font-size: 24px; }
  #lb-meta { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
