/* Shared styling rules for the Shelf frontend. */


:root {
  --bg: #0f1218;
  --bg2: #141923;
  --card: #171c27;
  --surface: #1d2331;
  --surface-alt: #232a3a;
  --ink: #e8edf5;
  --muted: #a6afbd;
  --accent: #6f8bff;
  --border: #2a3242;
  --chip: #20273a;
  --chip-border: #2f3a52;
  --badge: #232b3e;
  --pill: #1b2230;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  color: var(--ink);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  padding: 24px 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 20px;
}

.hero-row {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  align-items: center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.user-pill {
  background: var(--pill);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  display: none;
}

.user-pill.show {
  display: inline-block;
}

.card {
  background: var(--card);
  padding: 20px 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flag-line {
  gap: 8px;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  min-width: 220px;
  width: 220px;
  background: var(--surface);
  color: var(--ink);
}

input[type="checkbox"] {
  width: auto;
  min-width: 0;
  padding: 0;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
.cta {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.info-btn {
  font-weight: 700;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  padding: 0;
}

button.danger {
  background: #b0413e;
}

.loading {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: min(90vw, 360px);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.result-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.result-cover.placeholder {
  display: block;
  background: var(--surface-alt);
}

.result-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-actions button {
  flex: 1 1 0;
  min-width: 92px;
}

.result-card select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 560px) {
  .result-actions {
    flex-direction: column;
  }
}

.details-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  display: grid;
  gap: 6px;
  width: 100%;
}

.details-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.details-cover {
  width: 110px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.details-meta {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.details-links a {
  color: var(--accent);
  text-decoration: none;
  background: var(--chip);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.details-links a:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.details-description {
  color: var(--muted);
  line-height: 1.5;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-line;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
}

.details-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: baseline;
}

.details-label {
  font-weight: 600;
  color: var(--ink);
}

.details-value {
  color: var(--muted);
}

.details-group {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.details-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
}

.options-divider {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--muted);
}

.chips-label {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  background: var(--chip);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
}

.status {
  margin-top: 12px;
  color: var(--muted);
}

.status.error {
  color: #c0392b;
}

.muted {
  color: var(--muted);
}


.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge);
  color: var(--ink);
  font-size: 0.85rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 700px) {
  .hero-row {
    flex-direction: column;
    align-items: center;
  }
}

.textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}


.modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.modal {
  border: none;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
}

.details-modal {
  width: min(1200px, 96vw);
  max-width: 96vw;
  height: 92vh;
  max-height: 92vh;
  overflow: hidden;
}

.details-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.details-modal-content {
  overflow: auto;
  max-height: calc(92vh - 80px);
  padding-right: 6px;
}

.details-modal-content .details-box {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}

.modal h3 {
  margin: 0 0 8px;
}

.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}


button:hover,
.cta:hover {
  filter: brightness(0.9);
}

button.ghost:hover {
  filter: none;
  background: var(--surface-alt);
}

button.danger:hover {
  filter: brightness(0.92);
}


.nav a:hover {
  background: var(--surface);
}

.nav a.active:hover {
  background: var(--accent);
  filter: brightness(0.9);
}

.reading-status {
  width: auto;
  min-width: 140px;
  padding: 8px 10px;
}

@media (max-width: 600px) {
  .reading-status {
    min-width: 0;
    width: auto;
  }
}




.dashboard-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 240px;
  gap: 10px;
}

.dashboard-card p {
  margin: 0;
}


.nav-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-row .nav {
  margin-top: 0;
}

.nav-row .user-pill {
  margin-left: auto;
}
.textarea,
textarea {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
