/* ===== SLACK v2 - Design System ===== */
:root {
  --yellow: #FFD700;
  --yellow-dark: #e6c200;
  --black: #000000;
  --bg: #0f0f0f;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --bg4: #2a2a2a;
  --border: #2e2e2e;
  --text: #f1f1f1;
  --text-muted: #888;
  --text-dim: #555;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ===== NAVBAR ===== */
.navbar {
  background: var(--black);
  border-bottom: 2px solid var(--yellow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: 1px;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-link span { display: none; }
@media (min-width: 640px) { .nav-link span { display: inline; } }
.nav-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-profile:hover { background: var(--bg3); text-decoration: none; }
.nav-username { color: var(--text); font-weight: 600; font-size: 0.9rem; }
.nav-logout { color: var(--danger); }
.nav-logout:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== AVATARS ===== */
.avatar-sm, .avatar-placeholder-sm {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.avatar-md, .avatar-placeholder-md {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.avatar-lg, .avatar-placeholder-lg {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--yellow); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.avatar-placeholder-sm, .avatar-placeholder-md, .avatar-placeholder-lg {
  background: var(--yellow); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.avatar-placeholder-md { font-size: 1.2rem; }
.avatar-placeholder-lg { font-size: 2rem; }

/* ===== BADGES ===== */
.level-badge {
  background: var(--yellow);
  color: var(--black);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.level-badge-lg { font-size: 0.9rem; padding: 4px 12px; }
.aura-tag { color: var(--yellow); font-size: 0.82rem; font-weight: 600; }
.aura-tag i { margin-right: 2px; }

/* ===== LAYOUT ===== */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.home-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
@media (max-width: 900px) { .home-layout { grid-template-columns: 1fr; } .sidebar { order: -1; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--yellow); color: var(--black);
  padding: 9px 18px; border: none;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { background: var(--yellow-dark); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
}
.form-group label i { margin-right: 6px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px;
  width: 100%; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--yellow); }
textarea { resize: vertical; }
.file-input { padding: 8px; cursor: pointer; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 7px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.upload-btn:hover { background: var(--bg4); color: var(--text); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid var(--success); color: #86efac; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-logo h1 { font-size: 1.8rem; font-weight: 900; color: var(--yellow); }
.auth-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; }

/* ===== FORM PAGE (create-sub, settings) ===== */
.form-page { max-width: 700px; margin: 0 auto; padding: 32px 16px; }
.form-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
}
.form-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.form-card h2 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 8px; }
.settings-section { margin-top: 24px; }
.avatar-preview { margin-bottom: 20px; }

/* ===== TABS ===== */
.feed-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; border: 1px solid transparent; border-bottom: none;
  transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.tab-btn.active {
  color: var(--yellow); background: var(--bg2);
  border-color: var(--border); border-bottom: 2px solid var(--yellow);
}

/* ===== POST CARDS ===== */
.post-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 12px; transition: border-color 0.15s;
}
.post-card:hover { border-color: #444; }
.post-author {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px; gap: 10px;
}
.author-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.author-link:hover { text-decoration: none; }
.author-link strong { font-weight: 700; }
.post-meta-sub { color: var(--text-muted); font-size: 0.82rem; display: block; }
.post-time { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }
.post-body p { line-height: 1.7; margin-bottom: 10px; }
.post-img {
  width: 100%; max-height: 400px; object-fit: cover;
  border-radius: var(--radius-sm); margin: 8px 0; display: block;
}
.post-img-full {
  width: 100%; max-height: 600px; object-fit: contain;
  border-radius: var(--radius-sm); margin: 12px 0; display: block;
}
.file-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 8px 14px;
  border-radius: var(--radius-sm); font-size: 0.88rem;
  text-decoration: none; margin-top: 8px;
}
.file-link:hover { background: var(--bg4); text-decoration: none; }
.post-actions {
  display: flex; align-items: center; gap: 4px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-muted);
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: background 0.15s, color 0.15s; text-decoration: none;
}
.action-btn:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.action-report:hover { color: var(--danger); }

/* ===== POST COMPOSER ===== */
.post-composer {
  display: flex; gap: 12px; margin-bottom: 20px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.composer-form { flex: 1; }
.composer-form textarea {
  margin-bottom: 10px; min-height: 80px;
}
.composer-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.composer-avatar { padding-top: 4px; }

/* ===== POST DETAIL ===== */
.post-detail-wrap { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.breadcrumb { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.breadcrumb a { color: var(--text-muted); }
.post-detail {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.post-detail-actions { display: flex; gap: 4px; }
.post-content { margin: 16px 0; font-size: 1.05rem; line-height: 1.8; }
.post-meta-row {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.82rem;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px;
}

/* ===== COMMENTS ===== */
.comments-section {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.comments-section h3 { font-size: 1.1rem; margin-bottom: 16px; }
.comment {
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.comment:last-of-type { border-bottom: none; }
.comment-author { margin-bottom: 6px; gap: 8px; }
.comment-text { padding-left: 40px; color: var(--text); line-height: 1.6; }
.comment-footer {
  padding-left: 40px; margin-top: 6px;
  display: flex; align-items: center; gap: 12px;
}
.comment-composer {
  display: flex; gap: 12px; margin-top: 20px;
  padding-top: 20px; border-top: 1px solid var(--border);
  align-items: flex-start;
}
.comment-form-inner { flex: 1; }
.comment-form-inner textarea { margin-bottom: 8px; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.sidebar-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sub-list { list-style: none; }
.sub-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.sub-list li:last-child { border-bottom: none; }
.sub-list a { color: var(--text); font-weight: 500; }
.sub-list a:hover { color: var(--yellow); }

/* ===== SUB HEADER ===== */
.sub-header {
  background: var(--bg2); border-bottom: 2px solid var(--yellow);
  padding: 24px 16px; margin-bottom: 24px;
}
.sub-header .sub-info { max-width: 1200px; margin: 0 auto; }
.sub-header h1 { font-size: 1.8rem; font-weight: 900; }
.sub-description { color: var(--text-muted); margin-top: 6px; }
.sub-tag {
  background: var(--bg3); color: var(--text-muted); padding: 3px 10px;
  border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  text-decoration: none;
}
.sub-tag:hover { color: var(--yellow); text-decoration: none; }

/* ===== PROFILE ===== */
.profile-wrap { max-width: 800px; margin: 0 auto; padding: 32px 16px; }
.profile-header {
  display: flex; gap: 28px; align-items: flex-start;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 24px;
}
@media (max-width: 600px) { .profile-header { flex-direction: column; align-items: center; text-align: center; } }
.profile-info h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.profile-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.profile-stats { display: flex; gap: 24px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 1.3rem; font-weight: 800; }
.stat span { color: var(--text-muted); font-size: 0.8rem; }
.profile-since { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.profile-posts h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; display: block; }
.empty-state p { margin-bottom: 20px; }

/* ===== ERROR PAGE ===== */
.error-page {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.error-card {
  text-align: center; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 48px 40px; max-width: 400px;
}
.error-icon { font-size: 3.5rem; color: var(--yellow); margin-bottom: 16px; }
.error-card h1 { font-size: 1.8rem; margin-bottom: 10px; }
.error-card p { color: var(--text-muted); margin-bottom: 24px; }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  max-width: 440px; width: 100%;
}
.modal-box h3 { margin-bottom: 16px; font-size: 1.1rem; }
.modal-box textarea { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border); padding: 32px 16px;
  margin-top: 48px; color: var(--text-muted);
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; margin-bottom: 16px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 0.8rem; color: var(--text-dim); }
