/* ARKANUM - Dark Editorial CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --surface: #161618;
  --card: #1e1e21;
  --border: #2a2a2e;
  --accent: #c9a96e;
  --accent2: #8b7355;
  --text: #e8e6e0;
  --muted: #888680;
  --danger: #c0392b;
  --success: #27ae60;
  --tag-bg: #252528;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-family: Georgia, serif;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: 3px;
  font-weight: 400;
  flex-shrink: 0;
}
.logo small {
  display: block;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin-top: -4px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a, .nav-links button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links button:hover { color: var(--text); background: var(--card); }
.nav-links a.active { color: var(--accent); }
#nav-user { display: flex; align-items: center; gap: 8px; }
#nav-username { font-size: 12px; color: var(--accent); }

/* BUTTONS */
.btn {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0d0d0f; font-weight: 600; }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); color: #0d0d0f; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { font-size: 11px; padding: 4px 10px; }

/* LAYOUT */
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.page { display: none; }
.page.active { display: block; }

/* HERO */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 32px 20px;
}
.hero-inner { max-width: 900px; margin: 0 auto; }
.hero-tag {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero-title {
  font-family: Georgia, serif;
  font-size: 28px;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
  font-weight: 400;
}
.hero-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* TOPIC FILTER */
.topic-filter {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topic-filter::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent2); color: var(--text); }
.chip.active { border-color: var(--accent); color: var(--accent); background: rgba(201,169,110,0.08); }

/* ARTICLES GRID */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.article-card:hover { border-color: var(--accent2); }
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.article-topic {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.article-date { font-size: 11px; color: var(--muted); }
.article-title {
  font-family: Georgia, serif;
  font-size: 17px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  font-weight: 400;
}
.article-tagline { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.article-stats { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.article-stats span { display: flex; align-items: center; gap: 4px; }

/* ARTICLE DETAIL */
.article-content {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  max-width: 680px;
}
.article-content p { margin-bottom: 16px; }
.article-content h2 { font-family: Georgia, serif; font-size: 20px; margin: 24px 0 12px; color: var(--accent); }

/* COMMENTS */
.comments-section { margin-top: 32px; }
.comments-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.comment-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.comment {
  display: flex;
  gap: 10px;
}
.comment.reply { margin-left: 36px; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #0d0d0f;
  font-weight: 600;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-size: 12px; color: var(--accent); margin-bottom: 3px; }
.comment-text { font-size: 13px; color: var(--text); line-height: 1.6; }
.comment-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-actions button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}
.comment-actions button:hover { color: var(--accent); }

/* COMMENT FORM */
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s;
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea::placeholder { color: var(--muted); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-select option { background: var(--card); }
.form-textarea { resize: vertical; min-height: 200px; line-height: 1.7; }
.form-title { font-family: Georgia, serif; font-size: 22px; }

/* THREADS */
.thread-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 10px;
}
.thread-card:hover { border-color: var(--accent2); }
.thread-title { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.thread-meta { font-size: 11px; color: var(--muted); display: flex; gap: 12px; }

/* TOPIK GRID */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.topic-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card-name { font-size: 13px; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.topic-card-desc { font-size: 11px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.topic-card-count { font-size: 11px; color: var(--muted); }
.topic-card.add-new { border-style: dashed; display: flex; align-items: center; justify-content: center; min-height: 80px; }
.topic-card.add-new:hover { border-color: var(--accent); }
.topic-card.add-new span { color: var(--muted); font-size: 12px; text-align: center; }

/* ADMIN */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-num { font-size: 28px; font-weight: 600; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 12px; }
.admin-table th { color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.admin-table tr:hover td { background: var(--surface); }

/* AUTH MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
  margin: 20px;
}
.modal-title { font-family: Georgia, serif; font-size: 20px; color: var(--accent); margin-bottom: 20px; }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.modal-tab {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: all 0.2s;
}
.modal-tab.active { border-color: var(--accent); color: var(--accent); }
.modal-error { color: var(--danger); font-size: 12px; margin-top: 8px; display: none; }
.modal-close { float: right; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; }

/* DIVIDER */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* EMPTY */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 32px; margin-bottom: 8px; }
.empty-text { font-size: 13px; }

/* LOADING */
.loading { text-align: center; padding: 20px; color: var(--muted); font-size: 12px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  z-index: 300;
  transform: translateY(100px);
  transition: transform 0.3s;
}
.toast.show { transform: translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* BACK BTN */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .hero-title { font-size: 22px; }
  .nav-links a span, .nav-links button span { display: none; }
  .topics-grid { grid-template-columns: 1fr 1fr; }
}
