/* =============================================
   PROMPT LIBRARY - MODERN MOBILE-FIRST STYLES
   ============================================= */
:root {
  --bg: #0f1117;
  --bg-soft: #171a23;
  --card: #1c202b;
  --card-hover: #232838;
  --border: #2a2f3d;
  --text: #eef0f5;
  --text-dim: #9aa1b2;
  --primary: #7c5cff;
  --primary-dark: #6440ff;
  --accent: #22d3b6;
  --danger: #ff5c7a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --max-width: 1180px;
  font-size: 16px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo img { height: 36px; width: auto; border-radius: 8px; }
.logo .accent { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text-dim);
  transition: all .18s ease;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--card);
  color: var(--text);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.93rem;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #9a7bff); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(124,92,255,0.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

.header-actions { display: flex; gap: 10px; align-items: center; }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.6rem; cursor: pointer; }

/* Mobile nav */
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 14px 20px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 14px; }
  .hamburger { display: block; }
  .logo span.text { display: inline; }
}

/* ---------- HERO ---------- */
.hero {
  padding: 60px 20px 40px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(124,92,255,0.18), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.hero h1 span { color: var(--primary); }
.hero p {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 26px;
  font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 34px; margin-top: 38px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 1.5rem; color: var(--accent); }
.hero-stats span { font-size: 0.82rem; color: var(--text-dim); }

/* ---------- SECTIONS ---------- */
.section { padding: 40px 20px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title h2 { font-size: 1.4rem; font-weight: 800; }
.section-title a { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* ---------- CATEGORY CHIPS ---------- */
.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover, .chip.active { border-color: var(--primary); background: rgba(124,92,255,0.12); color: var(--primary); }

/* ---------- PROMPT GRID / CARDS ---------- */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.prompt-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(124,92,255,0.4);
}
.prompt-card .thumb {
  height: 170px;
  background: linear-gradient(135deg, #21263a, #171a23);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.prompt-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prompt-card .thumb .placeholder-icon { font-size: 2.6rem; opacity: 0.35; }
.badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}
.prompt-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.prompt-card h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.prompt-card .meta { font-size: 0.8rem; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; }
.reaction-mini { display: flex; gap: 10px; }
.reaction-mini span { display: flex; align-items: center; gap: 4px; }

/* ---------- PROMPT DETAIL ---------- */
.prompt-detail { max-width: 760px; margin: 0 auto; }
.prompt-detail .thumb-large { border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; max-height: 420px; }
.prompt-detail .thumb-large img { width: 100%; object-fit: cover; }
.prompt-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  margin-top: 16px;
}
.prompt-text {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7dbe6;
}
.locked-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,32,43,0.4), rgba(28,32,43,0.97) 70%);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 30px 20px;
  text-align: center;
  gap: 12px;
}
.locked-overlay p { color: var(--text-dim); font-size: 0.9rem; max-width: 300px; }

.reaction-bar {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}
.react-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--border);
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  font-size: 1rem;
}
.react-btn:hover { border-color: var(--primary); }
.react-btn.liked { background: rgba(34,211,182,0.15); border-color: var(--accent); color: var(--accent); }
.react-btn.disliked { background: rgba(255,92,122,0.15); border-color: var(--danger); color: var(--danger); }
.copy-btn { margin-left: auto; }

/* ---------- FORMS ---------- */
.form-page { max-width: 480px; margin: 40px auto; }
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
}
.form-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.form-card .sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.87rem; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.field textarea { min-height: 140px; resize: vertical; font-family: 'SFMono-Regular', Consolas, monospace; }
.field small { color: var(--text-dim); font-size: 0.78rem; }
.form-toggle { display: flex; gap: 8px; margin-bottom: 18px; background: var(--bg-soft); padding: 4px; border-radius: 999px; }
.form-toggle button {
  flex: 1; padding: 9px; border: none; border-radius: 999px; background: transparent; color: var(--text-dim); font-weight: 600; cursor: pointer;
}
.form-toggle button.active { background: var(--primary); color: #fff; }
.form-footer-link { text-align: center; margin-top: 16px; font-size: 0.88rem; color: var(--text-dim); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.88rem; }
.alert-error { background: rgba(255,92,122,0.12); border: 1px solid rgba(255,92,122,0.4); color: #ff8fa4; }
.alert-success { background: rgba(34,211,182,0.12); border: 1px solid rgba(34,211,182,0.4); color: var(--accent); }

/* image preview upload box */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color .15s ease;
  position: relative;
  overflow: hidden;
}
.upload-box:hover { border-color: var(--primary); }
.upload-box img { max-height: 160px; margin: 0 auto 10px; border-radius: 8px; }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- STATIC PAGES ---------- */
.page-content { max-width: 760px; margin: 40px auto; padding: 0 20px; }
.page-content h1 { font-size: 2rem; margin-bottom: 16px; }
.page-content h2 { font-size: 1.2rem; margin: 24px 0 10px; }
.page-content p { color: var(--text-dim); margin-bottom: 12px; }
.contact-methods { display: grid; gap: 14px; margin-top: 20px; }
.contact-methods .item { background: var(--card); border: 1px solid var(--border); padding: 16px 18px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 12px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ---------- PAGINATION ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 9px 15px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); font-weight: 600; font-size: 0.88rem;
}
.pagination .current { background: var(--primary); border-color: var(--primary); }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 30px 20px 20px;
  background: var(--bg-soft);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer-col h4 { font-size: 0.9rem; margin-bottom: 12px; color: var(--text); }
.footer-col a { display: block; color: var(--text-dim); font-size: 0.87rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ---------- TOAST ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 999;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 500px) {
  .hero { padding: 40px 16px 30px; }
  .hero-stats { gap: 22px; }
  .reaction-bar { flex-wrap: wrap; }
  .copy-btn { margin-left: 0; width: 100%; }
}
