/* ===================================================================
   PROS 4 U - MODERN AI THEME (BLACK & GOLD LUXURY PALETTE)
   =================================================================== */

:root {
  --bg-black: #060608;
  --bg-deep: #0a0a0f;
  --bg-surface: #101017;
  --bg-card: #14141e;
  --bg-card-hover: #1a1a26;
  --bg-glass: rgba(16, 16, 23, 0.82);
  --bg-glass-strong: rgba(10, 10, 15, 0.94);
  
  --gold-primary: #FFD700;
  --gold-light: #FFF2A8;
  --gold-warm: #E6B800;
  --gold-dark: #A67C00;
  --gold-bronze: #855C00;
  
  --gold-gradient: linear-gradient(135deg, #FFF3B0 0%, #FFD700 35%, #D4AF37 75%, #AA771C 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
  --gold-border-gradient: linear-gradient(135deg, rgba(255, 215, 0, 0.5), rgba(212, 175, 55, 0.15), rgba(255, 215, 0, 0.4));
  
  --border-subtle: rgba(255, 215, 0, 0.14);
  --border-gold: rgba(255, 215, 0, 0.32);
  --border-gold-bright: rgba(255, 215, 0, 0.75);
  
  --gold-glow-sm: 0 0 12px rgba(255, 215, 0, 0.2);
  --gold-glow: 0 0 24px rgba(255, 215, 0, 0.28);
  --gold-glow-lg: 0 0 50px rgba(255, 215, 0, 0.38);
  
  --text-main: #F3F3F7;
  --text-dim: #A8A8BD;
  --text-muted: #6E6E85;
  --text-gold: #FFD700;
  
  --ai-cyan: #00F0FF;
  --success: #10B981;
  --danger: #EF4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-sans: 'Source Sans Pro', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Righteous', cursive, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.65);
}

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

body {
  background-color: var(--bg-black);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Neural Grid Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 90% 40%, rgba(220, 160, 40, 0.04) 0%, transparent 40%),
    linear-gradient(rgba(255, 215, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Base Links & Typography */
a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

h1, h2, h3, h4, h5, h6,
.logo-title,
.hero-title,
.sidebar-title,
.widget-title,
.thread-title,
.detail-title,
.cat-name,
.tool-name,
.modal-title,
.stat-value {
  font-family: var(--font-heading);
  color: var(--text-main);
  letter-spacing: 0.03em;
}

.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ===================================================================
   HEADER & NAVBAR
   =================================================================== */

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: 72px;
  z-index: 1000;
  background: #0b0b12;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border-gold);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo-area:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.logo-animated-img,
.logo-img {
  height: 54px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  contain: layout paint;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1c1808 0%, #2e2609 100%);
  border: 1px solid var(--border-gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.2), transparent);
  transform: rotate(45deg);
  animation: logoShine 4s infinite linear;
}

@keyframes logoShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  50%, 100% { transform: translateX(100%) rotate(45deg); }
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.logo-subtitle {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold-warm);
  font-weight: 600;
}

/* Nav Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 215, 0, 0.06);
  border-color: var(--border-subtle);
}

.nav-link.active {
  color: var(--gold-primary);
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--border-gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.nav-link .badge-pro {
  background: var(--gold-gradient);
  color: #060608;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Header Right / User Area */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Quick Role Switcher Pill */
.role-switcher {
  display: flex;
  align-items: center;
  background: rgba(14, 14, 20, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 30px;
  padding: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.role-switcher-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.role-switcher-btn.active {
  background: var(--gold-gradient);
  color: #08080c;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.role-switcher-btn:hover:not(.active) {
  color: var(--text-main);
}

/* User Menu Button */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  border-color: var(--border-gold);
  box-shadow: var(--gold-glow-sm);
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-primary);
}

.user-name-role {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===================================================================
   BUTTONS & BADGES
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  font-family: var(--font-sans);
}

.btn-primary-gold {
  background: var(--gold-gradient);
  color: #08080a;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
  font-weight: 700;
}

.btn-primary-gold:hover {
  background: linear-gradient(135deg, #ffffff 0%, #FFD700 40%, #e6b800 100%);
  box-shadow: var(--gold-glow);
  transform: translateY(-1px);
  color: #000;
}

.btn-outline-gold {
  background: rgba(255, 215, 0, 0.05);
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.btn-outline-gold:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
  transform: translateY(-1px);
}

.btn-glass {
  background: var(--bg-surface);
  color: var(--text-dim);
  border-color: var(--border-subtle);
}

.btn-glass:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-gold);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-gold {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold);
}

