/* ================================
   VeraForum - Main Styles
   Matte Green Slate Theme
   ================================ */

/* CSS Variables */
:root {
  /* Fonts */
  --font-body: 'Golos Text', 'Segoe UI', sans-serif;
  --font-display: 'Golos Display', 'Golos Text', sans-serif;

  /* Primary colors - Matte green slate */
  --primary: #2F5C4C;
  --primary-dark: #223F34;
  --primary-light: #4B7B69;
  --primary-lighter: #6A9A88;
  --primary-bg: rgba(47, 92, 76, 0.12);

  /* Accent */
  --accent: #5C8B79;
  --accent-light: #7EAF9C;

  /* Backgrounds */
  --bg-main: #F1F3F1;
  --bg-card: #FAFBFA;
  --bg-dark: #1E2522;
  --bg-input: #F5F7F5;

  /* Text */
  --text-primary: #1B2420;
  --text-secondary: #4F5D57;
  --text-muted: #76837C;
  --text-inverse: #F7FAF9;

  /* Borders */
  --border: #DCE2DE;
  --border-light: #EBEFEC;
  --border-focus: var(--primary);

  /* Status colors */
  --success: #2E8B6D;
  --error: #C84C4C;
  --warning: #C79243;
  --info: #3E6F9D;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 31, 26, 0.08);
  --shadow: 0 4px 10px rgba(20, 31, 26, 0.12);
  --shadow-md: 0 12px 24px -14px rgba(20, 31, 26, 0.35);
  --shadow-lg: 0 20px 40px -26px rgba(20, 31, 26, 0.45);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Border radius */
  --radius-sm: 0.2rem;
  --radius: 0.4rem;
  --radius-md: 0.55rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 300px;
  --container-max: 1280px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(1200px 520px at 10% -10%, rgba(92, 139, 121, 0.18), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(47, 92, 76, 0.14), transparent 55%);
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(92, 139, 121, 0.28);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6,
.logo,
.section-title,
.card-title,
.page-title,
.welcome-title,
.auth-title,
.error-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-banner,
.topics-list,
.sidebar-card,
.card,
.category,
.topics-container,
.post,
.auth-card,
.error-content {
  animation: rise-in 420ms ease-out both;
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ================================
   Header
   ================================ */
.header {
  background: rgba(250, 251, 250, 0.92);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

/* Logo */
.logo {
  display: flex;
  flex-direction: column;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.1;
}

.logo:hover {
  color: var(--text-primary);
}

.logo-accent {
  color: var(--primary);
}

.logo-subtitle {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Search */
.search-wrapper {
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-input {
  width: 200px;
  padding: var(--space-2) var(--space-3);
  padding-right: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 0.875rem;
  transition: width var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg), var(--shadow-sm);
  width: 280px;
}

.search-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--space-1);
}

.search-button svg {
  width: 18px;
  height: 18px;
}

/* Online counter */
.online-counter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, #2E8B6D, #255D4A);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Notifications */
.notifications-wrapper {
  position: relative;
}

.notifications-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.notifications-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.notifications-btn svg {
  width: 22px;
  height: 22px;
}

.notifications-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--error);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
}

.notifications-dropdown.show {
  display: block;
}

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

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
}

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

.notifications-empty,
.notifications-loading {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
}

.notifications-list .notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

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

.notifications-list .notification-item.unread {
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
}

.notifications-list .notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}

.notifications-list .notification-icon svg {
  width: 16px;
  height: 16px;
}

