/* ============================================================
   admin.css — the keeper's tools.
   Same meadow, same paper. Quieter, because this side is work.
   Reads the tokens defined in style.css.
   ============================================================ */

/* ---- the acorn hidden on the gate ---- */
.acorn {
  position: absolute;
  bottom: 16px;
  right: 18px;
  font-size: 18px;
  opacity: .16;
  cursor: pointer;
  user-select: none;
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,1.4,.4,1);
}

.acorn:hover,
.acorn:active {
  opacity: .95;
  transform: rotate(-14deg) scale(1.2);
}

/* ---- badge shown once you're signed in ---- */
.keeper-badge {
  display: none;                 /* script sets flex */
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  cursor: pointer;
  z-index: 90;
  box-shadow: var(--lift-2);
  animation: keeperFloat 5s ease-in-out infinite;
}

@keyframes keeperFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ---- the gate ---- */
.keeper-gate {
  display: none;                 /* script sets flex */
  position: fixed;
  inset: 0;
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 22px;
  background: rgba(46,58,44,.42);
  backdrop-filter: blur(8px);
}

.keeper-card {
  width: 100%;
  max-width: 370px;
  padding: 30px 26px 26px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 20px;
  box-shadow: var(--lift-3);
  animation: settle .4s cubic-bezier(.2,.9,.3,1) both;
}

.keeper-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
}

.keeper-sub {
  margin: 5px 0 20px;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.keeper-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.keeper-actions .admin-btn { flex: 1; }

.keeper-error {
  margin-top: 13px;
  min-height: 17px;
  font-family: var(--ui);
  font-size: 12.5px;
  color: var(--berry);
  text-align: center;
}

/* ---- the panel ---- */
.admin-panel {
  display: none;                 /* script sets block */
  position: fixed;
  inset: 0;
  z-index: 190;
  overflow-y: auto;
  padding: 20px 20px 70px;
  background: var(--paper);
  font-family: var(--ui);
  color: var(--ink);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--paper-edge);
}

.admin-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 25px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.admin-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.admin-tab {
  padding: 8px 15px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.admin-tab:hover { background: var(--paper-warm); }

.admin-tab.active {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--paper);
}

/* ---- fields ---- */
.admin-label {
  display: block;
  margin: 16px 0 6px;
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.admin-input {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 4px;
  font-family: var(--ui);
  font-size: 15px;
  color: var(--ink);
  background: #fffdf6;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.admin-input::placeholder { color: #a9b3a1; }

.admin-input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(78,122,82,.16);
}

.admin-input.tiny { padding: 7px 10px; font-size: 12.5px; margin: 0; }

textarea.admin-input {
  resize: vertical;
  line-height: 1.65;
  font-family: var(--read);
  font-size: 16px;
}

/* ---- buttons ---- */
.admin-btn {
  padding: 11px 20px;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  background: var(--moss);
  border: 1px solid var(--moss);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}

.admin-btn:hover { background: #416a45; box-shadow: var(--lift-1); transform: translateY(-1px); }
.admin-btn:active { transform: translateY(1px); }

.admin-btn.ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--paper-edge);
}

.admin-btn.ghost:hover { background: var(--paper-warm); }

.admin-mini {
  padding: 5px 11px;
  margin-left: 4px;
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.admin-mini:hover { background: var(--paper-warm); color: var(--ink); }

.admin-mini.danger { color: var(--berry); border-color: rgba(168,80,111,.4); }
.admin-mini.danger:hover { background: rgba(168,80,111,.1); color: var(--berry); }

.admin-actions { display: flex; gap: 9px; margin-top: 16px; }

.admin-note {
  margin: 7px 0;
  font-family: var(--ui);
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---- entry list ---- */
.admin-list { margin-top: 16px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 10px 14px;
  margin-bottom: 7px;
  background: #fffdf6;
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--meadow);
  border-radius: 4px 10px 10px 4px;
  transition: border-left-color .2s ease, transform .15s ease;
}

.admin-row:hover { border-left-color: var(--moss); transform: translateX(2px); }

.admin-row-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- the editing form ---- */
.admin-form {
  margin-top: 20px;
  padding: 18px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: var(--edge);
  animation: settle .35s cubic-bezier(.2,.9,.3,1) both;
}

.admin-form-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---- photo management ---- */
.admin-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.admin-photo {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 154px;
  padding: 9px;
  background: #fffdf6;
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
}

.admin-photo img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper-warm);
}

.admin-photo .admin-mini { align-self: flex-end; margin: 0; }

/* ---- captions under album photos ---- */
.memory-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  max-width: 168px;
}

.memory-caption {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
}

/* ---- toast ---- */
.whisper {
  position: fixed;
  bottom: -70px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 11px 20px;
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  text-align: center;
  z-index: 300;
  box-shadow: var(--lift-2);
  transition: bottom .42s cubic-bezier(.2,.9,.3,1.2);
}

.whisper.show { bottom: 26px; }
.whisper.bad  { background: var(--berry); }

@media (max-width: 768px) {
  .memory-figure { max-width: calc(50% - 9px); }
  .memory-figure .memory-photo { width: 100%; }
  .admin-photo { width: calc(50% - 6px); }
  .keeper-badge { bottom: 88px; }   /* clears the bottom nav bar */
  .whisper.show { bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .keeper-badge { animation: none; }
  .admin-btn:hover,
  .admin-row:hover { transform: none; }
}