.badge-admin {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(166, 124, 0, 0.3));
  color: #FFF2A8;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

.badge-pinned {
  background: rgba(255, 183, 3, 0.2);
  color: #ffb703;
  border: 1px solid rgba(255, 183, 3, 0.4);
}

.badge-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===================================================================
   LAYOUT & CONTAINER
   =================================================================== */

.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ===================================================================
   HERO BANNER
   =================================================================== */

.hero-banner {
  background: linear-gradient(135deg, rgba(22, 22, 32, 0.8) 0%, rgba(12, 12, 18, 0.95) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), inset 0 0 60px rgba(255, 215, 0, 0.04);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 16px;
  box-shadow: var(--gold-glow-sm);
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-description {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-primary);
  font-family: var(--font-heading);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ===================================================================
   MAIN CONTENT GRID
   =================================================================== */

.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* ===================================================================
   SIDEBAR
   =================================================================== */

.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-warm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.sidebar-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-cat-item:hover {
  background: rgba(255, 215, 0, 0.06);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.sidebar-cat-item.active {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.sidebar-cat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-cat-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-muted);
}

/* Pro Store Promo Widget in Sidebar */
.pro-store-widget {
  background: linear-gradient(135deg, rgba(30, 25, 10, 0.8), rgba(15, 15, 20, 0.9));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--gold-glow-sm);
  position: relative;
  overflow: hidden;
}

.pro-store-widget::after {
  content: '⚡ PRO';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-primary);
  background: rgba(255, 215, 0, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.widget-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}

.widget-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ===================================================================
   FORUM CONTROLS (SEARCH, FILTER, NEW THREAD)
   =================================================================== */

.forum-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-bar-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
  background: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.sort-and-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-select:focus, .sort-select:hover {
  border-color: var(--border-gold);
  color: var(--text-main);
}

/* ===================================================================
   THREAD LIST & THREAD CARDS
   =================================================================== */

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.thread-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  width: 100%;
}

.thread-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: all 0.2s ease;
}

.thread-card:hover {
  background: var(--bg-card);
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--gold-glow-sm);
}

.thread-card:hover::before {
  background: var(--gold-primary);
}

.thread-card.is-pinned {
  border-color: rgba(255, 183, 3, 0.4);
  background: linear-gradient(135deg, rgba(25, 22, 12, 0.6) 0%, rgba(16, 16, 23, 0.9) 100%);
}

.thread-card.is-pinned::before {
  background: #FFB703;
}

.thread-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-gold);
  flex-shrink: 0;
}

.thread-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.thread-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thread-meta-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thread-category-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 215, 0, 0.08);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.thread-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.thread-time {
  font-size: 12px;
  color: var(--text-muted);
}

.thread-main {
  width: 100%;
  min-width: 0;
}

.thread-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
  transition: color 0.2s ease;
  word-break: break-word;
  overflow-wrap: break-word;
}

.thread-card:hover .thread-title {
  color: var(--gold-light);
}

