/* style.css - modern flat */
:root {
    --bg: #f6f8fa;
    --card: #ffffff;
    --muted: #6b7280;
    --accent: #5b8def;
    --accent-2: #7dd3fc;
    --border: #e6e9ee;
    --shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    --maxwidth: 1100px;
    --radius: 12px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
        monospace;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial;
}

* {
    box-sizing: border-box;
}
body {
    background: var(--bg);
    margin: 0;
    color: #111827;
    line-height: 1.45;
}
.container {
    max-width: var(--maxwidth);
    margin: 28px auto;
    padding: 0 16px;
}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    border: 1px solid var(--border);
}
.topbar {
    display: flex;
    gap: 12px;
    align-items: center;
}
.btn {
    background: var(--accent);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
}
.forum-row {
    display: grid;
    grid-template-columns: 1fr 160px 340px;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.forum-title {
    font-size: 18px;
    font-weight: 700;
}
.subforums {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.subforums a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px dashed var(--border);
}
.meta {
    color: var(--muted);
    font-size: 14px;
}
.thread-list {
    margin-top: 12px;
}
.thread-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 210px;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f1f3f6;
    align-items: center;
}
.thread-title {
    font-size: 16px;
    font-weight: 600;
}
.thread-sub {
    font-size: 12px;
    color: var(--muted);
}
.user-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.user-small {
    font-size: 13px;
    color: var(--muted);
}
.post {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid var(--border);
}
.post .left {
    padding-right: 10px;
    border-right: 1px dashed #f1f3f6;
}
.post .username {
    font-weight: 700;
}
.post .meta {
    font-size: 13px;
    color: var(--muted);
}
.post .signature {
    border-top: 1px dashed #eef2ff;
    padding-top: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}
.reply-box textarea {
    width: 100%;
    height: 160px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
}
.small-muted {
    font-size: 13px;
    color: var(--muted);
}
.pagenav {
    display: flex;
    gap: 6px;
    align-items: center;
}
.post-number {
    font-size: 13px;
    color: var(--muted);
    align-self: start;
}
/* style.css additions */
form label {
    display: block;
    font-weight: 500;
    margin-top: 10px;
    color: #333;
}

form label input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn:hover {
    background: #2563eb;
}

.btn-ghost {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
}
.btn-ghost:hover {
    background: #3b82f6;
    color: #fff;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

/* form-card: consistent centered form width for login/register/etc */
.form-card {
    max-width: 500px;
    margin: 20px auto;
    padding: 22px;
}

/* make the card’s internal spacing slightly larger for forms */
.card.form-card {
    padding: 22px;
}

/* small helper to make link-style buttons consistent on forms */
.link-btn {
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 14px;
}

/* breadcrumbs */
.breadcrumbs {
  font-size: 14px;
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }

/* ensure textarea sits below the label and expands full width */
label textarea,
form label textarea,
textarea[name="content"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  box-sizing: border-box;
  min-height: 260px;
  resize: vertical;
}

/* preview box style */
.md-preview {
  background: #fbfdff;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  min-height: 260px;
  overflow: auto;
}

/* preview header small tweaks */
.preview-header .muted { color: var(--muted); font-size:13px; }

/* Markdown editor toolbar */
.md-toolbar {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:8px;
  align-items:center;
}
.md-toolbar button {
  background:transparent;
  border:1px solid var(--border);
  padding:6px 8px;
  border-radius:6px;
  cursor:pointer;
  font-size:13px;
  color:#333;
}
.md-toolbar button:hover {
  background:#f3f7ff;
  border-color:var(--accent-2);
}
.md-toolbar .kbd {
  font-family: var(--mono);
  font-size:12px;
  color:var(--muted);
  margin-left:6px;
}

/* toolbar dropdowns (emoji / snippets) */
.md-dropdown {
  display: none;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
  max-width: 320px;
  z-index: 100;
}
.md-dropdown .item {
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 8px;
  border-radius:6px;
  cursor:pointer;
  margin:3px;
  font-size:14px;
}
.md-dropdown .item:hover {
  background:#f3f7ff;
}
.toolbar-row { position:relative; } /* parent for dropdown positioning */

/* toolbar button appearance + remove focus ring for visual noise */
.md-toolbar button,
.toolbar-row .btn-ghost {
  background: transparent;
  border: none;
  padding: 6px 8px;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
}

/* avoid the focus ring showing up after click/focus (still accessible via keyboard) */
.md-toolbar button:focus {
  outline: none;
  box-shadow: none;
}

/* dropdown menu basics */
.md-dropdown {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
  padding: 8px;
  border-radius: 8px;
  z-index: 60;
  min-width: 220px;
}

/* dropdown item */
.md-dropdown .item {
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
}
.md-dropdown .item:hover { background: #f3f4f6; }

/* basic positioning helper - ensure the toolbar container is positioned so dropdown can absolutely position */
.toolbar-row { position: relative; }

/* quote styling in posts */
.post blockquote {
  background: #f8fafc;        /* light grey/blue */
  border-left: 3px solid #e6eef9;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0;
}
.post blockquote p { margin: 0; }
