/* ============================================================
   ForumLA — Main Stylesheet
   Aesthetic: Professional Local / VM-Matched
   Dark navy + gold accent + clean white content
   Fonts: Barlow Condensed (headers) + Barlow (body)
   ============================================================ */

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:           #f4f5f7;
  --bg-surface:   #ffffff;
  --bg-raised:    #f0f2f5;
  --bg-hover:     #e8eaed;
  --border:       #e0e3e8;
  --border-light: #d0d4da;

  --nav-bg:       #1e2535;
  --nav-bg-deep:  #161d2e;
  --nav-text:     #c8cdd8;
  --nav-active:   #ffffff;

  --text:         #1a1e2e;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;

  --accent:       #e6a817;
  --accent-dark:  #c48f0f;
  --accent-light: #fef3d0;
  --accent-glow:  rgba(230, 168, 23, 0.12);

  --green:        #16a34a;
  --blue:         #2563eb;
  --red:          #dc2626;
  --purple:       #7c3aed;

  --font-head:    'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius:       6px;
  --radius-lg:    10px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.10);
  --sidebar-w:    220px;
  --max-w:        1400px;
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }

/* ─── HEADER ─────────────────────────────────────────────────── */
.fl-header {
  background: var(--nav-bg);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.fl-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.fl-logo {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
}
.fl-logo span { color: var(--accent); }
.fl-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fl-header__tagline {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nav-text);
  opacity: 0.7;
}

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.fl-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr 250px;
  gap: 20px;
  align-items: start;
}

/* ─── LEFT SIDEBAR ───────────────────────────────────────────── */
.fl-sidebar {
  position: sticky;
  top: 76px;
}
.fl-sidebar--left {
  background: var(--nav-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}

.fl-block-label {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nav-text);
  opacity: 0.6;
  padding: 0 4px 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
}
.fl-block-label i { color: var(--accent); margin-right: 5px; opacity: 1; }

.fl-nav-block { margin-bottom: 22px; }
.fl-nav-block ul { list-style: none; }
.fl-nav-block ul li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--nav-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.fl-nav-block ul li a i {
  width: 16px;
  font-size: 0.8rem;
  color: var(--nav-text);
  opacity: 0.5;
}
.fl-nav-block ul li a:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}
.fl-nav-block ul li a:hover i { opacity: 1; }
.fl-nav-block ul li a.active {
  background: rgba(230,168,23,0.15);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}
.fl-nav-block ul li a.active i { color: var(--accent); opacity: 1; }

/* ─── RIGHT SIDEBAR WIDGETS ──────────────────────────────────── */
.fl-sidebar--right { }

.fl-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.fl-widget .fl-block-label {
  color: var(--text-muted);
  border-bottom-color: var(--border);
  opacity: 1;
  padding: 0 0 8px 0;
}
.fl-widget--ai {
  border-top: 3px solid var(--accent);
  background: linear-gradient(135deg, #fffdf5 0%, #fff 100%);
}
.fl-widget__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 6px 0 10px;
  line-height: 1.4;
}

/* Stats grid */
.fl-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.fl-stat {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
}
.fl-stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1;
}
.fl-stat span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* Recent list */
.fl-recent-list { list-style: none; }
.fl-recent-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.fl-recent-list li:last-child { border-bottom: none; }
.fl-recent__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.fl-recent__avatar img { width: 100%; height: 100%; object-fit: cover; }
.fl-recent__info { min-width: 0; }
.fl-recent__info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fl-recent__info span { font-size: 0.7rem; color: var(--text-dim); }

