/* ============================================================
   Picshelf Admin — custom styles layered on Brailie
   ============================================================ */

/* ---- Colour tokens ----
   One brand blue in four roles: --blue fills (buttons, selection, progress), --blue-ink is
   blue text and icons (lighter on the dark background, for contrast), --focus marks keyboard
   focus, --blue-wash tints hovered or selected surfaces. */
.admin-page,
.admin-login-page {
  --blue: #2f6fd1;
  --blue-down: #255cb3;
  --blue-ink: #8dbcff;
  --blue-ink-hover: #fff;
  --blue-wash: rgba(47, 111, 209, .16);
  --focus: #6ea8ff;
  --focus-ring: 0 0 0 3px rgba(110, 168, 255, .3);
}
body.light-mode.admin-page,
body.light-mode.admin-login-page {
  --blue-ink: #2a63bd;
  --blue-ink-hover: #1d4f9c;
  --blue-wash: rgba(47, 111, 209, .1);
  --focus: #2f6fd1;
  --focus-ring: 0 0 0 3px rgba(47, 111, 209, .25);
}

/* ---- Base ---- */
body.admin-page,
body.admin-login-page {
  background: #1a1a1a;
  color: #e0e0e0;
  font-family: var(--font-text);
  min-height: 100vh;
}

body.light-mode {
  background: #f4f5f7;
  color: #333;
}

/* ---- Navbar ---- */
.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
}

/* the wordmark itself (font, viewfinder corners) comes from .wordmark in type.css */
.admin-navbar .brand-name {
  font-size: 1.25rem;
  color: #fff;
}

/* ---- Upload queue bar (sticky below navbar) ----
   It slides down once from under the navbar: the movement answers the drop and is enough
   to be noticed (it used to blink three times). The selection bar uses the same entrance. */
@keyframes upload-bar-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.upload-queue-bar {
  position: sticky;
  top: 60px;
  z-index: 999;
  background: #1e1e1e;
  border-bottom: 1px solid #333;
  padding: 8px 20px;
  color: #e0e0e0;
  animation: upload-bar-in .3s ease-out both;
}

body.light-mode .upload-queue-bar {
  background: #fff;
  border-bottom-color: #e0e0e0;
  color: #333;
}

.selection-bar {
  border-bottom-color: var(--blue);
  border-bottom-width: 2px;
  animation: upload-bar-in .3s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .upload-queue-bar, .selection-bar { animation: none; }
}

/* ---- Content ---- */
.admin-content {
  padding: 30px 20px;
}

/* ---- Cards ---- */
.admin-card {
  background: #242424;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 0;
}

