/* ============================================
   Pinnacle — Main Stylesheet
   Design System: Clean Social Media Platform
   Primary: #0373B9 | Radius: 12px | Font: Inter
   ============================================ */

/* ── CSS Custom Properties ── */
:root {
  --brand:        #0373B9;
  --brand-dark:   #025a92;
  --brand-light:  #e8f4fd;
  --brand-glow:   rgba(3,115,185,0.18);

  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #f1f5f9;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;

  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #06b6d4;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --shadow-brand: 0 4px 20px rgba(3,115,185,.25);

  --nav-h:    64px;
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 350ms cubic-bezier(0.4,0,0.2,1);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --surface:      #0f172a;
  --surface-2:    #1e293b;
  --surface-3:    #334155;
  --border:       #334155;
  --border-light: #1e293b;
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --brand-light:  #0c2f49;
  --shadow:     0 4px 16px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.2);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--surface-2);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Navigation ── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  height: 100%; padding: 0 20px;
  display: flex; align-items: center; gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  color: var(--brand); flex-shrink: 0;
  transition: opacity var(--transition);
}
.nav-logo:hover { opacity: 0.85; }
.nav-search {
  flex: 1; max-width: 440px;
}
.search-form {
  display: flex; align-items: center;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-full); padding: 0 16px; gap: 8px;
  transition: all var(--transition);
}
.search-form:focus-within {
  border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.search-form input {
  flex: 1; border: none; background: transparent;
  padding: 9px 0; font-size: 14px; outline: none;
  color: var(--text-primary);
}
.search-form input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
}
.nav-btn:hover { color: var(--text-primary); background: var(--surface-3); }
.icon-btn { padding: 8px; border-radius: var(--radius); position: relative; }
.create-btn {
  background: var(--brand); color: white !important;
  padding: 8px 16px; gap: 6px;
}
.create-btn:hover { background: var(--brand-dark) !important; transform: translateY(-1px); box-shadow: var(--shadow-brand); }
.login-btn { color: var(--text-secondary); }
.signup-btn { background: var(--brand); color: white !important; }
.signup-btn:hover { background: var(--brand-dark) !important; }
.avatar-btn { padding: 4px; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--surface);
}
.btn-label { font-size: 14px; }
@media (max-width: 768px) { .btn-label { display: none; } }

/* ── Dropdowns ── */
.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 1001;
  opacity: 0; transform: translateY(-8px) scale(0.97);
  pointer-events: none; transition: all var(--transition);
  overflow: hidden;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.dropdown-header {
  padding: 12px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; color: var(--text-secondary);
  transition: all var(--transition); cursor: pointer; width: 100%;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text-primary); }
.dropdown-item svg { opacity: 0.6; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.logout-item { color: var(--danger) !important; }
.logout-item svg { opacity: 1; }
.admin-link { color: var(--brand) !important; font-weight: 600; }
.categories-menu { min-width: 260px; max-height: 400px; overflow-y: auto; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.profile-menu-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: var(--surface-2);
}
.profile-menu-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.profile-menu-header strong { font-size: 14px; font-weight: 600; display: block; }
.profile-menu-header span { font-size: 13px; color: var(--text-muted); }
.mark-read-btn { font-size: 11px; color: var(--brand); font-weight: 500; cursor: pointer; background: none; border: none; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; transition: background var(--transition); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--brand-light); }
.notif-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-content p { font-size: 13px; line-height: 1.4; }
.notif-content time { font-size: 11px; color: var(--text-muted); }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.mobile-menu-btn { display: none; }
@media (max-width: 640px) {
  .mobile-menu-btn { display: flex; }
  .nav-search { display: none; }
  .nav-search.mobile-open { display: block; position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--border); z-index: 999; }
}

