:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #4f46e5;
}

body.dark {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--card);
  border-bottom: 1px solid #e5e7eb;
}

.hero {
  text-align: center;
  padding: 40px 16px 20px;
}

.hero h1 {
  margin-bottom: 8px;
}

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

main {
  max-width: 900px;
  margin: auto;
  padding: 16px;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-top: 14px;
  font-weight: 600;
}

input, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

textarea {
  min-height: 90px;
}

button {
  margin-top: 16px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#copyStatus {
  font-size: 13px;
  color: var(--muted);
}

footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--muted);
}

.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.prompt-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
  background: var(--bg);
}

.prompt-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.prompt-item h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.prompt-item span {
  font-size: 12px;
  color: var(--muted);
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.category-filter button {
  background: transparent;
  border: 1px solid #d1d5db;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.category-filter button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.prompt-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  margin: 12px 0;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.prompt-item {
  position: relative;
}

.fav-btn {
  background: none !important;
  border: none !important;
  font-size: 20px;
  cursor: pointer;
  color: #f59e0b; /* warna kuning */
  padding: 0;
}

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

.score {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
}

.good { color: #16a34a; }
.warn { color: #ca8a04; }
.bad { color: #dc2626; }

/* ==============================
   PROMPT QUALITY PROGRESS BAR
============================== */
.quality-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f9fafb; /* PAKAI FIXED COLOR */
  font-size: 14px;
}

body.dark .quality-result {
  background: #1f2937;
}

.score-text {
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(0,0,0,0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #ef4444; /* DEFAULT */
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-bar.good { background: #22c55e; }
.progress-bar.warn { background: #f59e0b; }
.progress-bar.bad  { background: #ef4444; }

.quality-feedback {
  padding-left: 18px;
  font-size: 14px;
}

.research-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #eef2f7;
}

body.dark .research-controls {
  background: #111827;
}

.research-controls button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #ef4444;
  color: white;
  font-size: 13px;
}

.research-controls button:hover {
  opacity: 0.9;
}

.library-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

#toggleLibraryBtn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

#toggleLibraryBtn:hover {
  background: var(--primary);
  color: #fff;
}