/* Project list */
.fl-project-list { list-style: none; }
.fl-project-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.fl-project-list li:last-child { border-bottom: none; }
.fl-project-list a {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.fl-project-list a:hover { color: var(--text); }
.fl-proj-type {
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.fl-proj-type--build    { background: #dcfce7; color: var(--green); }
.fl-proj-type--repair   { background: #fee2e2; color: var(--red); }
.fl-proj-type--dev      { background: #dbeafe; color: var(--blue); }
.fl-proj-type--design   { background: #ede9fe; color: var(--purple); }
.fl-proj-type--research { background: var(--accent-light); color: var(--accent-dark); }

/* ─── COMPOSE BOX ────────────────────────────────────────────── */
.fl-compose {
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.fl-compose__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--accent);
}
.fl-compose__body { flex: 1; min-width: 0; }
.fl-compose__body textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 12px;
  resize: vertical;
  transition: border-color 0.2s;
}
.fl-compose__body textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.fl-compose__body textarea::placeholder { color: var(--text-dim); }
.fl-compose__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.fl-compose__tools { display: flex; align-items: center; gap: 4px; }
.fl-compose__actions { display: flex; align-items: center; gap: 10px; }

.fl-tool-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.fl-tool-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.fl-tool-select {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 0.8rem;
  font-family: var(--font-body);
}
.fl-tool-select:focus { outline: none; border-color: var(--accent); }

/* ─── AI TOGGLE ──────────────────────────────────────────────── */
.fl-ai-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}
.fl-ai-toggle input { display: none; }
.fl-ai-toggle i { color: var(--accent); }
.fl-ai-toggle:has(input:checked) { color: var(--accent-dark); font-weight: 600; }

/* ─── AI ASK WIDGET ──────────────────────────────────────────── */
.fl-ai-input { display: flex; flex-direction: column; gap: 6px; }
.fl-ai-input textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 8px 10px;
  resize: none;
}
.fl-ai-input textarea:focus { outline: none; border-color: var(--accent); }
.fl-ai-answer {
  margin-top: 10px;
  padding: 12px;
  background: var(--accent-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.fl-btn {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fl-btn--primary { background: var(--accent); color: var(--nav-bg); }
.fl-btn--primary:hover { background: var(--accent-dark); color: #fff; }
.fl-btn--ai {
  background: var(--nav-bg);
  color: var(--accent);
  border: 1px solid transparent;
  width: 100%;
  justify-content: center;
  padding: 9px;
}
.fl-btn--ai:hover { background: var(--nav-bg-deep); }
.fl-btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.fl-btn--outline:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ─── STREAM POSTS ───────────────────────────────────────────── */
.fl-post {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.fl-post:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}
.fl-post[data-type="project_update"] { border-left: 4px solid var(--green); }
.fl-post[data-type="knowledge"]      { border-left: 4px solid var(--blue); }
.fl-post[data-type="repair"]         { border-left: 4px solid var(--red); }

.fl-post__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.fl-post__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--accent);
}
.fl-post__avatar img { width: 100%; height: 100%; object-fit: cover; }
.fl-post__meta { flex: 1; min-width: 0; }
.fl-post__meta strong { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.fl-post__time {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: 8px;
}
.fl-post__cat {
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 6px;
}
.fl-post__type-badge {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fl-badge--project_update { background: #dcfce7; color: var(--green); }
.fl-badge--knowledge      { background: #dbeafe; color: var(--blue); }
.fl-badge--repair         { background: #fee2e2; color: var(--red); }
.fl-badge--link           { background: var(--accent-light); color: var(--accent-dark); }

.fl-post__title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  line-height: 1.25;
}
.fl-post__title a { color: var(--text); }
.fl-post__title a:hover { color: var(--accent-dark); }

.fl-post__content {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 12px;
}
.fl-read-more { color: var(--accent-dark); font-size: 0.82rem; font-weight: 600; }

.fl-post__image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.fl-post__image img { width: 100%; max-height: 500px; object-fit: cover; }

.fl-post__video {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}
.fl-post__video video { width: 100%; max-height: 480px; }

.fl-post__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-post__link:hover { border-color: var(--accent); color: var(--accent-dark); }

.fl-post__footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.fl-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 5px 11px;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font-body);
}
.fl-reaction-btn:hover {
  background: var(--bg-raised);
  border-color: var(--border);
  color: var(--text);
}
.fl-reaction-btn.active { color: var(--accent-dark); }
.fl-reaction-btn--admin { margin-left: auto; }

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.fl-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.fl-empty i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  color: var(--border-light);
}

/* ─── PAGINATION ─────────────────────────────────────────────── */
.fl-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.fl-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 7px 16px;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}
.fl-page-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.fl-footer {
  background: var(--nav-bg);
  border-top: 3px solid var(--accent);
  margin-top: 40px;
  padding: 24px 20px;
}
.fl-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.fl-footer__copy { font-size: 0.78rem; color: var(--nav-text); opacity: 0.6; }
.fl-footer__links { display: flex; gap: 18px; }
.fl-footer__links a { font-size: 0.78rem; color: var(--nav-text); opacity: 0.6; }
.fl-footer__links a:hover { color: var(--accent); opacity: 1; }

/* ─── AUTH ───────────────────────────────────────────────────── */
.fl-auth-btn {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--nav-bg);
  border: none;
  border-radius: var(--radius);
  padding: 7px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.fl-auth-btn:hover { background: #fff; color: var(--nav-bg); }
.fl-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--nav-text);
}
.fl-user-menu strong { color: #ffffff; }
.fl-user-menu a { color: var(--nav-text); font-size: 0.78rem; opacity: 0.7; }
.fl-user-menu a:hover { color: var(--accent); opacity: 1; }

/* ─── UTILITY ────────────────────────────────────────────────── */
.fl-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .fl-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .fl-sidebar--right { display: none; }
}
@media (max-width: 720px) {
  .fl-layout { grid-template-columns: 1fr; padding: 12px; }
  .fl-sidebar--left { display: none; }
  .fl-header__tagline { display: none; }
}
