/* HashChan — App Styles
   Design tokens match the landing page: dark bg, green accent, mono font.
   Every element is purpose-built — no generic framework classes.
*/

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --fg: #e0e0e8;
  --fg-dim: #6b6b7b;
  --fg-muted: #3a3a4a;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --amber: #ffb800;
  --red: #ff4444;
  --yellow: #ffcc00;
  --green: #00ff88;
  --border: #1e1e2a;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  line-height: 1.6;
  font-size: 14px;
}

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

/* ====== HEADER ====== */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.site-logo .hash { color: var(--accent); }

.header-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
}

.pass-badge {
  background: rgba(0,255,136,0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ====== LAYOUT ====== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.page-sub {
  color: var(--fg-dim);
  font-size: 13px;
  margin-bottom: 24px;
}

/* ====== BOARD LIST ====== */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.board-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.15s;
}

.board-card:hover { border-color: var(--accent); }

.board-slug {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
}

.board-name {
  color: var(--fg);
  font-weight: 500;
  margin-top: 4px;
}

.board-desc {
  color: var(--fg-dim);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.5;
}

.board-stats {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 10px;
  font-family: var(--font-mono);
}

/* ====== CATALOG (thread list) ====== */
.catalog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
}

.btn-ghost:hover { border-color: var(--fg-dim); color: var(--fg); }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.thread-list { display: flex; flex-direction: column; gap: 0; }

.thread-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  gap: 0;
}

.thread-thumb {
  width: 100px;
  min-width: 100px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.thread-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.thread-thumb-empty {
  width: 100px;
  min-width: 100px;
  height: 100px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 22px;
}

.thread-body {
  flex: 1;
  padding: 12px 16px;
  min-width: 0;
}

.thread-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.thread-subject {
  font-weight: 600;
  color: var(--fg);
  font-size: 14px;
  margin-bottom: 4px;
}

.thread-excerpt {
  color: var(--fg-dim);
  font-size: 13px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.thread-stats {
  font-size: 11px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 8px;
}

.name-field { color: var(--fg); font-weight: 500; }
.tripcode { color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
.post-no { color: var(--fg-muted); font-family: var(--font-mono); font-size: 11px; }

/* ====== NEW THREAD FORM ====== */
.post-form-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.form-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-dim);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 150px;
}

.form-group label {
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg);
  padding: 8px 10px;
  font-family: var(--font-display);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.captcha-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-box .pass-active {
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ====== THREAD VIEW ====== */
.thread-view-op {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.post-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 4px;
  float: left;
  margin: 0 16px 8px 0;
  cursor: pointer;
}

.post-image:hover { opacity: 0.9; }

.post-body {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.post-body a { color: var(--accent); }

.reply-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

.reply-post {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  gap: 14px;
}

.reply-post-image {
  max-width: 120px;
  max-height: 120px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.reply-content { flex: 1; min-width: 0; }

/* ====== PASS PAGE ====== */
.pass-hero {
  text-align: center;
  padding: 48px 24px 32px;
}

.pass-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.pass-hero .lede {
  color: var(--fg-dim);
  max-width: 480px;
  margin: 0 auto 32px;
  font-size: 1rem;
}

.pass-buy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px;
}

.pass-price {
  text-align: center;
  margin-bottom: 20px;
}

.pass-price .amount {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.pass-price .period {
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin-top: 4px;
}

.pass-features {
  list-style: none;
  margin-bottom: 24px;
}

.pass-features li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pass-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
}

.payment-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
}

.btc-address {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-card);
  padding: 10px;
  border-radius: 4px;
  word-break: break-all;
  margin: 12px 0;
  cursor: pointer;
  border: 1px solid var(--border);
}

.btc-address:hover { border-color: var(--accent); }

.payment-amount {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--amber);
  margin-bottom: 8px;
}

.payment-status {
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

.payment-status .confirmed {
  color: var(--green);
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  background: #fff;
  margin: 12px auto;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #888;
  padding: 8px;
  text-align: center;
}

/* ====== ADMIN ====== */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section h2 {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ====== UTILS ====== */
.clearfix::after { content: ''; display: table; clear: both; }

.error-page {
  text-align: center;
  padding: 80px 24px;
}

.error-page h1 {
  font-size: 3rem;
  color: var(--red);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.badge-nsfw { background: var(--red); color: #fff; }
.badge-sticky { background: var(--amber); color: #000; }
.badge-locked { background: var(--fg-muted); color: var(--fg); }
.badge-pass { background: rgba(0,255,136,0.15); color: var(--accent); border: 1px solid var(--accent); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ====== BREADCRUMB ====== */
.breadcrumb {
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.breadcrumb a { color: var(--fg-dim); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span { color: var(--fg-muted); margin: 0 6px; }

/* ====== RESPONSIVE ====== */
@media (max-width: 600px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .board-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .thread-row { flex-direction: column; }
  .thread-thumb, .thread-thumb-empty { width: 100%; min-width: 100%; height: 160px; }
  .thread-thumb img { width: 100%; height: 160px; }
  .pass-hero h1 { font-size: 1.5rem; }
}