.thread-snippet {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.thread-thumbnail-wrap {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.thread-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.thread-card:hover .thread-thumbnail {
  transform: scale(1.04);
}

.thread-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.thread-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.thread-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-item.liked {
  color: var(--gold-primary);
}

.view-thread-btn {
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.thread-card:hover .view-thread-btn {
  transform: translateX(3px);
  color: var(--gold-light);
}

/* ===================================================================
   THREAD DETAIL VIEW
   =================================================================== */

.thread-detail-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.back-btn-row {
  margin-bottom: 24px;
}

.detail-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.detail-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-author-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
}

.detail-author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-author-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 28px;
}

.detail-body p {
  margin-bottom: 16px;
}

.detail-body pre {
  background: #09090d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #f7d070;
  margin: 18px 0;
}

.detail-body code {
  font-family: var(--font-mono);
  background: rgba(255, 215, 0, 0.08);
  color: var(--gold-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.detail-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.detail-image-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-gold);
  cursor: pointer;
  position: relative;
  background: #000;
}

.detail-image-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.detail-image-card:hover img {
  transform: scale(1.04);
}

.detail-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
}

/* ===================================================================
   COMMENTS & RICH COMMENT INPUT
   =================================================================== */

.comments-section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: border-color 0.2s ease;
}

.comment-card:hover {
  border-color: rgba(255, 215, 0, 0.25);
}

.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
}

.comment-content-wrap {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.comment-time {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.comment-images-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.comment-img-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comment-like-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.comment-like-btn:hover, .comment-like-btn.liked {
  color: var(--gold-primary);
}

/* Rich Comment Box */
.comment-box-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.quick-emoji-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-emoji-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 4px;
  white-space: nowrap;
}

.quick-emoji-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-emoji-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--border-gold);
  transform: scale(1.15);
}

.comment-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-main);
  font-size: 14.5px;
  font-family: var(--font-sans);
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  margin-bottom: 12px;
}

.comment-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
}

.comment-box-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.comment-tools-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-preview-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.attachment-preview-item {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-gold);
}

.attachment-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================================================
   CATEGORIES VIEW (ADMIN CONTROLLED)
   =================================================================== */

.categories-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.category-card:hover {
  background: var(--bg-card);
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--gold-glow-sm);
}

.cat-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.cat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.cat-admin-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.cat-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
}

.cat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.cat-stat-badge {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================================
   PRO STORE (TOOLS MARKETPLACE)
   =================================================================== */

.pro-store-banner {
  background: linear-gradient(135deg, #1c1504 0%, #111116 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--gold-glow-sm);
}

.pro-store-banner::after {
  content: 'PRO STORE';
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 80px;
  font-weight: 900;
  color: rgba(255, 215, 0, 0.03);
  pointer-events: none;
  font-family: var(--font-heading);
}

.store-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.store-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.store-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.store-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-gold);
}

.store-tab-btn.active {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: var(--shadow-card);
}

.tool-card:hover {
  background: var(--bg-card);
  border-color: var(--gold-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--gold-glow);
}

.tool-img-wrap {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
  background: #000;
}

.tool-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tool-card:hover .tool-img {
  transform: scale(1.08);
}

.tool-badge-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: var(--gold-glow-sm);
}

.tool-price-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--gold-gradient);
  color: #08080a;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  font-family: var(--font-heading);
}

.tool-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tool-cat-name {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold-warm);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.tool-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
}

.tool-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 18px;
  flex: 1;
}

