/* Evoke Props and Costumes - styling
   Brand: purple is the main accent, gold is a rare touch for the main action.
   Dark by default, light mode toggles on. */

:root {
  --gold: #f0c040;
  --purple: #8224e3;
  --purple-deep: #4a157c;
  --purple-light: #b07ee8;

  /* dark theme (default) */
  --bg: #080808;
  --bg-soft: #120f1c;
  --card: #1a1527;
  --card-2: #221b33;
  --line: #2e2740;
  --text: #e8e4dc;
  --text-soft: #b9b2c8;
  --heading: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
}

[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f6f3ef;
  --line: #e2dcd2;
  --text: #2a2535;
  --text-soft: #6b6478;
  --heading: #1c1726;
  --shadow: 0 8px 24px rgba(74,21,124,0.10);
}

* { box-sizing: border-box; }

/* Anything marked "hidden" must truly hide, even if it has its own display style.
   Without this, the panels and login box would always show. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Mulish", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--heading);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.gold { color: var(--gold); font-style: italic; }

a { color: var(--purple-light); }

/* Buttons */
.btn {
  font-family: "Mulish", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: #2a2200; }
.btn-gold:hover { background: #f5cd5e; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple-light); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-deep); }
.btn-danger { background: transparent; color: #ff8a8a; border-color: #5a2330; }
.btn-danger:hover { background: #3a1620; }
.btn-block { width: 100%; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-icon { background: transparent; border-color: var(--line); padding: 0.5rem 0.7rem; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.6rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { width: 150px; height: auto; margin-bottom: 0.6rem; }
.login-title { font-size: 2rem; margin: 0.2rem 0 0.2rem; }
.login-sub { color: var(--text-soft); margin: 0 0 1.4rem; }
.login-form { display: grid; gap: 0.9rem; text-align: left; }
.login-form label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--text-soft); }

input, select, textarea {
  font-family: "Mulish", sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(130,36,227,0.18);
}

.config-warning {
  margin-top: 1.2rem;
  padding: 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 10px;
  text-align: left;
  font-size: 0.9rem;
}
.config-warning code { color: var(--gold); }

/* Top bar */
.app { max-width: 1200px; margin: 0 auto; padding: 1rem 1.2rem 4rem; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 0.8rem; }
.topbar-logo { height: 38px; width: auto; }
.topbar-title { font-size: 1.7rem; margin: 0; }
.topbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.whoami { font-size: 0.82rem; color: var(--text-soft); align-self: center; }

/* Controls */
.controls { padding: 1.2rem 0 0.6rem; display: grid; gap: 0.8rem; }
.search { max-width: 520px; }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.filter { width: auto; min-width: 130px; }
.attention-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; color: var(--text-soft);
}
.attention-toggle input { width: auto; }
.result-count { color: var(--text-soft); font-size: 0.85rem; margin: 0.6rem 0; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); border-color: var(--purple); }
.card-thumb {
  aspect-ratio: 1 / 1;
  background: var(--card-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .no-photo { color: var(--text-soft); font-size: 0.8rem; }
.card-body { padding: 0.7rem 0.8rem 0.9rem; display: grid; gap: 0.35rem; }
.card-name { font-weight: 700; font-size: 0.98rem; line-height: 1.25; }
.card-meta { font-size: 0.8rem; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; }

/* Tags and badges */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(130,36,227,0.18);
  color: var(--purple-light);
  border: 1px solid rgba(130,36,227,0.35);
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.badge.available { background: rgba(40,160,90,0.18); color: #6ed79b; border: 1px solid rgba(40,160,90,0.4); }
.badge.inuse { background: rgba(130,36,227,0.18); color: var(--purple-light); border: 1px solid rgba(130,36,227,0.4); }
.badge.outorloaned { background: rgba(240,192,64,0.16); color: var(--gold); border: 1px solid rgba(240,192,64,0.4); }
.badge.missing { background: rgba(220,70,70,0.18); color: #ff9a9a; border: 1px solid rgba(220,70,70,0.45); }
.badge.underrepair { background: rgba(240,192,64,0.16); color: var(--gold); border: 1px solid rgba(240,192,64,0.4); }
.badge.retired { background: rgba(150,150,150,0.15); color: #b9b2c8; border: 1px solid rgba(150,150,150,0.35); }

.empty-state { text-align: center; color: var(--text-soft); padding: 3rem 1rem; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.6rem;
}
.modal-x {
  position: absolute; top: 0.7rem; right: 0.9rem;
  background: transparent; border: none; color: var(--text-soft);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.modal-x:hover { color: var(--text); }
.modal-title { font-size: 1.7rem; margin: 0 0 1rem; }

/* Detail view */
.detail-photos { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 1rem; }
.detail-photos img {
  height: 260px; width: auto; border-radius: 12px; object-fit: cover;
  cursor: zoom-in; border: 1px solid var(--line);
}
.detail-name { font-size: 2rem; margin: 0 0 0.2rem; }
.detail-sub { color: var(--text-soft); margin: 0 0 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem 1.2rem; margin-bottom: 1.2rem; }
.detail-grid .k { font-size: 0.78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.detail-grid .v { font-size: 1rem; }
.detail-notes { background: var(--card-2); border-radius: 10px; padding: 0.8rem; margin-bottom: 1rem; white-space: pre-wrap; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.2rem; }
.detail-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }

.detail-checkout { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.detail-checkout.overdue { border-color: rgba(220,70,70,0.5); }
.detail-checkout .co-text { font-size: 0.95rem; }
.detail-checkout .co-text .who { font-weight: 700; }
.detail-checkout .overdue-tag { color: #ff9a9a; font-weight: 700; }

.set-members { background: var(--card-2); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.set-members .k { font-size: 0.78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.4rem; }
.set-members a { display: inline-block; margin: 0.15rem 0.5rem 0.15rem 0; cursor: pointer; }

.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.sum-card { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; text-align: center; }
.sum-num { font-family: "Cormorant Garamond", serif; font-size: 1.9rem; color: var(--heading); line-height: 1.1; }
.sum-label { font-size: 0.8rem; color: var(--text-soft); margin-top: 0.2rem; }
.sum-h { font-size: 1.2rem; margin: 0.6rem 0; }
.sum-list { display: grid; gap: 0.2rem; }
.sum-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0.35rem 0; }

.repairs { background: var(--card-2); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.repairs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.repairs-head .k { font-size: 0.78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.repair-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.repair-date { font-size: 0.8rem; color: var(--text-soft); white-space: nowrap; }
.repair-note { flex: 1; }
.repair-del { background: transparent; border: none; color: var(--text-soft); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.repair-del:hover { color: #ff9a9a; }

.viewonly-badge { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: rgba(240,192,64,0.16); color: var(--gold); border: 1px solid rgba(240,192,64,0.4); align-self: center; }

/* Forms */
.item-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
.item-form label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--text-soft); }
.item-form .full { grid-column: 1 / -1; }
.field-label { font-size: 0.85rem; color: var(--text-soft); display: block; margin-bottom: 0.4rem; }
.hint { font-size: 0.8rem; color: var(--text-soft); margin: 0.3rem 0 0; }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.4rem; }

.photo-previews { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  border-radius: 6px; width: 22px; height: 22px; cursor: pointer; font-size: 0.9rem;
}
.photo-add { display: inline-block; cursor: pointer; }

/* Manage lists */
.list-group { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; margin-bottom: 0.9rem; }
.list-group h3 { margin: 0 0 0.6rem; font-size: 1.2rem; }
.list-values { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.list-chip { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.4rem 0.3rem 0.85rem; font-size: 0.9rem; }
.list-chip button { background: rgba(220,70,70,0.12); border: 1px solid rgba(220,70,70,0.35); color: #ff9a9a; cursor: pointer; font-size: 1.05rem; line-height: 1; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; }
.list-chip button:hover { background: rgba(220,70,70,0.3); color: #fff; }
.list-add { display: flex; gap: 0.5rem; }
.list-add input, .list-add select { flex: 1; }

.form-error { color: #ff9a9a; font-size: 0.9rem; margin: 0.4rem 0 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--purple);
  color: var(--text); padding: 0.7rem 1.1rem; border-radius: 10px;
  box-shadow: var(--shadow); z-index: 100; font-size: 0.92rem;
}

/* Image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: grid; place-items: center; z-index: 200; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; }

@media (max-width: 560px) {
  .item-form { grid-template-columns: 1fr; }
  .topbar-title { font-size: 1.4rem; }
  .detail-name { font-size: 1.6rem; }
}
