/* cards.css
   Card styles shared across logs and inventory pages.
   Requires base.css variables. */

/* ── Base card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Log card ───────────────────────────────────────────────────────────────── */
.log-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 12px;
}

.log-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.log-code  { color: var(--accent); font-size: 13px; font-weight: 700; }
.log-cat   { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.log-tags  { color: var(--text-faint); font-size: 12px; margin-top: 2px; }

.log-actions { display: flex; gap: 8px; flex-shrink: 0; }

.log-action-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-faint); font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}

.log-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.log-action-btn.danger:hover { border-color: var(--red); color: var(--red); }

.log-content {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.log-second {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Inventory card ─────────────────────────────────────────────────────────── */
.inv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inv-card-header {
  padding: 14px;
  cursor: pointer;
  user-select: none;
}

.inv-card-header:active { background: #fafafa; }

.inv-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 6px;
}

.inv-card-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.inv-box-code { color: var(--accent); font-size: 16px; font-weight: 700; }
.inv-meta     { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.inv-preview  { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.expand-btn {
  background: none; border: none; color: var(--text-ghost);
  font-size: 11px; cursor: pointer; padding: 0; line-height: 1;
  transition: transform 0.2s;
}

.inv-card.open .expand-btn { transform: rotate(180deg); }

/* Thumbnails strip */
.inv-thumbs {
  display: flex; gap: 4px; padding: 0 14px 12px; flex-wrap: wrap;
}

.inv-thumbs img {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 5px; border: 1px solid var(--border); cursor: pointer;
}

/* Card footer */
.inv-card-footer {
  border-top: 1px solid var(--border-light);
  padding: 8px 14px;
  display: flex; justify-content: flex-end;
  margin-top: auto;
}

/* Expanded details */
.inv-card-details {
  display: none;
  border-top: 1px solid var(--border-light);
  padding: 14px;
}

.inv-card.open .inv-card-details { display: block; }

.detail-row   { display: flex; gap: 12px; margin-bottom: 10px; }
.detail-item  { flex: 1; min-width: 0; }

.detail-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-ghost); font-weight: 700; margin-bottom: 3px;
}

.detail-value { font-size: 13px; color: #333; line-height: 1.5; }

/* Gallery inside expanded */
.inv-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.inv-gallery img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer;
}

/* ── Inventory grid ─────────────────────────────────────────────────────────── */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}