.tool-features-list {
  list-style: none;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-feature-item {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-feature-item::before {
  content: '✓';
  color: var(--gold-primary);
  font-weight: 800;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
  gap: 10px;
}

.tool-admin-actions {
  display: flex;
  gap: 6px;
}

/* ===================================================================
   MODALS (POPUP DIALOGS)
   =================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), var(--gold-glow);
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.modal-body {
  padding: 28px;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow-sm);
  background: #14141d;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Image Upload Area */
.upload-drop-zone {
  border: 2px dashed var(--border-gold);
  border-radius: var(--radius-md);
  background: rgba(255, 215, 0, 0.03);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-drop-zone:hover {
  background: rgba(255, 215, 0, 0.08);
  border-color: var(--gold-primary);
}

.upload-icon {
  font-size: 32px;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.upload-text {
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* ===================================================================
   EMOJI PICKER POPUP
   =================================================================== */

.emoji-picker-container {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), var(--gold-glow-sm);
  width: 320px;
  position: absolute;
  z-index: 2200;
  display: none;
}

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

.emoji-categories {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.emoji-cat-tab {
  background: transparent;
  border: none;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.emoji-cat-tab.active {
  background: rgba(255, 215, 0, 0.15);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.emoji-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: scale(1.25);
}

/* ===================================================================
   PURCHASE MODAL & LICENSE DISPLAY
   =================================================================== */

.purchase-tool-preview {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
}

.purchase-tool-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.license-box {
  background: #09090e;
  border: 1px dashed var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 0.1em;
  box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.1);
}

/* ===================================================================
   LIGHTBOX FOR IMAGES
   =================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.25);
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), var(--gold-glow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===================================================================
   TELEGRAM LIVE CHAT WIDGET (@Leadzcartel)
   =================================================================== */

.telegram-livechat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Trigger Button */
.telegram-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0e1726 0%, #080c14 100%);
  border: 1.5px solid var(--border-gold);
  border-radius: 40px;
  padding: 8px 16px 8px 10px;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(42, 171, 238, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  outline: none;
}

.telegram-trigger-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #29b6f6;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(41, 182, 246, 0.5);
}

.telegram-trigger-btn:active {
  transform: scale(0.97);
}

.telegram-trigger-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(42, 171, 238, 0.5);
  flex-shrink: 0;
}

.telegram-trigger-pulse {
  position: absolute;
  top: 7px;
  left: 9px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #29b6f6;
  animation: telegramPulse 2s infinite ease-out;
  pointer-events: none;
  opacity: 0;
}

@keyframes telegramPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.telegram-trigger-label {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
}

.telegram-trigger-badge {
  display: none !important;
}

/* Popover Chat Card */
.telegram-chat-card {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 320px;
  background: rgba(13, 16, 25, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), var(--gold-glow-sm);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.telegram-chat-card.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.telegram-chat-header {
  background: linear-gradient(135deg, rgba(22, 28, 44, 0.95) 0%, rgba(14, 18, 28, 0.95) 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.telegram-chat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telegram-avatar-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  box-shadow: 0 4px 15px rgba(42, 171, 238, 0.4);
  flex-shrink: 0;
}

.telegram-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #10B981;
  border: 2px solid #0d121c;
  border-radius: 50%;
  box-shadow: 0 0 6px #10B981;
}

.telegram-profile-text {
  display: flex;
  flex-direction: column;
}

.telegram-chat-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.telegram-chat-sub {
  font-size: 11.5px;
  color: #29b6f6;
  font-weight: 600;
}

.telegram-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.telegram-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.telegram-chat-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.telegram-chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.telegram-chat-bubble strong {
  color: var(--gold-primary);
}

.telegram-bubble-time {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.telegram-chat-footer {
  padding: 12px 16px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 10, 16, 0.6);
}

.btn-telegram-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  color: #FFFFFF !important;
  font-size: 13.5px;
  font-weight: 800;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(42, 171, 238, 0.4);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-telegram-chat:hover {
  background: linear-gradient(135deg, #3bbbfd 0%, #27a8e6 100%);
  box-shadow: 0 6px 20px rgba(42, 171, 238, 0.6);
  transform: translateY(-1px);
  color: #FFFFFF !important;
}

.btn-telegram-chat .btn-arrow {
  transition: transform 0.2s ease;
}

.btn-telegram-chat:hover .btn-arrow {
  transform: translateX(4px);
}

/* ===================================================================
   MOBILE NAVIGATION & CATEGORY CHIPS
   =================================================================== */

.mobile-cat-chips {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* ===================================================================
   RESPONSIVE QUERIES & MOBILE OPTIMIZATIONS
   =================================================================== */

@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .main-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .content-column {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    order: 2;
    width: 100%;
  }

  .mobile-cat-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 12px 2px;
    margin-bottom: 12px;
    scrollbar-width: none;
  }

  .mobile-cat-chips::-webkit-scrollbar {
    display: none;
  }

  .cat-chip {
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
  }

  .cat-chip:hover {
    border-color: var(--border-gold);
    color: var(--text-main);
  }

  .cat-chip.active {
    background: rgba(255, 215, 0, 0.12);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: clip;
    width: 100%;
    max-width: 100vw;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .app-container {
    padding: 12px 10px 80px 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Mobile Performance: zero stutter, zero scroll freeze */
  body::before {
    background-size: 100% 100%, 100% 100%, 0 0, 0 0 !important;
    will-change: auto !important;
  }

  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: 56px;
    z-index: 1000;
    background: #0b0b12;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .header-container {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .header-auth-btn {
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  .logo-area {
    gap: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .logo-animated-img,
  .logo-img {
    height: 42px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
    contain: layout paint;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 8px;
  }

  .logo-title {
    font-size: 17px;
  }

  .logo-subtitle {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .role-switcher {
    display: none !important;
  }

  #headerRegisterBtn {
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  .user-menu-btn {
    padding: 3px 8px 3px 3px;
    gap: 6px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--gold-primary);
  }

  .user-name-role {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
  }

  .user-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-role-badge {
    display: block !important;
    font-size: 9px;
    color: var(--gold-primary);
  }

  /* Hero Section */
  .hero-banner {
    padding: 16px 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-lg);
  }

  .hero-pill {
    font-size: 9.5px;
    padding: 4px 10px;
    margin-bottom: 8px;
  }

  .hero-title {
    font-size: 20px;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .hero-description {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .hero-actions .btn:first-child {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 11px 14px;
    font-size: 13.5px;
  }

  .hero-actions .btn:not(:first-child) {
    width: 100%;
    justify-content: center;
    padding: 9px 8px;
    font-size: 12px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
  }

  .stat-card {
    padding: 10px 8px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.04em;
  }

  /* Forum Controls */
  .forum-controls {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
  }

  .search-bar-wrap {
    width: 100%;
    min-width: 100%;
  }

  .sort-and-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .sort-select {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    font-size: 12px;
  }

  .sort-and-actions .btn {
    flex-shrink: 0;
    padding: 9px 14px;
    font-size: 12px;
  }

  /* Thread Cards Mobile */
  .thread-card {
    padding: 14px 12px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .thread-avatar {
    width: 36px;
    height: 36px;
  }

  .thread-author {
    font-size: 12.5px;
  }

  .thread-title {
    font-size: 16px;
    line-height: 1.32;
    margin-bottom: 6px;
  }

  .thread-snippet {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 10px;
  }

  .thread-thumbnail-wrap {
    height: 160px;
    margin-bottom: 10px;
  }

  .thread-footer {
    font-size: 11.5px;
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .thread-metrics {
    gap: 10px;
  }

  .view-thread-btn {
    font-size: 11.5px;
  }

  /* Thread Detail Mobile */
  .thread-detail-container {
    padding: 16px 12px;
    border-radius: var(--radius-lg);
  }

  .detail-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .detail-author-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .detail-footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .detail-comments-section {
    padding-top: 20px;
    margin-top: 24px;
  }

  .comment-item {
    padding: 12px 10px;
  }

  .comment-avatar {
    width: 32px;
    height: 32px;
  }

  /* Pro Store Mobile */
  .pro-store-banner {
    padding: 20px 14px;
    border-radius: var(--radius-lg);
  }

  .pro-store-banner h2 {
    font-size: 22px !important;
  }

  .store-filter-bar {
    flex-direction: column;
    gap: 12px;
  }

  .store-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .categories-grid, .store-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modals Mobile: no transform/blur layers (fixes half-rendered popups) */
  .modal-backdrop {
    padding: 16px 10px;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop.active .modal-box,
  .modal-box {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto;
    padding: 0 !important;
    max-height: calc(100dvh - 32px);
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    justify-content: center;
  }

  /* Inputs font-size 16px to prevent iOS auto-zoom */
  .form-input, .form-textarea, .form-select {
    font-size: 16px !important;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 0 6px env(safe-area-inset-bottom, 0px) 6px;
    background: #0b0b12;
    border-top: 1px solid var(--border-gold);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7);
    contain: layout paint;
  }

  .mobile-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    padding: 6px 0;
    transition: all 0.2s ease;
    outline: none;
  }

  .mobile-nav-btn .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav-btn.active {
    color: var(--gold-primary);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  }

  .mobile-nav-btn:active {
    transform: scale(0.94);
  }

  /* Telegram live chat FAB button mobile - compact round icon to avoid blocking actions */
  .telegram-livechat-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    z-index: 990;
  }
  
  .telegram-trigger-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0e1726 0%, #080c14 100%);
    border: 1.5px solid var(--border-gold);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(42, 171, 238, 0.35);
  }

  .telegram-trigger-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
  }

  .telegram-trigger-label {
    display: none !important;
  }

  .telegram-trigger-badge {
    display: none !important;
  }

  .telegram-trigger-pulse {
    display: none !important;
    animation: none !important;
  }

  .telegram-chat-card {
    right: 0;
    width: calc(100vw - 24px);
    max-width: 320px;
    bottom: 56px;
  }
}

@media (max-width: 480px) {
  .site-header {
    height: auto;
    min-height: 54px;
  }

  .header-container {
    padding: 0 10px;
    height: 54px;
  }

  .logo-animated-img,
  .logo-img {
    height: 38px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
    contain: layout paint;
  }

  .logo-title {
    font-size: 15px;
  }

  .user-name-role {
    display: none;
  }

  .user-menu-btn {
    padding: 0;
    background: transparent;
    border: none;
  }

  .user-avatar-sm {
    width: 34px;
    height: 34px;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
  }

  .hero-title {
    font-size: 18px;
  }

  .hero-pill {
    font-size: 8.5px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stat-card {
    padding: 8px 6px;
  }

  .stat-value {
    font-size: 16px;
  }

  .stat-label {
    font-size: 9px;
  }

  .thread-card {
    padding: 12px 10px;
  }

  .thread-title {
    font-size: 14.5px;
  }

  .thread-thumbnail-wrap {
    height: 130px;
  }
}

/* ===================================================================
   LIVE HOMEPAGE BANNERS & COMMUNITY PULSE
   =================================================================== */

.home-banners-section {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-banners-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 215, 0, 0.06);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-md);
}

.home-banners-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-banner-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.32);
  background: #07070c;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.75);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-banner-card:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 10px 32px rgba(255, 215, 0, 0.16);
}

.home-banner-card.home-banner-inactive {
  opacity: 0.55;
  border-style: dashed;
}

.home-banner-img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.home-banner-admin-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  background: rgba(8, 8, 14, 0.86);
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.home-banner-slot-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold-primary);
  padding: 0 6px;
}

/* Live Dots & Community Pulse */
.live-dot-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
  animation: livePulseDot 1.8s infinite ease-in-out;
  vertical-align: middle;
}