.notifications-list .notification-icon.reply,
.notifications-list .notification-icon.topic_reply {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.notifications-list .notification-icon.mention {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.notifications-list .notification-icon.like {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.notifications-list .notification-icon.follow {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.notifications-list .notification-icon.achievement {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.notifications-list .notification-icon.message {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.notifications-list .notification-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.notifications-list .notification-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.notifications-list .notification-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notifications-list .notification-text {
  flex: 1;
  min-width: 0;
}

.notifications-list .notification-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.notifications-list .notification-message {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notifications-list .notification-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notifications-view-all {
  display: block;
  padding: 12px;
  text-align: center;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid var(--border);
}

.notifications-view-all:hover {
  background: var(--bg-input);
}

/* User menu */
.user-menu-wrapper {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: none;
  border: none;
  border-radius: var(--radius);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-menu-btn:hover {
  background: var(--bg-input);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.user-menu-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
}

.user-dropdown.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  color: var(--text-primary);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background var(--transition-fast);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

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

.dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.dropdown-item-admin {
  color: var(--primary);
}

.dropdown-item-admin svg {
  color: var(--primary);
}

.dropdown-item-danger {
  color: var(--error);
}

.dropdown-item-danger svg {
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

.dropdown-form {
  margin: 0;
}

/* Auth buttons */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-primary);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.mobile-nav {
  display: none;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4);
}

.mobile-nav.show {
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  padding: var(--space-3);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: var(--radius);
}

.mobile-nav-link.active {
  background: var(--primary-bg);
  color: var(--primary);
}

.mobile-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .nav,
  .search-wrapper,
  .auth-buttons {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

/* ================================
   Flash Messages
   ================================ */
.flash-messages {
  padding: var(--space-4) 0;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.flash-success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.flash-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.flash-info {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.flash-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.7;
  cursor: pointer;
}

.flash-close:hover {
  opacity: 1;
}

/* ================================
   Main Content
   ================================ */
.main-content {
  flex: 1;
  padding: var(--space-6) 0;
}

/* ================================
   Buttons
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 16px -12px rgba(34, 63, 52, 0.7);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ================================
   Home Layout
   ================================ */
.home-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-6);
}

.home-main {
  min-width: 0;
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #2F5C4C 0%, #1F3C32 100%);
  color: white;
  padding: var(--space-10);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 140%;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.welcome-content {
  position: relative;
  z-index: 1;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.welcome-title .accent {
  color: var(--accent-light);
}

.welcome-text {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: var(--space-6);
  max-width: 600px;
}

.welcome-actions {
  display: flex;
  gap: var(--space-3);
}

.welcome-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.welcome-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Sections */
.section {
  margin-bottom: var(--space-6);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.section-link {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Topics List */
.topics-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.topic-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

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

.topic-item:hover {
  background: var(--bg-input);
  transform: translateY(-1px);
}

.topic-pinned {
  background: var(--primary-bg);
}

.topic-pinned:hover {
  background: rgba(47, 92, 76, 0.18);
}

.topic-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary);
  box-shadow: 0 4px 8px -6px rgba(20, 31, 26, 0.35);
}

.topic-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.topic-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.badge-pinned {
  background: var(--primary);
  color: white;
}

.topic-title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-title:hover {
  color: var(--primary);
}

.topic-category {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.topic-author {
  color: var(--text-secondary);
}

.topic-author:hover {
  color: var(--primary);
}

.topic-stats {
  display: flex;
  gap: var(--space-4);
  flex-shrink: 0;
}

.topic-stats .stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Sidebar Cards */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stat-box {
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.online-value {
  color: var(--success);
}

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

.newest-user {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Online Users */
.online-users {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.online-user {
  font-size: 0.875rem;
  color: var(--primary);
}

.online-user:not(:last-child)::after {
  content: ',';
  color: var(--text-muted);
}

.online-more {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.online-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Quick Links */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.quick-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.quick-link:hover {
  background: var(--primary-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.quick-link svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

/* ================================
   Footer
   ================================ */
.footer {
  background: linear-gradient(180deg, #1E2522 0%, #141A18 100%);
  color: var(--text-inverse);
  padding: var(--space-12) 0 var(--space-6);
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.footer-description {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: white;
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: var(--primary);
  color: white;
}

.social-link svg {
  width: 20px;
  height: 20px;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: white;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
}

.footer-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-stats .stat-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.footer-stats .stat-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.footer-stats .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .footer-section:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Forms
   ================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 1rem;
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(15, 23, 19, 0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg), var(--shadow-sm);
}

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

.form-help {
  margin-top: var(--space-1);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-error {
  margin-top: var(--space-1);
  font-size: 0.875rem;
  color: var(--error);
}

/* ================================
   Cards
   ================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ================================
   Utilities
   ================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* ================================
   Custom Emoji Styles
   ================================ */
.custom-emoji {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 0.1em;
}

.custom-emoji.emoji-animated {
  /* GIF emojis retain animation */
}

/* Emoji Picker */
.emoji-picker-trigger {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 18px;
  transition: all 0.2s;
}

.emoji-picker-trigger:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.emoji-picker {
  position: absolute;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 320px;
  max-height: 400px;
  display: none;
}

.emoji-picker.active {
  display: block;
}

.emoji-picker-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

.emoji-picker-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-input);
}

.emoji-picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  padding: 0 8px;
}

.emoji-picker-tab {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.5;
  transition: opacity 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.emoji-picker-tab:hover,
.emoji-picker-tab.active {
  opacity: 1;
}

.emoji-picker-tab.active {
  border-bottom-color: var(--primary);
}

.emoji-picker-content {
  padding: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.emoji-picker-category {
  margin-bottom: 12px;
}

.emoji-picker-category-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 4px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-picker-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-size: 22px;
}

.emoji-picker-item:hover {
  background: var(--primary-bg);
}

.emoji-picker-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.emoji-picker-custom-grid {
  grid-template-columns: repeat(6, 1fr);
}

.emoji-picker-custom-grid .emoji-picker-item {
  width: 48px;
  height: 48px;
}

.emoji-picker-custom-grid .emoji-picker-item img {
  width: 32px;
  height: 32px;
}