/* ── Flash Messages ── */
.flash-container { position: fixed; top: calc(var(--nav-h) + 16px); right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.flash-message {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideInRight 0.3s ease;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: var(--brand-light); color: var(--brand); border: 1px solid #bae6fd; }
.flash-icon { font-size: 16px; }
.flash-close { margin-left: auto; opacity: 0.6; font-size: 18px; line-height: 1; }
.flash-close:hover { opacity: 1; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Layout ── */
.main-content { min-height: calc(100vh - var(--nav-h)); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.page-wrapper { padding: 32px 0; }

/* ── Feed Layout ── */
.feed-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px; max-width: 1280px; margin: 0 auto; padding: 28px 20px;
}
@media (max-width: 1024px) { .feed-layout { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.sidebar { position: sticky; top: calc(var(--nav-h) + 20px); height: fit-content; }
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.sidebar-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 14px; }
.sidebar-cats { display: flex; flex-direction: column; gap: 2px; }
.sidebar-cat {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius); font-size: 14px;
  color: var(--text-secondary); transition: all var(--transition);
}
.sidebar-cat:hover, .sidebar-cat.active { background: var(--brand-light); color: var(--brand); }
.sidebar-cat.active { font-weight: 600; }
@media (max-width: 1024px) { .sidebar { display: none; } }

/* ── Masonry Feed ── */
.feed-controls {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  flex-wrap: wrap;
}
.feed-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; flex: 1; }
.view-toggle { display: flex; gap: 4px; background: var(--surface-3); border-radius: var(--radius); padding: 3px; }
.view-btn { padding: 6px 10px; border-radius: 8px; color: var(--text-muted); transition: all var(--transition); }
.view-btn.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.sort-select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-primary); font-size: 14px;
  cursor: pointer; outline: none;
}
.sort-select:focus { border-color: var(--brand); }

/* Pinterest Masonry Grid */
.masonry-grid {
  columns: 4 220px; column-gap: 16px;
}
.masonry-grid .post-card { break-inside: avoid; margin-bottom: 16px; }

/* List Feed */
.list-feed { display: flex; flex-direction: column; gap: 16px; }

/* ── Post Card ── */
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition); cursor: pointer;
  position: relative;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: transparent; }
.post-card-img { position: relative; overflow: hidden; }
.post-card-img img {
  width: 100%; object-fit: cover; display: block;
  transition: transform var(--transition-slow);
}
.post-card:hover .post-card-img img { transform: scale(1.03); }
.post-card-img-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--transition); display: flex; align-items: flex-end; padding: 12px;
}
.post-card:hover .post-card-img-overlay { opacity: 1; }
.post-card-overlay-actions { display: flex; gap: 8px; }
.overlay-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: white;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3); transition: all var(--transition);
}
.overlay-btn:hover { background: rgba(255,255,255,0.35); }
.overlay-btn.liked { background: rgba(239,68,68,0.8); border-color: transparent; }
.overlay-btn.saved { background: rgba(3,115,185,0.8); border-color: transparent; }
.post-card-body { padding: 14px; }
.post-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-author-link { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.post-author-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-author-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.post-category-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--text-secondary); margin-bottom: 6px;
}
.post-title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--border-light);
}
.post-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-muted); transition: color var(--transition);
  background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: var(--radius);
}
.post-stat:hover { color: var(--text-primary); background: var(--surface-2); }
.post-stat.liked { color: #ef4444; }
.post-stat.saved { color: var(--brand); }
.post-stat svg { flex-shrink: 0; }
.post-share-btn { margin-left: auto; }

/* Text-only post card */
.post-card.text-post .post-card-body { padding: 20px; }
.text-post-type {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand); margin-bottom: 8px; display: flex; align-items: center; gap: 4px;
}
.text-post .post-title { font-size: 17px; -webkit-line-clamp: 3; }
.text-post .post-excerpt { -webkit-line-clamp: 4; }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.post-tag {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-muted); font-weight: 500;
}
.post-tag:hover { background: var(--brand-light); color: var(--brand); }