@keyframes livePulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

.stat-value-live {
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.stat-value-viewers {
  color: var(--gold-primary);
}

.pulse-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
}

.pulse-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pulse-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}

.pulse-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.pulse-stat-lbl {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 3px;
  font-weight: 600;
}

.sidebar-active-members-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.active-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.active-member-chip img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .home-banners-section {
    margin-bottom: 14px;
  }

  .home-banner-img {
    max-height: 120px;
    object-fit: contain;
  }

  .home-banners-admin-bar {
    padding: 8px 10px;
  }

  .home-banner-admin-actions {
    top: 4px;
    right: 4px;
    padding: 2px 4px;
  }
}

.active-cat-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid var(--border-gold);
  font-size: 13px;
  color: var(--text-main);
}

/* Vector SVG UI Icons & Category Icon Picker */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon-fill {
  fill: currentColor;
  stroke: none;
}

.cat-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.cat-icon-pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-icon-pick-btn:hover {
  border-color: var(--border-gold);
  color: var(--gold-primary);
  background: rgba(255, 215, 0, 0.08);
}

.cat-icon-pick-btn.active {
  border-color: var(--gold-primary);
  color: #0b0b12;
  background: var(--gold-gradient);
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

@media (max-width: 480px) {
  .cat-icon-picker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
