:root{
  --bg: #f7f7fb;
  --bg-elev: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-hover: #f9fafb;
  --text: #0b1220;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-color: #e5e7eb;
  --accent: #2563eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --card-radius: 12px;
  --chip-radius: 999px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --ff: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}

@media (prefers-color-scheme: dark){
  :root{ 
    --bg:#0b0f17; 
    --bg-elev:#111827; 
    --bg-primary:#1f2937;
    --bg-secondary:#111827;
    --bg-hover:#374151;
    --text:#e5e7eb; 
    --text-primary:#f9fafb;
    --text-secondary:#d1d5db;
    --text-muted:#9ca3af;
    --muted:#9ca3af; 
    --border:#1f2937; 
    --border-color:#374151;
    --shadow: 0 8px 28px rgba(0,0,0,0.35);
  }  
}

[data-theme="dark"]{ 
  --bg:#0b0f17; 
  --bg-elev:#111827; 
  --bg-primary:#1f2937;
  --bg-secondary:#111827;
  --bg-hover:#374151;
  --text:#e5e7eb; 
  --text-primary:#f9fafb;
  --text-secondary:#d1d5db;
  --text-muted:#9ca3af;
  --muted:#9ca3af; 
  --border:#1f2937; 
  --border-color:#374151;
  --shadow: 0 8px 28px rgba(0,0,0,0.35);
}

html,body{ background:var(--bg); color:var(--text); font-family:var(--ff); }

/* Modern Post Card - Simple Design */
.post-card-modern {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card-modern:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* Post Card Header */
.post-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-card-author-info {
  flex: 1;
  min-width: 0;
}

.post-card-author-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.post-card-author-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-author-name:hover {
  color: var(--primary);
  text-decoration: none;
}

.post-card-time {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-card-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0 0;
  padding: 0.4rem 0.8rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  width: fit-content;
  border-left: 3px solid var(--border);
}

.post-card-category-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.post-card-category-badge i {
  font-size: 0.9em;
  opacity: 0.9;
}

.post-card-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Post Title */
.post-card-title {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--primary);
}

/* Post Excerpt */
.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

/* Post Tags */
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-card-tag.category-chip {
  color: #050505; /* black text for category chip */
}

[data-theme="dark"] .post-card-tag.category-chip {
  color: var(--text-primary);
}

.post-card-tag.category-chip .category-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
}

.post-card-tag:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* Post Footer */
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.post-card-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.post-stat-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  position: relative;
  overflow: visible;
}

.post-stat-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Like (heart) animation */
.upvote-btn i {
  transition: transform 0.2s ease, color 0.2s ease;
}

.upvote-btn.active i,
.upvote-btn .ri-heart-fill {
  color: #e0245e; /* Twitter-like red */
}

.upvote-btn.like-animate i {
  animation: heart-pop 0.6s ease forwards;
}

@keyframes heart-pop {
  0% { transform: scale(0.6); }
  40% { transform: scale(1.25); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Subtle ripple burst */
.upvote-btn.like-animate::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(224, 36, 94, 0.25);
  transform: translate(-50%, -50%);
  animation: heart-ripple 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes heart-ripple {
  from { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(4); }
}

.post-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-card-actions .post-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #050505; /* Facebook-like black */
  font-weight: 500;
  text-decoration: none;
  padding: 0.375rem 0.5rem; /* slightly taller for touch */
  border-radius: 6px;
  line-height: 1;
}

.post-card-actions .post-action-link i { color: inherit; }

.post-card-actions .post-action-link:hover,
.post-card-actions .post-action-link:focus {
  background: #f2f2f2; /* Facebook hover */
  text-decoration: none;
}

[data-theme="dark"] .post-card-actions .post-action-link {
  color: var(--text-primary);
}

[data-theme="dark"] .post-card-actions .post-action-link:hover,
[data-theme="dark"] .post-card-actions .post-action-link:focus {
  background: rgba(255,255,255,0.08);
}

.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.post-action-btn:hover {
  background: var(--bg-hover);
}

.post-action-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.post-action-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
}

