/* ============================================================
   GRUVBOX DARK — WARM CARD STYLE — VR 2535 FORUM
   ============================================================ */

:root {
  --bg:      #f2ede8;
  --bg1:     #faf7f4;
  --bg2:     #ede8e2;
  --bg3:     #d8d0c8;
  --fg:      #2c2825;
  --fg2:     #4a4540;
  --fg3:     #7a7268;
  --red:     #c0392b;
  --green:   #4a7c59;
  --yellow:  #a07800;
  --blue:    #2e7096;
  --purple:  #7d4e8a;
  --aqua:    #2a7d6a;
  --orange:  #b85c1a;
  --gray:    #8a8278;

  --card-bg:     #ffffff;
  --card-border: #e0d8d0;
  --shadow:      0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg:   0 4px 16px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  --radius:      10px;
  --radius-sm:   6px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--fg);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--aqua); }

/* ============================================================
   NAV
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  background: #2c2825;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topnav-left, .topnav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f2c060;
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: #f9d98a; }

.nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Avatars */
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg3);
}
.avatar-initials.avatar-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--bg3);
}
.avatar-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg3);
}
.avatar-placeholder.avatar-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg2);
  border: 3px solid var(--bg3);
  color: var(--yellow);
  font-size: 2.5rem;
  font-weight: 700;
}

/* Bell */
.bell-wrapper { position: relative; }
.bell-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.bell-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.bell-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.flash-alert  { background: rgba(251,73,52,0.15);  border: 1px solid var(--red);   color: var(--red);   }
.flash-notice { background: rgba(184,187,38,0.12); border: 1px solid var(--green); color: var(--green); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-card {
  max-width: 420px;
  margin: 5rem auto 0;
  padding: 2.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  font-size: 1.5rem;
  color: var(--yellow);
  margin-bottom: 0.25rem;
  text-align: center;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}
.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea,
.field-input {
  background: #fff;
  border: 1px solid var(--bg3);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, textarea:focus, .field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,112,150,0.15);
}
input[type="file"] { padding: 0.5rem; cursor: pointer; color: var(--fg3); }
textarea { resize: vertical; min-height: 90px; font-family: inherit; }

.field-checks {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.1rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--fg2);
  font-size: 0.95rem;
  user-select: none;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--aqua);
  cursor: pointer;
}

.form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.form-card h1 {
  font-size: 1.3rem;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, input[type="submit"] {
  background: var(--blue);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-block;
}
.btn-primary:hover, input[type="submit"]:hover {
  background: var(--aqua);
  transform: translateY(-1px);
  color: var(--bg);
}

.btn-secondary {
  background: var(--bg2);
  color: var(--fg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
}
.btn-secondary:hover { background: var(--bg3); color: var(--fg); }

.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
}
.btn-link:hover { color: var(--aqua); }

.btn-vote {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--fg3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-vote:hover { border-color: var(--red); color: var(--red); }
.btn-vote-active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(251,73,52,0.1);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-unit     { background: rgba(131,165,152,0.15); color: var(--blue);   }
.badge-risk-yes { background: rgba(251,73,52,0.15);   color: var(--red);    }
.badge-risk-no  { background: rgba(142,192,124,0.13); color: var(--aqua);   }
.badge-open     { background: rgba(184,187,38,0.13);  color: var(--green);  }
.badge-closed   { background: rgba(146,131,116,0.2);  color: var(--gray);   }
.badge-edited   {
  font-size: 0.72rem;
  color: var(--gray);
  background: var(--bg2);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* ============================================================
   WALL / POST LIST
   ============================================================ */
.wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg1);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0.3rem;
}
.tab {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg3);
  transition: background 0.15s, color 0.15s;
}
.tab:hover { background: var(--bg2); color: var(--fg); }
.tab.active { background: var(--blue); color: var(--bg); font-weight: 700; }
.tab.active:hover { color: var(--bg); }

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.empty-state {
  color: var(--gray);
  text-align: center;
  padding: 3.5rem 0;
  font-size: 1rem;
}