body.light-mode .admin-card {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ---- Album cards (dashboard) ---- */
.admin-album-card {
  background: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}

/* hover: a quiet outline, no lift (a workspace, the cards don't need to jump) */
.admin-album-card:hover { box-shadow: 0 0 0 1px #5a5a5a; }
body.light-mode .admin-album-card:hover { box-shadow: 0 0 0 1px #b9bec6, 0 1px 4px rgba(0,0,0,.08); }

body.light-mode .admin-album-card {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.btn-delete-album {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(220, 53, 69, .85);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}

.admin-album-card:hover .btn-delete-album { opacity: 1; }

.album-card-thumb {
  height: 140px;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.light-mode .album-card-thumb { background: #f0f0f0; }

.album-card-body { padding: 12px 15px; }

.album-external-link,
.album-stats-link { color: var(--blue-ink); opacity: 0; transition: opacity .15s; }
.admin-album-card:hover .album-external-link,
.admin-album-card:hover .album-stats-link { opacity: 1; }
.album-stats-link:hover, .album-external-link:hover { color: var(--blue-ink-hover); }
.album-card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Navbar alignment ---- */
.admin-navbar .nav-item { display: flex; align-items: center; }
#theme-toggle { opacity: .75; }
#theme-toggle:hover { opacity: 1; }

/* ---- Buttons ----
   Brailie draws every .btn as a tall uppercase Montserrat 700 pill. Here they are
   sentence case and compact, and blue is kept for the one main action of a screen:
     .btn-default         primary, filled blue
     .btn-ghost           secondary, neutral outline
     .btn-danger          confirms a deletion (modals, selection bar)
     .btn-outline-danger  starts a deletion (danger zone)
   Labelled buttons get a 6px radius (one step under the 8px cards); icon-only
   buttons stay round. */
.admin-page,
.admin-login-page {
  --btn-red: #dc3545;
  --btn-red-down: #c82333;
  --btn-line: #4d4d4d;
  --btn-line-hover: #6b6b6b;
  --btn-ink: #e6e6e6;
  --btn-wash: rgba(255, 255, 255, .06);
}
body.light-mode.admin-page,
body.light-mode.admin-login-page {
  --btn-line: #c4c8ce;
  --btn-line-hover: #8f959d;
  --btn-ink: #2b2b2b;
  --btn-wash: rgba(0, 0, 0, .04);
}

.admin-page .btn,
.admin-login-page .btn {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 20px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  vertical-align: middle;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .06s ease;
}
.admin-page .btn-sm { font-size: 13px; line-height: 18px; padding: 6px 12px; }
/* the upload buttons are the main thing in a large drop area: full size */
.admin-page .upload-dropzone .btn-sm { font-size: 14px; line-height: 20px; padding: 9px 16px; white-space: nowrap; }
.admin-page .btn:active { transform: translateY(1px); }
.admin-page .btn:focus, .admin-login-page .btn:focus { outline: none; }
.admin-page .btn:focus-visible,
.admin-login-page .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.admin-page .btn:disabled, .admin-page .btn.disabled,
.admin-login-page .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.admin-page .btn-default,
.admin-login-page .btn-default { background: var(--blue); border-color: var(--blue); color: #fff; }
.admin-page .btn-default:hover, .admin-page .btn-default:active,
.admin-login-page .btn-default:hover, .admin-login-page .btn-default:active { background: var(--blue-down); border-color: var(--blue-down); color: #fff; }
.admin-page .btn-default:disabled:hover { background: var(--blue); border-color: var(--blue); }

.admin-page .btn-ghost,
.admin-login-page .btn-ghost { background: transparent; border-color: var(--btn-line); color: var(--btn-ink); }
.admin-page .btn-ghost:hover, .admin-page .btn-ghost:active,
.admin-login-page .btn-ghost:hover, .admin-login-page .btn-ghost:active { background: var(--btn-wash); border-color: var(--btn-line-hover); color: var(--btn-ink); }

.admin-page .btn-danger { background: var(--btn-red); border-color: var(--btn-red); color: #fff; }
.admin-page .btn-danger:hover, .admin-page .btn-danger:active { background: var(--btn-red-down); border-color: var(--btn-red-down); color: #fff; }

.admin-page .btn-outline-danger { background: transparent; border-color: var(--btn-red); color: #ff7b88; }
.admin-page .btn-outline-danger:hover, .admin-page .btn-outline-danger:active { background: var(--btn-red); border-color: var(--btn-red); color: #fff; }
body.light-mode.admin-page .btn-outline-danger:not(:hover):not(:active) { color: var(--btn-red-down); }

@media (prefers-reduced-motion: reduce) {
  .admin-page .btn, .admin-login-page .btn { transition: none; }
  .admin-page .btn:active { transform: none; }
}

/* ---- Upload dropzone ---- */
.upload-dropzone {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  transition: border-color .2s, background .2s;
}

.upload-dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-wash);
}

body.light-mode .upload-dropzone { border-color: #ccc; }

/* ---- Progress bars ---- */
.admin-progress-global {
  width: 150px;
  height: 6px;
  background: #444;
  border-radius: 3px;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 8px;
  overflow: hidden;
}

.admin-progress-file {
  height: 4px;
  background: #333;
  border-radius: 2px;
}

.progress-bar-default { background-color: var(--blue); }

/* ---- Photos grid ---- */
.admin-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.photo-thumb-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #1e1e1e;
}
.photo-thumb-item { cursor: pointer; user-select: none; -webkit-user-select: none; }

/* Drag & drop states (SortableJS, fallback mode) */
.photo-thumb-ghost {                     /* the slot left behind in the grid */
  opacity: .35;
  outline: 2px dashed var(--blue);
  outline-offset: -2px;
}
.photo-thumb-ghost img,
.photo-thumb-ghost .photo-thumb-overlay,
.photo-thumb-ghost .photo-thumb-drag { visibility: hidden; }
.photo-thumb-chosen { cursor: grabbing; }
.photo-thumb-dragging {                  /* the clone following the pointer */
  opacity: 1 !important;
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  cursor: grabbing;
}
.photo-thumb-dragging .photo-thumb-overlay,
.photo-thumb-dragging .photo-thumb-drag { opacity: 0; }

.photo-thumb-item.selected {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.photo-thumb-item.selected::after {
  content: '\2713';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  font-size: .8rem;
  font-weight: 700;
  z-index: 3;
}

#photos-grid .photo-thumb-item { transition: opacity .15s; }
#photos-grid.has-selection .photo-thumb-item:not(.selected) { opacity: 0.4; }

.photo-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;      /* the tile is the drag surface, never the image itself */
  -webkit-user-drag: none;
}

.photo-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px;
  opacity: 0;
  transition: opacity .15s;
}

.photo-thumb-item:hover .photo-thumb-overlay { opacity: 1; }

.btn-delete-photo {
  background: rgba(220, 53, 69, .85);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 28px; height: 28px;
  font-size: .75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Visual hint only — the whole tile drags */
.photo-thumb-drag {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  pointer-events: none;
  z-index: 2;
}

/* ---- Upload progress inside thumb ---- */
.photo-thumb-uploading .photo-thumb-upload-overlay {
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 8px;
  pointer-events: none;
}

.photo-thumb-upload-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
  font-size: 1.4rem;
  color: rgba(255, 255, 255, .2);
}

.photo-thumb-upload-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, .2);
  border-radius: 2px;
  overflow: hidden;
}

.photo-thumb-upload-bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 2px;
  transition: width .3s ease;
}

.photo-thumb-upload-pct {
  font-size: .65rem;
  color: rgba(255, 255, 255, .85);
  margin-bottom: 4px;
}

.photo-thumb-error {
  outline: 2px solid #dc3545;
}

/* ---- Modals ---- */
.admin-modal {
  background: #2a2a2a;
  color: #e0e0e0;
  border: none;
}

.admin-modal .modal-header { border-color: #444; }
.admin-modal .modal-footer { border-color: #444; }
.admin-modal .form-control {
  background: #1e1e1e;
  border-color: #444;
  color: #e0e0e0;
}
.admin-modal .form-control:focus {
  background: #1e1e1e;
  border-color: var(--focus);
  color: #e0e0e0;
  box-shadow: none;
}

body.light-mode .admin-modal { background: #fff; color: #333; }
body.light-mode .admin-modal .modal-header,
body.light-mode .admin-modal .modal-footer { border-color: #e0e0e0; }
body.light-mode .admin-modal .form-control { background: #fff; border-color: #ccc; color: #333; }

/* ---- Template selector ---- */
.template-category {
  color: #888;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: .9rem;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

body.light-mode .template-category { border-color: #e0e0e0; }

.template-card {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.template-card:hover { border-color: var(--blue); }
.template-card.active { border-color: var(--blue); background: var(--blue-wash); }

.template-preview {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.template-name {
  font-size: .75rem;
  font-weight: 600;
}

body.light-mode .template-card { border-color: #ddd; }

/* ---- Login page ---- */
.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-box {
  background: #242424;
  border-radius: 10px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

body.light-mode .login-box { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.1); }

.login-logo h2 { font-size: 2rem; }

/* ---- Info box (DNS) ---- */
.admin-info-box {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 20px;
  border-left: 3px solid var(--blue);
}

body.light-mode .admin-info-box { background: #f0f5ff; }

/* ---- Badge (photo count next to the album title): Brailie sets it in 11px bold capitals ---- */
.admin-page .badge { font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 4px 8px; border-radius: 4px; }

/* ---- Breadcrumb ---- */
.admin-breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 6px;
  font-size: .85rem;
}

.admin-breadcrumb a { color: var(--blue-ink); }

/* ---- Icon-only buttons (album header) ---- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--blue-ink);
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--blue-wash); color: var(--blue-ink-hover); text-decoration: none; outline: none; }
.icon-btn-lg { width: 40px; height: 40px; font-size: 1.1rem; background: var(--blue-wash); }
.icon-btn-lg:hover, .icon-btn-lg:focus-visible { background: rgba(47, 111, 209, .3); }

/* ---- Misc ---- */
.ml-5  { margin-left: 5px; }
.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.mr-3  { margin-right: 3px; }
.mr-5  { margin-right: 5px; }
.mb-5  { margin-bottom: 5px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.mb-30 { margin-bottom: 30px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.py-30 { padding-top: 30px; padding-bottom: 30px; }
.py-40 { padding-top: 40px; padding-bottom: 40px; }
.py-50 { padding-top: 50px; padding-bottom: 50px; }
.py-60 { padding-top: 60px; padding-bottom: 60px; }
.gap-10 { gap: 10px; }
.file-row-name { max-width: 220px; }

/* ---- Login / register: floating theme toggle ---- */
.login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #b8b8b8;
  font-size: 1rem;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.login-theme-toggle:hover, .login-theme-toggle:focus { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
body.light-mode .login-theme-toggle { color: #595959; }
body.light-mode .login-theme-toggle:hover, body.light-mode .login-theme-toggle:focus { color: #222; background: rgba(0,0,0,.06); }

/* ---- Login page readability (WCAG AA: text >= 4.5:1) ---- */
.admin-login-page .login-box { padding: 44px 40px 36px; }
.admin-login-page .login-logo { margin-bottom: 28px; }
.admin-login-page .login-logo h2 { color: #fff; margin-bottom: 10px; }
.admin-login-page .login-logo p  { color: #b8b8b8 !important; font-size: 1rem; margin: 0; }

.admin-login-page label {
  color: #dcdcdc;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: .2px;
}

.admin-login-page .login-box .form-control {
  background: #1a1a1a;
  border: 1px solid #4d4d4d;
  border-radius: 8px;
  color: #f2f2f2;
  font-size: 1.05rem;
  height: 50px;
  padding: 0 16px;
  transition: border-color .15s, box-shadow .15s;
}
.admin-login-page .login-box .form-control::placeholder { color: #8f8f8f; opacity: 1; }
.admin-login-page .login-box .form-control:focus {
  background: #1a1a1a;
  border-color: var(--focus);
  color: #f2f2f2;
  box-shadow: var(--focus-ring);
  outline: none;
}

/* matches the 50px fields above it */
.admin-login-page .login-box button[type="submit"] { font-size: 15px; padding: 14px 16px; margin-top: 28px; }

.admin-login-page .login-box p.small { font-size: .95rem; color: #c4c4c4 !important; margin-top: 24px; }
.admin-login-page .login-box p.small a {
  color: var(--blue-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.admin-login-page .login-box p.small a:hover { color: #fff; }
.admin-login-page .alert { font-size: .95rem; }
.admin-login-page .login-box .form-text { color: #b0b0b0 !important; font-size: .85rem; margin-top: 6px; }
body.light-mode.admin-login-page .login-box .form-text { color: #5e5e5e !important; }

/* light mode */
body.light-mode.admin-login-page .login-logo h2 { color: #15171c; }
body.light-mode.admin-login-page .login-logo p  { color: #595959 !important; }
body.light-mode.admin-login-page label { color: #333; }
body.light-mode.admin-login-page .login-box .form-control { background: #fff; border-color: #b9b9b9; color: #222; }
body.light-mode.admin-login-page .login-box .form-control::placeholder { color: #747474; }
body.light-mode.admin-login-page .login-box .form-control:focus { background: #fff; }
body.light-mode.admin-login-page .login-box p.small { color: #555 !important; }

/* ---- Logged-in pages readability (WCAG AA: text >= 4.5:1) ----
   The Brailie theme sets h1-h6/label to #404040 and Bootstrap's .text-muted
   is #6c757d !important: both are unreadable on the dark admin background. */
.admin-page h1, .admin-page h2, .admin-page h3,
.admin-page h4, .admin-page h5, .admin-page h6,
.admin-page label:not(.btn) { color: #f0f0f0; }
.admin-page .text-muted { color: #a8a8a8 !important; }
.admin-page .form-text { font-size: .85rem; }
.admin-page .template-category { color: #c8c8c8; }

.admin-navbar .text-danger { color: #ff7b88 !important; }
.admin-navbar .text-danger:hover { color: #ffb3bb !important; }

.admin-page .admin-card .form-control {
  background: #1a1a1a;
  border: 1px solid #4d4d4d;
  border-radius: 8px;
  color: #f2f2f2;
  font-size: 1rem;
  height: 46px;
  padding: 0 14px;
}
.admin-page .admin-card .form-control::placeholder { color: #8f8f8f; opacity: 1; }
.admin-page .admin-card .form-control:focus {
  background: #1a1a1a;
  border-color: var(--focus);
  color: #f2f2f2;
  box-shadow: var(--focus-ring);
  outline: none;
}

/* light mode */
body.light-mode.admin-page h1, body.light-mode.admin-page h2, body.light-mode.admin-page h3,
body.light-mode.admin-page h4, body.light-mode.admin-page h5, body.light-mode.admin-page h6,
body.light-mode.admin-page label:not(.btn) { color: #222; }
body.light-mode.admin-page .text-muted { color: #5f6368 !important; }
body.light-mode.admin-page .template-category { color: #444; }
body.light-mode.admin-page .admin-card .form-control { background: #fff; border-color: #b9b9b9; color: #222; }
body.light-mode.admin-page .admin-card .form-control::placeholder { color: #747474; }
body.light-mode.admin-page .admin-card .form-control:focus { background: #fff; }

/* album-edit: breadcrumb, light-mode links */
.admin-page .breadcrumb-item.active { color: #a8a8a8; }
body.light-mode.admin-page .breadcrumb-item.active { color: #5f6368; }
body.light-mode.admin-page a:not(.btn):not(.nav-link):not(.brand-name),
body.light-mode.admin-page .admin-breadcrumb a { color: var(--blue-ink); }

/* ---- Album banner (hero) editor ---- */
.admin-modal-divider { border-color: #444; margin: 20px 0 15px; }
body.light-mode .admin-modal-divider { border-color: #e0e0e0; }
.hero-preview {
  height: 110px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #1e1e1e;
  background-size: cover;
  background-position: center;
}
body.light-mode .hero-preview { border-color: #ccc; background-color: #f5f5f5; }
.btn-remove-hero {
  background: #dc3545;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  font-size: .8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-remove-hero:hover { background: #c82333; }
.btn-remove-hero:focus-visible { outline: 2px solid #ff7b88; outline-offset: 2px; }


/* ---- Album stats page ---- */
/* date range: a segmented control. The selected period is a raised neutral segment,
   not blue: nothing on this page is a main action. */
.stats-range {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  border: 1px solid var(--btn-line); border-radius: 8px; background: #1e1e1e;
}
.admin-page .stats-range .btn {
  margin: 0; padding: 5px 12px; border-radius: 5px; white-space: nowrap;
  background: transparent; border-color: transparent; color: #b8b8b8;
}
.admin-page .stats-range .btn:hover { background: var(--btn-wash); color: #fff; }
.admin-page .stats-range .btn.active { background: #3a3a3a; border-color: #4d4d4d; color: #fff; }
.admin-page .stats-range .btn:active { transform: none; }
body.light-mode .stats-range { background: #eceef1; }
body.light-mode.admin-page .stats-range .btn { color: #555; }
body.light-mode.admin-page .stats-range .btn:hover { color: #222; }
body.light-mode.admin-page .stats-range .btn.active { background: #fff; border-color: #c4c8ce; color: #222; }
.stats-actions .btn { margin: 0; }
@media (max-width: 767px) { .stats-actions { margin-top: 12px; } }

.stat-tile { padding: 20px 25px; }
.stat-tile-label { font-size: .9rem; font-weight: 600; color: #a8a8a8; display: flex; align-items: center; gap: 8px; }
.stat-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #4a90d9; }
.stat-tile-value { font-family: var(--font-text); font-size: 2.2rem; font-weight: 700; line-height: 1.2; margin: 6px 0 2px; color: #f0f0f0; font-variant-numeric: tabular-nums; }
.stat-tile-sub { font-size: .85rem; }
body.light-mode .stat-tile-label { color: #5f6368; }
body.light-mode .stat-tile-value { color: #222; }

.stats-chart-wrap { position: relative; height: 320px; }
@media (max-width: 575px) { .stats-chart-wrap { height: 240px; } }

.admin-page .stats-table-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--blue-ink); font-size: .85rem; font-weight: 400; text-transform: none; letter-spacing: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.admin-page .stats-table-toggle:focus { outline: none; }
.admin-page .stats-table-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.admin-page .stats-table-toggle:hover { color: var(--blue-ink-hover); }

.admin-page .stats-table { color: #e0e0e0; margin-bottom: 0; font-variant-numeric: tabular-nums; }
.admin-page .stats-table th { color: #a8a8a8; font-size: .85rem; font-weight: 600; border-top: 0; border-bottom: 1px solid #444; }
.admin-page .stats-table td { border-top: 1px solid #333; vertical-align: middle; white-space: nowrap; }
body.light-mode.admin-page .stats-table { color: #333; }
body.light-mode.admin-page .stats-table th { color: #5f6368; border-bottom-color: #e0e0e0; }
body.light-mode.admin-page .stats-table td { border-top-color: #eee; }

/* sortable column headers (per-photo table): a plain button carrying the th's own look */
.admin-page .stats-sort {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: none;
  color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; line-height: inherit;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.admin-page .stats-sort .fa { width: 8px; opacity: .45; }
.admin-page .stats-sort:focus { outline: none; }
.admin-page .stats-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.admin-page .stats-sort:hover,
.admin-page th[aria-sort="ascending"] .stats-sort,
.admin-page th[aria-sort="descending"] .stats-sort { color: #fff; }
.admin-page th[aria-sort="ascending"] .stats-sort .fa,
.admin-page th[aria-sort="descending"] .stats-sort .fa { opacity: 1; }
body.light-mode.admin-page .stats-sort:hover,
body.light-mode.admin-page th[aria-sort="ascending"] .stats-sort,
body.light-mode.admin-page th[aria-sort="descending"] .stats-sort { color: #222; }
#photo-stats-wrap.is-loading { opacity: .5; transition: opacity .15s; }

.stats-thumb-cell { width: 56px; }
/* max-width: none — the theme's img max-width: 100% let a narrow table squash the cell to 0 */
.stats-thumb { width: 44px; height: 44px; max-width: none; object-fit: cover; border-radius: 4px; display: block; background: #1e1e1e; }
/* enlarged copy of a row thumbnail while it is hovered; size and position set by album-stats.js */
.stats-thumb-preview {
  position: fixed; z-index: 1050; display: none; pointer-events: none; max-width: none;
  border-radius: 6px; border: 1px solid #444; background: #1e1e1e;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
}
.stats-thumb-preview.is-visible { display: block; }
body.light-mode .stats-thumb-preview { border-color: #e0e0e0; background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.stats-filename { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Language switcher (EN / FR / ES): admin navbar + login/register top bar ---- */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; letter-spacing: 1px; }
.lang-switch a { color: rgba(255,255,255,.55); padding: 4px 5px; border-radius: 4px; text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus { color: #fff; text-decoration: none; }
.lang-switch a.active { color: #fff; background: rgba(255,255,255,.14); }
.admin-navbar .lang-switch { margin-left: 6px; }
/* the navbar stays dark in light mode; keep the generic light-mode link colour from applying here */
body.light-mode.admin-page .admin-navbar .lang-switch a { color: rgba(255,255,255,.55); }
body.light-mode.admin-page .admin-navbar .lang-switch a:hover,
body.light-mode.admin-page .admin-navbar .lang-switch a:focus,
body.light-mode.admin-page .admin-navbar .lang-switch a.active { color: #fff; }

.login-topbar { position: fixed; top: 18px; right: 22px; z-index: 10; display: flex; align-items: center; gap: 10px; }
.login-topbar .login-theme-toggle { position: static; }
.login-lang-switch a { color: #b8b8b8; }
.login-lang-switch a:hover, .login-lang-switch a:focus { color: #fff; }
.login-lang-switch a.active { color: #fff; background: rgba(255,255,255,.12); }
body.light-mode .login-lang-switch a { color: #595959; }
body.light-mode .login-lang-switch a:hover, body.light-mode .login-lang-switch a:focus { color: #222; }
body.light-mode .login-lang-switch a.active { color: #222; background: rgba(0,0,0,.08); }


/* ============================================================
   UI pass (oct. 2026): mobile menu, visible actions, pickers,
   style thumbnails, copy link, login extras, danger zone
   ============================================================ */

/* ---- Admin navbar on small screens: the theme styles neither .navbar-toggler nor
   .navbar-toggler-icon (no .navbar-dark), so the menu button was invisible. ---- */
.admin-navbar .navbar-header { display: flex; align-items: center; justify-content: space-between; }
.admin-navbar .navbar-toggler {
  display: none;
  width: 40px; height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.admin-navbar .navbar-toggler:focus { outline: none; box-shadow: 0 0 0 3px rgba(110,168,255,.35); }
.admin-navbar .navbar-toggler-icon {
  display: inline-block; width: 22px; height: 22px; vertical-align: middle;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 991.98px) {
  .admin-navbar { height: auto; min-height: 60px; flex-wrap: wrap; padding: 12px 20px; }
  .admin-navbar .container-fluid { display: flex; flex-wrap: wrap; padding: 0; }
  .admin-navbar .navbar-header { width: 100%; }
  .admin-navbar .navbar-toggler { display: inline-flex; align-items: center; justify-content: center; }
  .admin-navbar .navbar-collapse { width: 100%; flex-basis: 100%; }
  .admin-navbar .navbar-nav { flex-direction: column; align-items: stretch !important; padding: 14px 0 4px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 12px; }
  .admin-navbar .nav-item { padding: 6px 0; }
  .admin-navbar .nav-item.ml-10 { margin-left: 0; }
  .admin-navbar .nav-link { padding: 4px 0; }
  .admin-navbar .lang-switch { margin-left: 0; }
}

/* ---- Dashboard cards: the actions used to appear on hover only (so never on touch). ---- */
.album-external-link, .album-stats-link { opacity: .75; }
.btn-delete-album { opacity: .85; }
.admin-album-card:hover .btn-delete-album { opacity: 1; }
.album-card-slug span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- Album page header: visible edit + copy-link actions ---- */
.album-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.public-url-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.public-url-row a#public-url { word-break: break-all; }
.btn-copy-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 6px;
  border: 1px solid var(--btn-line); background: transparent; color: var(--btn-ink);
  font-family: var(--font-text); font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.6;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-copy-link:hover { border-color: var(--btn-line-hover); background: var(--btn-wash); color: var(--btn-ink); }
.btn-copy-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-copy-link.copied { border-color: #2fa36b; color: #7fdba8; }
body.light-mode .btn-copy-link.copied { border-color: #2fa36b; color: #1f7a4c; }

/* ---- Embed modal (album page) ---- */
.embed-intro { font-size: .9rem; opacity: .85; }
.embed-option { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; font-size: .9rem; }
.embed-option input { margin: 0; }
.admin-modal .embed-code {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .78rem; line-height: 1.5; height: auto; min-height: 7rem; padding: 10px 12px;
  resize: vertical; word-break: break-all;
}

/* ---- File picker (replaces the native "Choose File / No file chosen") ---- */
.file-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.file-picker .file-picker-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-picker .file-picker-name { font-size: .9rem; color: #a8a8a8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker .file-picker-name.has-file { color: #f0f0f0; }
body.light-mode .file-picker .file-picker-name { color: #5f6368; }
body.light-mode .file-picker .file-picker-name.has-file { color: #222; }
.file-picker .file-picker-input:focus-visible + .file-picker-name,
.file-picker:focus-within label { box-shadow: var(--focus-ring); }

/* ---- Modals: the theme's input[type=text] rule won over .admin-modal .form-control ---- */
.admin-page .admin-modal input.form-control,
.admin-page .admin-modal textarea.form-control {
  background: #1a1a1a;
  border: 1px solid #4d4d4d;
  border-radius: 8px;
  color: #f2f2f2;
  font-size: 1rem;
  height: 46px;
  padding: 0 14px;
}
.admin-page .admin-modal input.form-control::placeholder { color: #8f8f8f; opacity: 1; }
.admin-page .admin-modal input.form-control:focus,
.admin-page .admin-modal textarea.form-control:focus {
  background: #1a1a1a; border-color: var(--focus); color: #f2f2f2;
  box-shadow: var(--focus-ring); outline: none;
}
body.light-mode.admin-page .admin-modal input.form-control,
body.light-mode.admin-page .admin-modal textarea.form-control { background: #fff; border-color: #b9b9b9; color: #222; }
/* the theme gives <hr> 70px of padding + margin */
.admin-modal .admin-modal-divider { padding: 0; margin: 8px 0 16px; border-bottom-color: #444; }
body.light-mode .admin-modal .admin-modal-divider { border-bottom-color: #e0e0e0; }

/* ---- Danger zone (album page) ---- */
.danger-zone {
  margin-top: 30px;
  padding: 18px 25px;
  border: 1px solid rgba(220,53,69,.35);
  border-radius: 8px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
}
.danger-zone p { margin: 0; color: #a8a8a8; font-size: .9rem; }

/* ---- Style picker: schematic thumbnails + preview link ---- */
.template-card { position: relative; padding: 10px 8px 34px; }
.template-preview { height: 72px; margin-bottom: 8px; color: var(--blue-ink); }
.template-preview svg { width: 100%; height: 100%; max-width: 120px; }
.template-card:focus-visible { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
.template-preview-link {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  font-size: .72rem; font-weight: 600; letter-spacing: .3px;
  color: var(--blue-ink); text-decoration: none;
}
.template-preview-link:hover { color: var(--blue-ink-hover); text-decoration: underline; }

/* ---- Login / register extras ---- */
.login-back {
  position: fixed; top: 18px; left: 22px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px;
  color: #b8b8b8; font-size: .9rem; font-weight: 600; text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
}
.login-back:hover, .login-back:focus { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
body.light-mode .login-back { color: #595959; }
body.light-mode .login-back:hover, body.light-mode .login-back:focus { color: #222; background: rgba(0,0,0,.06); }
.login-logo a { text-decoration: none; }
.login-logo a:hover h2 { --wm-corner: .5em; }   /* the viewfinder corners reach in on hover */

.pw-field { position: relative; }
.pw-field .form-control { padding-right: 48px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: #b0b0b0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: #fff; background: rgba(255,255,255,.08); outline: none; }
body.light-mode .pw-toggle { color: #666; }
body.light-mode .pw-toggle:hover { color: #222; background: rgba(0,0,0,.06); }

.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-meter-bars { display: flex; gap: 4px; flex: 1; }
.pw-meter-bars span { flex: 1; height: 4px; border-radius: 2px; background: #3a3a3a; transition: background .2s; }
body.light-mode .pw-meter-bars span { background: #e0e0e0; }
.pw-meter[data-level="1"] .pw-meter-bars span:nth-child(-n+1) { background: #dc3545; }
.pw-meter[data-level="2"] .pw-meter-bars span:nth-child(-n+2) { background: #f0ad4e; }
.pw-meter[data-level="3"] .pw-meter-bars span:nth-child(-n+3) { background: #5cb85c; }
.pw-meter[data-level="4"] .pw-meter-bars span:nth-child(-n+4) { background: #2fa36b; }
.pw-meter-label { font-size: .8rem; color: #b0b0b0; min-width: 64px; text-align: right; }
body.light-mode .pw-meter-label { color: #5e5e5e; }
.admin-login-page .login-terms { font-size: .85rem; color: #b0b0b0 !important; margin-top: 16px; text-align: center; }
.admin-login-page .login-terms a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
body.light-mode.admin-login-page .login-terms { color: #5e5e5e !important; }

/* ---- Album page header on small screens ---- */
@media (max-width: 575.98px) {
  .admin-content { padding: 20px 14px; }
  .admin-card { padding: 18px; }
  .album-title-row h4 { font-size: 1.15rem; }
}

/* the theme draws a top border on every collapsed nav item */
@media (max-width: 991.98px) {
  .admin-navbar .navbar-nav .nav-item, .admin-navbar .navbar-nav .nav-link { border: 0 !important; }
  .admin-navbar .navbar-nav .nav-item + .nav-item { border-top: 1px solid rgba(255,255,255,.08) !important; }
}