/* Follow Button */
.follow-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  color: var(--accent);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  margin-left: 8px;
}

.follow-user-btn:hover {
  background: #95a0ff3a;
  color: #2563eb;
}

/* Status Badges */
.post-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.badge-solved {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-unsolved {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

/* Post Options Dropdown */
.post-options-dropdown {
  position: relative;
}

.post-options-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-options-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.post-options-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 100;
  padding: 0.5rem 0;
}

.post-options-menu.show {
  display: block;
}

.post-option-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
}

.post-option-item:hover {
  background: var(--bg-hover);
}

/* Beta Badge */
.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #fff;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Feed Controls */
.feed-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-elev);
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 56px;
  z-index: 11;
}

.feed-controls .tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn {
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-btn[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.filter-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.feed-filter-select {
  padding: 6px 28px 6px 10px;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

/* Header Styles */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
}

.header-nav {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.25rem;
}

.header-logo-img {
  height: 32px;
  width: auto;
}

/* Center Group: Search + Ask Lex */
.header-center-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  max-width: 850px;
  margin: 0 1.5rem;
}

.header-search-container {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid transparent;
  border-radius: 50px;
  height: 44px;
  padding: 0 1.25rem 0 3rem;
  transition: all 0.2s ease;
  width: 100%;
}

[data-theme="dark"] .search-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05);
}

