/* Forum-specific styles — extends ../styles.css */

body { display: flex; flex-direction: column; min-height: 100vh; }

.forum-wrap {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

/* Page heading row */
.forum-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.forum-page-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--olive-dark);
  position: relative;
  padding-bottom: .7rem;
  line-height: 1.2;
}

.forum-page-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 36px; height: 3px;
  background: var(--yellow);
  border-radius: 2px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--olive);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: .6rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--olive-dark); }

.btn-approve {
  background: #276749; color: #fff;
  font-weight: 600; font-size: .8rem;
  padding: .35rem .75rem; border-radius: 5px;
  border: none; cursor: pointer; font-family: var(--sans);
  transition: background .15s;
}
.btn-approve:hover { background: #1d4f37; }

.btn-reject {
  background: #c53030; color: #fff;
  font-weight: 600; font-size: .8rem;
  padding: .35rem .75rem; border-radius: 5px;
  border: none; cursor: pointer; font-family: var(--sans);
  transition: background .15s;
}
.btn-reject:hover { background: #9b2c2c; }

.btn-ghost {
  display: inline-block;
  background: transparent; color: var(--olive);
  font-weight: 600; font-size: .875rem;
  padding: .5rem .9rem; border-radius: 6px;
  border: 1.5px solid var(--olive);
  cursor: pointer; font-family: var(--sans);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--olive); color: #fff; }

/* Thread list */
.thread-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(51,61,42,.09);
  overflow: hidden;
}

.thread-list-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.thread-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eef0ea;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: #f7f8f4; }

.thread-item-main { min-width: 0; }

.thread-title {
  font-weight: 600;
  font-size: .975rem;
  color: var(--olive-dark);
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-meta { font-size: .78rem; color: var(--text-muted); }

.thread-stats { text-align: right; flex-shrink: 0; }

.thread-reply-count { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

/* Thread view */
.thread-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  color: var(--olive);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.thread-back:hover { text-decoration: underline; }

.thread-view-title {
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--olive-dark);
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.post-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(51,61,42,.08);
  overflow: hidden;
}

.post-card.post-op { border-left: 4px solid var(--yellow); }

.post-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1.25rem;
  background: #f7f8f4;
  border-bottom: 1px solid #eef0ea;
}

.post-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--olive); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
  flex-shrink: 0; text-transform: uppercase;
}

.post-author { font-weight: 600; font-size: .875rem; color: var(--olive-dark); }

.post-time { font-size: .75rem; color: var(--text-muted); margin-left: auto; }

.post-body {
  padding: 1rem 1.25rem;
  font-size: .975rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Reply / new-thread form */
.reply-form-wrap {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(51,61,42,.08);
  padding: 1.5rem;
}

.reply-form-title {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--olive-dark);
  margin-bottom: 1rem;
}

/* Auth / standalone forms */
.forum-form-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(51,61,42,.11);
  overflow: hidden;
  max-width: 460px;
  margin: 2.5rem auto 0;
}

.forum-form-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--olive) 0%, var(--tan) 50%, var(--mint) 100%);
}

.forum-form-body { padding: 2rem 2rem 2.25rem; }

.forum-form-title {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--olive);
  margin-bottom: .3rem;
}

.forum-form-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.form-field { margin-bottom: 1rem; }

.form-field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: .35rem;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field textarea {
  display: block;
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  font-size: .975rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66,129,164,.12);
}

.form-field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-field textarea.tall { min-height: 220px; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

.form-submit { margin-top: 1.5rem; }
.form-submit .btn-primary { width: 100%; padding: .75rem; font-size: 1rem; text-align: center; }

.form-alt-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.form-alt-link a { color: var(--blue); text-decoration: none; font-weight: 600; }
.form-alt-link a:hover { text-decoration: underline; }

/* Alerts */
.alert {
  padding: .85rem 1.1rem;
  border-radius: 7px;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  line-height: 1.5;
}
.alert-error   { background: #fff5f5; border-left: 4px solid #fc8181; color: #742a2a; }
.alert-success { background: #f0fff4; border-left: 4px solid #68d391; color: #22543d; }
.alert-info    { background: #ebf8ff; border-left: 4px solid #63b3ed; color: #2c5282; }
.alert-warn    { background: #fffbeb; border-left: 4px solid var(--yellow); color: #744210; }

/* Admin */
.admin-section { margin-bottom: 2.5rem; }

.admin-section-title {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--olive-dark);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #eef0ea;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(51,61,42,.08);
  font-size: .875rem;
}

.user-table th {
  text-align: left;
  padding: .7rem 1rem;
  background: #f7f8f4;
  font-weight: 700;
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid #eef0ea;
}

.user-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #eef0ea;
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }

.user-table .actions { display: flex; gap: .4rem; align-items: center; }

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .18rem .5rem;
  border-radius: 4px;
}
.badge-pending  { background: #fefcbf; color: #744210; }
.badge-approved { background: #c6f6d5; color: #22543d; }
.badge-rejected { background: #fed7d7; color: #742a2a; }
.badge-admin    { background: var(--olive); color: #fff; }

/* Format toolbar */
.format-toolbar {
  display: flex;
  gap: .3rem;
  margin-bottom: .4rem;
}

.format-btn {
  background: #f7f8f4;
  border: 1.5px solid #cbd5e0;
  border-radius: 5px;
  width: 32px; height: 28px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, border-color .1s;
}
.format-btn:hover { background: #eef0ea; border-color: var(--olive); }

/* Admin delete post */
.delete-post-form { margin-left: .5rem; }

.btn-delete-post {
  background: transparent;
  border: 1px solid #fc8181;
  color: #c53030;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-delete-post:hover { background: #c53030; color: #fff; }

/* Setup page */
.setup-wrap {
  max-width: 520px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .forum-wrap { padding: 1.5rem 1rem 3rem; }
  .thread-item { grid-template-columns: 1fr; }
  .thread-stats { text-align: left; }
  .forum-form-body { padding: 1.5rem 1.25rem 1.75rem; }
  .user-table { font-size: .8rem; }
  .user-table th, .user-table td { padding: .55rem .75rem; }
}
