:root {
  --bg: #000000;
  --bg-subtle: #111111;
  --border: #222222;
  --text: #ffffff;
  --muted: #888888;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.light-mode {
  --bg: #ffffff;
  --bg-subtle: #f5f5f5;
  --border: #e0e0e0;
  --text: #000000;
  --muted: #666666;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  padding: 2rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.actions { display: flex; gap: 0.5rem; }

button, .btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

button:hover {
  background: var(--text);
  color: var(--bg);
}

button.primary {
  background: var(--text);
  color: var(--bg);
}

/* Search bar */
.search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

input, select, textarea {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text);
}

.search-input { flex: 1; }

/* Filter list inline */
.filters-inline {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.filter-item {
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.filter-item:hover, .filter-item.active {
  color: var(--text);
  font-weight: 600;
}

/* Minimalist Grid (3 Kolom dengan Gambar Menonjol) */
.prompt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.prompt-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: #000;
  overflow: hidden;
}

.card-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-gen {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.fav-btn-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}

.fav-btn-badge:hover {
  transform: scale(1.15);
}

.fav-btn-badge.active {
  color: #f59e0b;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag-chip {
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 12px;
  cursor: pointer;
}

.tag-chip:hover {
  color: var(--text);
  border-color: var(--text);
}

.card-details {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-prompt-text {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.4rem;
  gap: 0.5rem;
}

.action-group-left, .action-group-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}

.icon-btn.danger:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal.active { display: flex; }

.modal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  border-radius: 6px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  border: none;
  background: none;
  font-size: 1.2rem;
  color: var(--muted);
}

.modal-close:hover { color: var(--text); background: none; }

.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--text);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
}
