/* warm library palette to match the app. yes --fuchsia is actually orange,
   it started pink then i recolored it and never renamed the var, oh well */
:root {
  --cream: #fdf9f3;
  --beige: #f4ecdf;
  --beige-deep: #e9ddcb;
  --ink: #46243c;
  --ink-soft: rgba(70, 36, 60, 0.62);
  --pink: #ec4899;
  --pink-soft: #fbcfe8;
  --pink-deep: #9d174d;
  --fuchsia: #eda223;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px; /* barely used tbh */
  --col-max-height: calc(100vh - 140px);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #fffdfa url("images/library.jpg") repeat fixed;
  background-size: 380px auto;
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 88px;
  padding: 0 32px;
  display: flex;
  gap: 12px;
  background: var(--beige-deep);
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(70, 36, 60, 0.1);
  box-shadow: 0 2px 14px rgba(70, 36, 60, 0.08);
}

header h1 {
  font-family: "Fraunces", serif;
  font-weight: 560;
  color: var(--ink);
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.4px;
  white-space: nowrap;
}

header h1 em {
  font-style: italic;
  font-weight: 640;
  font-size: 30px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* toolbar bits reuse the pill/badge look from the bug board mode toggle */
.mode-badge {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(70, 36, 60, 0.18);
  color: var(--ink);
  backdrop-filter: blur(6px);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(70, 36, 60, 0.08);
  transition: background 0.15s ease;
}

.mode-badge:hover:not(:disabled) {
  background: #fff;
}

.mode-badge.static {
  cursor: default;
  box-shadow: none;
}

select.mode-badge {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2346243c' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#status-message {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  min-width: 0;
}

/* ---- board ---- */
.board {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 106px 32px 44px;
}

.column {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(253, 246, 238, 0.95);
  border: 1px solid rgba(70, 36, 60, 0.1);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-xl);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(70, 36, 60, 0.08);
  min-height: 160px;
  max-height: var(--col-max-height);
  transition: outline 0.12s ease;
}

/* card being dragged over this column */
.column.drag-over {
  outline: 2px dashed var(--pink);
  outline-offset: -6px;
}

.column h2 {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  margin: 0 8px 14px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.column h2 .count {
  font-weight: 600;
  opacity: 0.65;
  letter-spacing: 0;
}

.column-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(70, 36, 60, 0.3) transparent;
  border-radius: var(--radius-lg);
}

.column-scroll::-webkit-scrollbar {
  width: 5px;
}
.column-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.column-scroll::-webkit-scrollbar-thumb {
  background: rgba(70, 36, 60, 0.3);
  border-radius: 999px;
}
.column-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(70, 36, 60, 0.5);
}

@media (max-width: 820px) {
  header {
    padding: 0 20px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .board {
    flex-direction: column;
    padding: 150px 20px 36px;
  }
  .column {
    max-height: none;
    width: 100%;
  }
}

/* ---- card ---- */
.card {
  border-radius: var(--radius-lg);
  padding: 15px 16px 13px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid rgba(70, 36, 60, 0.06);
  box-shadow: 0 3px 12px rgba(59, 7, 60, 0.14);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 6px 18px rgba(59, 7, 60, 0.2);
  transform: translateY(-1px);
}

/* a little tint per ticket type so the columns read fast, same trick the
   bug board uses for ios/android cards */
.card.report_info {
  background: linear-gradient(180deg, #fdf6ec 0%, var(--cream) 70%);
}
.card.add_book {
  background: linear-gradient(180deg, #eef4fd 0%, var(--cream) 70%);
}
.card.add_series {
  background: linear-gradient(180deg, #f6eefd 0%, var(--cream) 70%);
}
.card.add_edition {
  background: linear-gradient(180deg, #eefdf3 0%, var(--cream) 70%);
}

.card.dragging {
  opacity: 0.45;
}

/* had a rotate on the dragged card for a bit, looked cute but made the drop
   target math feel off so i pulled it
.card.dragging {
  transform: rotate(2deg);
}
*/

.card.done {
  opacity: 0.6;
}
.card.done .title {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card .title {
  font-family: "Fraunces", serif;
  font-weight: 620;
  font-size: 15.5px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.card-num {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0 0;
}

.tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--beige);
  color: var(--ink-soft);
}

/* one color pair per ticket type, matched to the card tints above */
.tag.report_info {
  background: #fef3c7;
  color: #b45309;
}
.tag.add_book {
  background: #dbeafe;
  color: #1d4ed8;
}
.tag.add_series {
  background: #f3e8ff;
  color: #7e22ce;
}
.tag.add_edition {
  background: #dcfce7;
  color: #15803d;
}
.tag.book {
  background: var(--beige-deep);
  color: #7a6653;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 10px;
}

.meta .picked {
  color: var(--pink-deep);
  font-weight: 600;
}

.card-body {
  display: none;
}

.card.expanded .card-body {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(70, 36, 60, 0.12);
}

.desc-label {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

/* Open rides in the head row right after the title. little pill, margin-right
   auto shoves the #id back out to the far right where it was */
.open-btn {
  flex-shrink: 0;
  margin: 1px auto 0 4px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--beige);
  border: 1px solid rgba(70, 36, 60, 0.16);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}
.open-btn:hover {
  background: var(--beige-deep);
}

/* payload key/value grid, dressed to fit the warm theme */
.payload-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 12.5px;
}

.payload-key {
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
}

.payload-val {
  color: var(--ink);
  word-break: break-word;
}

.payload-val.flag-only {
  color: var(--ink-soft);
  font-style: italic;
}

.edit-row {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed rgba(70, 36, 60, 0.15);
}

.edit-row button {
  flex: 1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}
.edit-row button:disabled {
  opacity: 0.6;
  cursor: default;
}

.pickup-btn {
  background: var(--beige);
  border-color: rgba(70, 36, 60, 0.12);
  color: var(--ink);
}

.approve-btn {
  background: var(--fuchsia);
  color: #fff;
}

.card-error {
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 8px;
  white-space: pre-wrap;
}

.empty {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 6px;
}

/* ---- login modal (bug board modal look) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 5, 43, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-box {
  background: var(--cream);
  border-radius: 24px;
  padding: 30px;
  width: 340px;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.modal-box h3 {
  font-family: "Fraunces", serif;
  font-weight: 620;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}

.modal-box h3 em {
  font-style: italic;
}

.modal-box p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.modal-box label {
  display: block;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  margin: 12px 2px 4px;
}

.modal-box input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--beige-deep);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

.modal-box input:focus {
  outline: 2px solid var(--pink-soft);
  border-color: var(--pink);
}

.modal-box button.primary {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: none;
  background: var(--fuchsia);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
}

.modal-box button.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.modal-box details {
  margin-top: 14px;
  text-align: left;
  color: var(--ink-soft);
  font-size: 12px;
}

.modal-box details summary {
  cursor: pointer;
}

.modal-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  min-height: 15px;
  margin-top: 10px;
}

/* ---- payload modal ---- */
/* reuses .modal-overlay + .modal-box but the payload wants to be left aligned,
   a touch wider, and scroll if some add_book ticket has a novel in it */
.payload-modal-box {
  position: relative;
  width: 440px;
  text-align: left;
  padding: 26px 26px 24px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.payload-modal-box .head-row {
  padding-right: 26px; /* keep the title clear of the x */
}

.payload-modal-box .payload-list {
  /* card version is 12.5px, bump it a hair since theres room and youre reading
     it to copy from */
  font-size: 13px;
  /* let the librarian actually select this, cards elsewhere dont care */
  user-select: text;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover {
  background: var(--beige);
  color: var(--ink);
}