.post-card {
  display: block;
  padding: 1.1rem 1.4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.post-card:hover {
  border-color: rgba(131,165,152,0.3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  color: var(--fg);
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.post-title { font-size: 1.05rem; font-weight: 600; flex: 1; color: var(--fg); }

.post-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.post-card-footer { font-size: 0.82rem; color: var(--gray); }

/* ============================================================
   POST SHOW PAGE
   ============================================================ */
.post-show {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-show-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}
.post-show-header h1 {
  font-size: 1.4rem;
  color: var(--fg);
  flex: 1;
  line-height: 1.35;
}
.post-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.post-body {
  padding: 1.25rem 1.75rem;
  color: var(--fg2);
  font-size: 1rem;
  line-height: 1.8;
  border-bottom: 1px solid var(--card-border);
}

/* Post fields */
.post-fields-form { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--card-border); }
.post-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.field-item { display: flex; flex-direction: column; gap: 0.25rem; }
.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray);
}
.field-value { color: var(--fg2); }
.field-input { max-width: 220px; }

.field-audit { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.25rem; }
.audit-entry {
  font-size: 0.78rem;
  color: var(--gray);
  padding-left: 0.65rem;
  border-left: 2px solid var(--bg3);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section {
  padding: 1.5rem 1.75rem;
}
.comments-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg3);
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  background: var(--bg2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}
.comment-form textarea { min-height: 80px; font-size: 0.95rem; }

.comment-list { display: flex; flex-direction: column; gap: 1rem; }

.comment-card {
  padding: 1rem 1.1rem;
  background: var(--bg1);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.comment-author { font-weight: 700; font-size: 0.95rem; color: var(--aqua); }
.comment-time   { font-size: 0.8rem; color: var(--gray); }
.comment-body p { color: var(--fg2); font-size: 0.95rem; line-height: 1.7; }

.comment-edit-form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.comment-edit-form textarea { min-height: 70px; }
.comment-edit-form .form-actions { margin-top: 0; }

/* ============================================================
   NOTIFICATIONS DROPDOWN
   ============================================================ */
.notif-dropdown {
  display: flex;
  flex-direction: column;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg2);
  flex-shrink: 0;
}
.notif-header .btn-link {
  font-size: 0.8rem;
  color: var(--gray);
}
.notif-header .btn-link:hover { color: var(--blue); }

.notif-empty {
  padding: 2rem 1.1rem;
  color: var(--gray);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}
.notif-empty::before {
  content: "✓";
  display: block;
  font-size: 1.4rem;
  color: var(--green);
  margin-bottom: 0.4rem;
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.88rem;
  color: var(--fg2);
  transition: background 0.15s;
  line-height: 1.4;
}
.notif-item:hover { background: var(--bg2); color: var(--fg); }
.notif-item:last-child { border-bottom: none; }
.notif-unread {
  border-left: 3px solid var(--blue);
  padding-left: calc(1.1rem - 3px);
  background: rgba(46,112,150,0.06);
}
.notif-read { opacity: 0.55; }
.notif-actor { font-weight: 700; color: var(--aqua); display: inline; }
.notif-time  { font-size: 0.76rem; color: var(--gray); margin-top: 0.1rem; }
.notif-loading {
  padding: 1.5rem 1.1rem;
  color: var(--gray);
  font-size: 0.88rem;
  text-align: center;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  margin: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--fg3);
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--bg2);
  color: var(--fg);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-card { max-width: 440px; }
.avatar-preview { display: flex; justify-content: center; margin-bottom: 1.5rem; }

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  padding: 0.3rem 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--fg2); }

/* ============================================================
   @MENTION AUTOCOMPLETE
   ============================================================ */
.mention-wrapper { position: relative; }

.mention-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 300;
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.3rem 0;
  overflow: hidden;
}
.mention-item {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  color: var(--fg2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.mention-item:hover,
.mention-item.mention-active {
  background: var(--blue);
  color: var(--bg);
}

/* ============================================================
   IN-FORM ALERTS
   ============================================================ */
.alert {
  background: rgba(251,73,52,0.12);
  border: 1px solid rgba(251,73,52,0.3);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.notice {
  background: rgba(184,187,38,0.1);
  border: 1px solid rgba(184,187,38,0.3);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
