:root {
  --bg: #14161a;
  --panel: #1d2025;
  --border: #2b2f36;
  --text: #e7e9ec;
  --muted: #9aa1ac;
  --accent: #5b9dff;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar .who { color: var(--muted); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }

h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.muted { color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.gallery-grid, .thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.gallery-card, .thumb-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  color: var(--text);
  transition: transform .1s ease, border-color .1s ease;
}
.gallery-card:hover, .thumb-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}
.gallery-card .thumb, .thumb-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #0d0f12;
}
.gallery-card .label, .thumb-card .label {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

form.stacked label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
form.stacked input[type=text], form.stacked input[type=password], form.stacked input[type=date], form.stacked select {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  background: #0d0f12;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
button, .btn {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 16px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #0d0f12;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
button.danger, .btn.danger { background: var(--danger); }
button.secondary, .btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }

.error { background: #3a1e22; border: 1px solid var(--danger); color: #ffb3b3; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.success { background: #1e3a26; border: 1px solid #4caf7d; color: #b6f0cd; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

.checklist { columns: 2; }
.checklist label { display: block; margin-bottom: 6px; font-weight: normal; color: var(--text); }

.photo-view { display: flex; gap: 24px; flex-wrap: wrap; }
.photo-view .image-pane { flex: 3; min-width: 280px; text-align: center; }
.photo-view .image-pane img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.photo-view .exif-pane { flex: 1; min-width: 240px; }
.photo-view .exif-pane table td:first-child { color: var(--muted); width: 45%; }

/* Prev/next arrows: flush against the viewport edges, vertically
   centered, so they stay in exactly the same spot no matter how tall or
   wide each photo is - lets you click through a gallery quickly without
   re-aiming. Made large and edge-anchored for fast, easy clicking. */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 160px;
  background: rgba(29, 32, 37, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 40px;
  line-height: 1;
  text-decoration: none;
  backdrop-filter: blur(2px);
}
.nav-arrow:hover { background: rgba(91, 157, 255, 0.25); border-color: var(--accent); color: var(--text); text-decoration: none; }
.nav-arrow-prev { left: 0; border-radius: 0 12px 12px 0; }
.nav-arrow-next { right: 0; border-radius: 12px 0 0 12px; }
@media (max-width: 700px) {
  .nav-arrow { width: 56px; height: 120px; font-size: 30px; }
}

/* Full-screen toggle button: fixed so it stays put (and stays visible)
   whether or not full-bleed mode is active. Sits below the topbar
   normally so it doesn't collide with the Admin/Log out links; once
   full-screen mode hides the topbar, it moves flush to the corner. */
.fullscreen-toggle {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 50;
  margin-top: 0;
}
body.fullscreen-active .fullscreen-toggle {
  top: 16px;
}

/* Full-screen mode: image fills the viewport edge-to-edge, EXIF panel
   and page chrome are hidden, nav arrows stay on top so you can still
   click through photos manually. This CSS-driven "fake fullscreen" is
   the primary mechanism (it works even on browsers, like iOS Safari,
   that don't support the Fullscreen API on non-video elements) - a
   real requestFullscreen() call is also attempted on top of it where
   supported. */
body.fullscreen-active { overflow: hidden; }
body.fullscreen-active .topbar,
body.fullscreen-active .breadcrumb { display: none; }
body.fullscreen-active .wrap { padding: 0; max-width: none; }
body.fullscreen-active .exif-pane { display: none; }
body.fullscreen-active .photo-view { display: block; }
body.fullscreen-active .image-pane {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 30;
}
body.fullscreen-active .image-pane img {
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
}

.breadcrumb { margin-bottom: 16px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0d0f12;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
code.link { display: inline-block; padding: 4px 8px; background: #0d0f12; border-radius: 6px; border: 1px solid var(--border); word-break: break-all; }