.search-input-wrapper:focus-within {
  background-color: var(--bg-elev);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-icon {
  position: absolute;
  left: 1.125rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Live Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 2000;
  max-height: 500px;
  overflow-y: auto;
}

.search-results-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-results-loading .rotating {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-section-title {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.search-result-item {
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.search-result-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.125rem 0 0 0;
}

.search-no-results {
  padding: 2rem 1.5rem;
  text-align: center;
}

.search-no-results-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.search-no-results-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.search-no-results-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
}

.search-ai-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.search-ai-prompt:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  text-decoration: none;
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Ensure notification bell matches icon button styling */
.header-notification-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.header-notification-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Notifications Dropdown Styles */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 60px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  min-width: 380px;
  max-height: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mark-all-read {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mark-all-read:hover {
  background: rgba(37, 99, 235, 0.1);
}

.notifications-list {
  overflow-y: auto;
  max-height: 400px;
  padding: 0;
}

.notification-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item.unread {
  background: rgba(37, 99, 235, 0.05);
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notification-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty i {
  font-size: 3rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 1rem;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.header-icon-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.header-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn-create:hover {
  background-color: var(--bg-hover);
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.header-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.header-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.header-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.header-btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 50px;
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="dark"] .header-btn-ai {
  background-color: rgba(255, 255, 255, 0.05);
}

.header-btn-ai:hover {
  background-color: var(--bg-elev);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-btn-ai i {
  font-size: 1.125rem;
  color: var(--accent);
}

.header-user-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0 4px;
}

.notification-dropdown,
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  min-width: 256px;
}

.user-dropdown-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
  text-decoration: none;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.5rem 0;
}

/* Layout */
.layout-3col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  padding: 1rem;
  margin-left: 260px;
  max-width: 100%;
}

.center-col {
  min-width: 0;
  max-width: 100%;
}

.right-col {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

@media (max-width: 1199.98px) {
  .layout-3col {
    grid-template-columns: 1fr;
  }
  .right-col {
    display: none;
  }
}

@media (max-width: 1024px) {
  .layout-3col {
    margin-left: 0;
  }
}

/* Sidebar */
.modern-sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 56px;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-content {
  padding: 0;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin: 0;
}

.nav-item.active .nav-link {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0 0.5rem;
  cursor: pointer;
}

.nav-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-text {
  font-size: 0.875rem;
  font-weight: 400;
  flex: 1;
}

/* Create New Post Button in Nav */
.nav-item-create {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.nav-link-create {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  font-weight: 500;
}

.nav-link-create:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63398d 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  color: white !important;
}

.nav-icon-create {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 1.25rem;
}

.sidebar-section {
  margin: 0.5rem 0;
}

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 0.5rem;
}

.section-header:hover {
  background-color: var(--bg-hover);
}

.section-header-static {
  padding: 0.75rem 1rem;
  margin: 0 0.5rem;
}

.section-title {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-icon {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.section-header.collapsed .section-icon {
  transform: rotate(-90deg);
}

.section-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.section-content.collapsed {
  max-height: 0;
}

.section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-item {
  margin: 0;
}

.section-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0 0.5rem;
}

.section-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.section-icon-wrapper {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.section-text {
  font-size: 0.875rem;
  font-weight: 400;
  flex: 1;
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  margin-left: auto;
  min-width: 24px;
  text-align: center;
}

.section-link:hover .category-count {
  background: var(--bg-elev);
  color: var(--text-primary);
}

/* Active category state */
.section-link.active {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.section-link.active .section-icon-wrapper {
  color: var(--accent);
}

.section-link.active .category-count {
  background: var(--accent);
  color: white;
}

/* Create New Post Button */
.section-item-create {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Settings Page Layout */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

@media (max-width: 900px){
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.settings-sidebar { position: sticky; top: 76px; height: fit-content; align-self: start; }
.settings-side-title { margin: 16px 16px 8px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.settings-nav { display:flex; flex-direction: column; padding: 8px; }
.settings-nav a { padding:10px 12px; border-radius:8px; color: var(--text-primary); text-decoration:none; display:flex; justify-content:space-between; align-items:center; }
.settings-nav a:hover { background: #eef2ff; }
[data-theme="dark"] .settings-nav a:hover { background: rgba(99,102,241,0.15); }
.settings-nav a[aria-current="page"]{ background:#e0e7ff; color:#111; }
[data-theme="dark"] .settings-nav a[aria-current="page"]{ background: rgba(99,102,241,0.25); color: var(--text-primary); }

.settings-panel { padding: 20px 20px 8px; }
.settings-panel h2 { margin: 0 0 16px; font-size: 20px; }
.settings-row { padding: 16px 0; border-top: 1px solid var(--border-color); display:grid; grid-template-columns: 280px 1fr; gap:18px; align-items:start; }
.settings-row:first-of-type { border-top: 0; }
@media (max-width: 700px){ .settings-row { grid-template-columns: 1fr; } }
.settings-row h4 { margin: 4px 0 4px; font-size: 15px; }
.settings-desc { color: var(--text-muted); font-size: 13px; }
.settings-field { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.settings-field input[type="text"],
.settings-field input[type="email"],
.settings-field input[type="password"],
.settings-field input[type="url"],
.settings-field select,
.settings-field textarea {
  width: min(560px,100%);
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
}
[data-theme="dark"] .settings-field input[type],
[data-theme="dark"] .settings-field textarea,
[data-theme="dark"] .settings-field select { background: var(--bg-primary); color: var(--text-primary); }

.settings-note { font-size:12px; color: var(--text-muted); }
.settings-actions { display:flex; gap:10px; flex-wrap:wrap; padding: 8px 0; }
.settings-btn { padding:10px 14px; border:1px solid var(--border-color); border-radius:8px; background:#fff; cursor:pointer; }
.settings-btn-primary { background: var(--primary); border-color: var(--primary); color:#fff; }
.settings-btn-danger { background: #dc2626; border-color:#dc2626; color:#fff; }
[data-theme="dark"] .settings-btn { background: var(--bg-primary); color: var(--text-primary); }

.section-link-create {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  font-weight: 500;
}

.section-link-create:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63398d 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.section-icon-create {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 1.125rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1099;
}

@media (max-width: 1024px) {
  .modern-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1100;
  }
  .modern-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
}

/* Tags Slider */
.tags-slider-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0rem;
  background: none;
  border-radius: none;
  padding: 0rem 0rem 0.75rem 0rem;
  box-shadow: none;
  border: none;
}

.tags-slider-wrapper {
  flex: 1;
  overflow: hidden;
}

.tags-slider {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem 0;
}

.tags-slider::-webkit-scrollbar {
  display: none;
}

.tags-slider-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
}

.tags-slider-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tags-slider-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.tag-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.tag-chip.active:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.tag-chip.active .tag-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.tag-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-elev);
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
}

/* Tag Filter Indicator */
.tag-filter-indicator {
  margin: 1rem 0;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag-filter-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.tag-filter-content i {
  color: var(--primary);
  font-size: 1.125rem;
}

.tag-filter-content strong {
  color: var(--primary);
  font-weight: 600;
}

.tag-filter-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
  margin-left: auto;
}

.tag-filter-clear:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* Category Header */
.category-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.category-header-content {
  flex: 1;
}

.category-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.category-description {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.category-stats {
  display: flex;
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-item i {
  font-size: 1.125rem;
  color: var(--primary);
}

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

/* Profile Page */
.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat { text-align: center; }
.stat .num { font-weight: 700; color: var(--primary); }

/* Legacy simple post card bits used in profile lists */
.post-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.post-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-meta { color: var(--text-muted); font-size: 0.8125rem; }
.post-title a { color: var(--text-primary); text-decoration: none; }
.post-title a:hover { color: var(--primary); }

.widget {
  padding: 1rem;
}

.widget-header {
  margin-bottom: 1rem;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Leaderboard */
.leaderboard-header-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  margin: -1rem -1rem 0 -1rem;
}

.leaderboard-view-all {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
}

.leaderboard-body-modern {
  padding: 0.5rem 0;
  margin: 0 -1rem;
}

.leaderboard-item-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.leaderboard-item-modern:last-child {
  border-bottom: none;
}

.leaderboard-item-modern:hover {
  background: var(--bg-hover);
}

.leaderboard-avatar-modern {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.leaderboard-info-modern {
  flex: 1;
  min-width: 0;
}

.leaderboard-name-modern {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name-modern:hover {
  color: var(--primary);
  text-decoration: none;
}

.leaderboard-role-modern {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.leaderboard-points-modern {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Popular Posts */
.popular-posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.popular-post-item {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.popular-post-item:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  text-decoration: none;
}

.popular-post-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.popular-post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.banner-ad {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.banner-ad-img {
  width: 100%;
  height: auto;
  display: block;
}

.announce {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

/* Empty State */
.empty-state-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: #fff;
}

/* Post Images */
.post-card-image {
  margin: 1rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-card-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Modal */
.modal-card {
  border-radius: 12px;
}

/* Comment Editor */
.editor-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elev);
}

.editor-area {
  width: 100%;
  min-height: 120px;
  border: 0;
  padding: 1rem;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--ff);
  font-size: 0.9375rem;
  resize: vertical;
  outline: none;
}

.editor-area::placeholder {
  color: var(--text-muted);
}

.editor-area:focus {
  background: var(--bg-secondary);
}

/* Utilities */
.mb-3 {
  margin-bottom: 1rem;
}

.fw-semibold {
  font-weight: 600;
}

.text-muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.875rem;
}

.p-3 {
  padding: 1rem;
}

/* =====================================================
   Authentication Pages - Modern Design
   ===================================================== */

/* Auth Layout - Full Screen Centered */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative Background Elements */
.auth-layout::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-layout::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Auth Card - Main Container */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
  animation: authSlideIn 0.4s ease-out;
}

@keyframes authSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Title */
.auth-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  text-align: center;
}

/* Auth Subtitle */
.auth-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 2rem 0;
  text-align: center;
  line-height: 1.5;
}

/* Auth Alert */
.auth-alert {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  animation: authAlertSlide 0.3s ease-out;
}

@keyframes authAlertSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.auth-alert i {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-alert strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-alert ul {
  margin: 0.25rem 0 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.auth-alert li {
  margin-bottom: 0.25rem;
}

/* Auth Form */
.auth-form {
  margin-bottom: 1.5rem;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: var(--ff);
}

.auth-form-group input::placeholder {
  color: var(--text-muted);
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-form-group input:hover:not(:focus) {
  border-color: var(--border-color);
}

.auth-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* Auth Form Actions */
.auth-form-actions {
  margin-top: 1.5rem;
}

.auth-btn-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--ff);
  margin-bottom: 0.75rem;
}

.auth-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-btn-primary:active {
  transform: translateY(0);
}

.auth-link {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Auth Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 1rem;
  background: var(--bg-elev);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Auth Secondary Button */
.auth-btn-secondary {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.auth-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-btn-secondary:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 640px) {
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-subtitle {
    font-size: 0.875rem;
  }

  .auth-layout {
    padding: 1rem;
  }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .auth-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

[data-theme="dark"] .auth-btn-primary {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .auth-btn-primary:hover {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

/* =====================================================
   Rich Text Comment Content Styling
   ===================================================== */

.comment-content p {
  margin-bottom: 0.5rem;
}

.comment-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-content em {
  font-style: italic;
}

.comment-content u {
  text-decoration: underline;
}

.comment-content a {
  color: var(--accent);
  text-decoration: underline;
}

.comment-content a:hover {
  color: var(--primary-hover);
}

.comment-content ul,
.comment-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.comment-content ul {
  list-style: disc;
}

.comment-content ol {
  list-style: decimal;
}

.comment-content li {
  margin-bottom: 0.25rem;
}

.comment-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 0.75rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.comment-content code {
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}

.comment-content pre {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.comment-content pre code {
  background: transparent;
  padding: 0;
}

.comment-content h1,
.comment-content h2,
.comment-content h3 {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-content h1 {
  font-size: 1.5rem;
}

.comment-content h2 {
  font-size: 1.25rem;
}

.comment-content h3 {
  font-size: 1.125rem;
}

/* =====================================================
   Toast Notification System
   ===================================================== */

.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 500px;
  padding: 1rem 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification i:first-child {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-notification span {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success i:first-child {
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error i:first-child {
  color: #ef4444;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-info i:first-child {
  color: #3b82f6;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-warning i:first-child {
  color: #f59e0b;
}

@media (max-width: 640px) {
  .toast-notification {
    left: 20px;
    right: 20px;
    min-width: auto;
  }
}

/* =====================================================
   Notification Bell & Dropdown
   ===================================================== */

.header-notification-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-right: 0.5rem;
}

.header-notification-btn:hover {
  background: var(--bg-hover);
}

.header-notification-btn i {
  font-size: 1.25rem;
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.notification-dropdown,
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 380px;
  max-height: 520px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1100;
  display: none;
  overflow: hidden;
}

.notifications-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.mark-all-read {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.mark-all-read:hover {
  background: var(--bg-hover);
}

.notifications-list {
  max-height: 380px;
  overflow-y: auto;
}

.notifications-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}

.view-all-notifications {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.view-all-notifications:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--primary-hover);
}

.view-all-notifications i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.view-all-notifications:hover i {
  transform: translateX(3px);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item.unread {
  background: rgba(37, 99, 235, 0.05);
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-content p {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.notification-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.notification-post-title {
  display: block;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-time {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.notification-dot {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  transform: translateY(-50%);
}

.notification-empty,
.notification-loading {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Active states for interaction buttons */
.upvote-btn.active i,
.bookmark-btn.active i {
  color: var(--accent);
}

.upvote-btn.active {
  background: rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
  .notifications-dropdown {
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* ===================================
   Breadcrumb Navigation
   =================================== */
.breadcrumb-nav {
  margin-bottom: 1.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-radius: var(--card-radius);
  list-style: none;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  color: var(--border);
  margin-left: 0.5rem;
}

.breadcrumb-item a {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--accent);
}

.breadcrumb-item a i {
  font-size: 1rem;
}

.breadcrumb-item.active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item.active span:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-category-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9375rem;
}

.breadcrumb-count {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border-radius: var(--chip-radius);
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .header-center-group {
    margin: 0 0.5rem;
    gap: 0.5rem;
  }
  
  .header-btn-ai .btn-text {
    display: none;
  }
  
  .breadcrumb {
    padding: 0;
    font-size: 0.8125rem;
  }
  
  .breadcrumb-item a span {
    display: none;
  }
}