/* ── Post Detail Page ── */
.post-detail-layout {
  max-width: 1100px; margin: 0 auto; padding: 32px 20px;
  display: grid; grid-template-columns: 1fr 340px; gap: 32px;
}
@media (max-width: 900px) { .post-detail-layout { grid-template-columns: 1fr; } }
.post-detail-main { min-width: 0; }
.post-detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 24px;
}
.post-detail-hero img { width: 100%; max-height: 520px; object-fit: cover; }
.post-detail-content { padding: 28px; }
.post-detail-header { margin-bottom: 20px; }
.post-detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 12px;
}
@media (max-width: 640px) { .post-detail-title { font-size: 22px; } }
.post-detail-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.author-info { display: flex; align-items: center; gap: 10px; }
.author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.author-name { font-weight: 600; font-size: 15px; }
.author-username { font-size: 13px; color: var(--text-muted); }
.post-detail-date { font-size: 13px; color: var(--text-muted); }
.post-detail-body { font-size: 16px; line-height: 1.8; color: var(--text-secondary); }
.post-detail-body p { margin-bottom: 16px; }
.post-detail-actions {
  display: flex; align-items: center; gap: 10px; padding: 20px 28px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 500; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  transition: all var(--transition);
}
.action-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.action-btn.like-btn.liked { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.action-btn.save-btn.saved { background: var(--brand-light); border-color: #bae6fd; color: var(--brand); }
.action-btn .count { font-weight: 700; }
.share-group { display: flex; gap: 8px; margin-left: auto; }
.share-btn-sm {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
  transition: all var(--transition);
}
.share-btn-sm:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }

/* ── Comments ── */
.comments-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-size: 14px; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: var(--radius-full); font-weight: 500; }
.comment-form { display: flex; gap: 12px; margin-bottom: 24px; }
.comment-form-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-form-inner { flex: 1; }
.comment-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2); resize: none;
  font-size: 14px; line-height: 1.5; color: var(--text-primary); min-height: 44px;
  transition: all var(--transition); outline: none;
}
.comment-textarea:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-glow); min-height: 80px; }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; gap: 8px; }
.comment-item { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-bubble { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-username { font-size: 14px; font-weight: 600; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.6; color: var(--text-secondary); background: var(--surface-2); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) var(--radius); }
.comment-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-action { font-size: 12px; color: var(--text-muted); background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: color var(--transition); }
.comment-action:hover { color: var(--brand); }
.comment-action.liked { color: #ef4444; }
.replies-list { margin-left: 48px; margin-top: 12px; border-left: 2px solid var(--border); padding-left: 16px; }

/* ── Related Posts Sidebar ── */
.related-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition);
}
.related-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.related-card img { width: 100%; height: 140px; object-fit: cover; }
.related-card-body { padding: 12px; }
.related-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.related-card-meta { font-size: 12px; color: var(--text-muted); }
.related-grid { display: flex; flex-direction: column; gap: 12px; }

/* ── Author Card ── */
.author-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; text-align: center; margin-bottom: 16px;
}
.author-card-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--border); }
.author-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.author-card-username { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.author-card-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.author-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 14px; }
.author-stat span { display: block; }
.author-stat .stat-num { font-size: 18px; font-weight: 700; }
.author-stat .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Profile Page ── */
.profile-cover {
  height: 220px; background: linear-gradient(135deg, var(--brand) 0%, #0ea5e9 50%, #7c3aed 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; position: relative;
}
.profile-header-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  overflow: hidden; margin-bottom: 24px; max-width: 900px; margin-left: auto; margin-right: auto;
}
.profile-info-section { padding: 0 32px 24px; display: flex; align-items: flex-end; gap: 20px; margin-top: -40px; flex-wrap: wrap; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-details { flex: 1; min-width: 0; padding-bottom: 8px; }
.profile-username { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; }
.profile-handle { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.profile-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.5; max-width: 480px; }
.profile-stats { display: flex; gap: 24px; margin-top: 12px; }
.profile-stat .stat-num { font-size: 20px; font-weight: 700; }
.profile-stat .stat-label { font-size: 12px; color: var(--text-muted); }
.profile-actions { margin-left: auto; display: flex; gap: 8px; padding-bottom: 8px; flex-shrink: 0; }

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--surface-2) 0%, var(--brand-light) 100%); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--brand); margin-bottom: 28px; justify-content: center; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--brand); font-weight: 600; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text-primary);
  font-size: 14px; outline: none; transition: all var(--transition);
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { cursor: pointer; }
.form-errors-list { background: #fee2e2; border: 1px solid #fecaca; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.form-errors-list li { font-size: 13px; color: #991b1b; list-style: none; padding: 2px 0; }
.form-errors-list li::before { content: '• '; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-full); font-size: 14px; font-weight: 600;
  transition: all var(--transition); cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-brand); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-loading { position: relative; pointer-events: none; }
.btn-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Create Post Page ── */
.create-page { max-width: 760px; margin: 0 auto; padding: 32px 20px; }
.create-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.create-header { padding: 24px 28px 0; border-bottom: 1px solid var(--border); }
.create-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.post-type-tabs { display: flex; gap: 0; }
.post-type-tab {
  flex: 1; padding: 12px; font-size: 14px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; transition: all var(--transition); text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.post-type-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.create-body { padding: 28px; }
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--brand); background: var(--brand-light); }
.upload-zone svg { margin: 0 auto 12px; color: var(--text-muted); }
.upload-zone p { font-size: 14px; color: var(--text-secondary); }
.upload-zone strong { color: var(--brand); }
.upload-preview { position: relative; display: inline-block; margin-top: 12px; }
.upload-preview img { max-height: 300px; border-radius: var(--radius); }
.upload-preview-remove {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  background: rgba(0,0,0,0.7); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer;
}
.tags-input-wrap { position: relative; }
.tags-container { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1.5px solid var(--border); border-radius: var(--radius); min-height: 44px; background: var(--surface); cursor: text; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-light); color: var(--brand); padding: 3px 8px;
  border-radius: var(--radius-full); font-size: 13px; font-weight: 500;
}
.tag-chip button { background: none; border: none; color: var(--brand); font-size: 14px; line-height: 1; cursor: pointer; }
.tags-input { border: none; outline: none; font-size: 14px; background: transparent; min-width: 120px; flex: 1; color: var(--text-primary); }

/* ── Admin Panel ── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--nav-h)); }
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 0; position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.admin-sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 8px 20px; margin-bottom: 4px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  font-size: 14px; color: var(--text-secondary); transition: all var(--transition); position: relative;
}
.admin-nav-item:hover, .admin-nav-item.active { background: var(--surface-2); color: var(--text-primary); }
.admin-nav-item.active { color: var(--brand); font-weight: 600; }
.admin-nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); border-radius: 0 2px 2px 0; }
.admin-badge { margin-left: auto; background: var(--danger); color: white; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); }
.admin-main { padding: 28px; overflow-x: auto; }
.admin-page-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.data-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { padding: 5px 12px; font-size: 12px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
}
.badge-pending { background: #fffbeb; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-banned { background: #fee2e2; color: #991b1b; }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.table-post-thumb { width: 52px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; padding: 24px 0; }
.page-btn {
  min-width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--surface); transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.search-bar .form-input { max-width: 300px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-xl); padding: 28px; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Trending Section ── */
.trending-section { padding: 40px 0; }
.trending-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.trending-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; }
.trending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ── Saved Page ── */
.saved-layout { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

/* ── Settings ── */
.settings-layout { max-width: 800px; margin: 0 auto; padding: 32px 20px; display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
@media (max-width: 640px) { .settings-layout { grid-template-columns: 1fr; } }
.settings-nav { position: sticky; top: calc(var(--nav-h) + 20px); height: fit-content; }
.settings-nav-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: var(--radius); font-size: 14px; color: var(--text-secondary);
  transition: all var(--transition); cursor: pointer; width: 100%;
}
.settings-nav-item:hover, .settings-nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.settings-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; }
.settings-section-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.avatar-upload-section { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
.avatar-upload-btn { display: none; }
.avatar-upload-label { padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-full); font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--transition); }
.avatar-upload-label:hover { border-color: var(--brand); color: var(--brand); }

/* ── Empty States ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin: 0 auto 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.6; max-width: 320px; margin: 0 auto 20px; }

/* ── Loading / Skeleton ── */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 20px auto; }
.load-more-trigger { height: 60px; display: flex; align-items: center; justify-content: center; }

/* ── Tooltips ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text-primary); color: var(--surface); font-size: 12px; white-space: nowrap; padding: 4px 8px; border-radius: var(--radius-sm); pointer-events: none; opacity: 0; transition: opacity var(--transition); z-index: 100; }
[data-tooltip]:hover::after { opacity: 1; }

/* ── Search Results ── */
.search-page { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.search-header { margin-bottom: 28px; }
.search-query { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.search-meta { font-size: 14px; color: var(--text-muted); }
.search-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--surface-3); border-radius: var(--radius-lg); width: fit-content; }
.search-tab { padding: 8px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: all var(--transition); }
.search-tab.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 60px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700; color: var(--brand); }
.footer-links { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; }
.footer-links a { font-size: 14px; color: var(--text-secondary); transition: color var(--transition); }
.footer-links a:hover { color: var(--brand); }
.footer-copy { font-size: 13px; color: var(--text-muted); margin-left: auto; }
@media (max-width: 640px) { .footer-inner { flex-direction: column; align-items: flex-start; } .footer-copy { margin-left: 0; } }

/* ── Copy Link Popup ── */
.copy-popup {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--surface); padding: 10px 20px;
  border-radius: var(--radius-full); font-size: 14px; font-weight: 500; z-index: 9999;
  opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
.copy-popup.show { opacity: 1; }

/* ── Pending Post Banner ── */
.pending-banner {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-lg);
  padding: 14px 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #92400e;
}
.rejected-banner { background: #fee2e2; border-color: #fecaca; color: #991b1b; }

/* ── Responsive Tweaks ── */
@media (max-width: 1200px) { .masonry-grid { columns: 3 200px; } }
@media (max-width: 900px) { .masonry-grid { columns: 2 180px; } }
@media (max-width: 480px) { .masonry-grid { columns: 1; } .feed-layout { padding: 16px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
