/* ═══════════════════════════════════════════════════════════════
   Human-Advantage.ai Community Portal — Elegant Social Platform
   Dark (teal accent) / Light (purple accent) dual-theme
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Core palette ── */
  --primary: #26A69A;
  --primary-rgb: 38, 166, 154;
  --primary-soft: rgba(38,166,154,.10);
  --primary-mid: rgba(38,166,154,.18);
  --primary-hover: #4DB6AC;
  --primary-deep: #1A7A70;
  --teal: #26A69A;
  --teal-soft: rgba(38,166,154,.10);
  --teal-mid: rgba(38,166,154,.18);
  --gold: #E9C46A;
  --gold-soft: rgba(233,196,106,.10);
  --accent: #C9A54B;
  --blue: #5B8DEF;
  --blue-soft: rgba(91,141,239,.10);
  --purple: #9B8FE4;
  --danger: #EF4444;
  --success: #34D399;

  /* ── Dark theme (default) ── */
  --bg: #0c0c0e;
  --bg-primary: #111113;
  --bg-card: #19191d;
  --bg-card-hover: #1f1f24;
  --bg-elevated: #232328;
  --bg-input: #1a1a1f;
  --border: rgba(255,255,255,.07);
  --border-hover: rgba(255,255,255,.14);
  --border-gold: rgba(233,196,106,.2);
  --text: #F0F0F2;
  --text-sec: #C5C5CA;
  --text-muted: #8888;
  --text-faint: #5a5a62;
  --shadow-card: 0 1px 3px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.18);
  --shadow-elevated: 0 6px 24px rgba(0,0,0,.5);

  /* ── Shared tokens ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --sidebar-w: 272px;
  --topbar-h: 56px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ── Light theme override ── */
[data-theme="light"] {
  --bg: #f4f4f8;
  --bg-primary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f8fc;
  --bg-elevated: #f0f0f5;
  --bg-input: #f5f5fa;
  --border: rgba(0,0,0,.08);
  --border-hover: rgba(0,0,0,.15);
  --border-gold: rgba(201,165,75,.25);
  --text: #1a1a2e;
  --text-sec: #4a4a5a;
  --text-muted: #6B6B7A;
  --text-faint: #9999a5;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.04);
  --shadow-elevated: 0 6px 24px rgba(0,0,0,.1);
  --primary: #6366F1;
  --primary-rgb: 99, 102, 241;
  --primary-soft: rgba(var(--primary-rgb),.08);
  --primary-mid: rgba(var(--primary-rgb),.14);
  --primary-hover: #818CF8;
  --primary-deep: #4338CA;
  --teal-soft: rgba(38,166,154,.08);
  --teal-mid: rgba(38,166,154,.14);
  --gold-soft: rgba(233,196,106,.10);
  --blue-soft: rgba(91,141,239,.08);
}

*, *::before, *::after { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   AUTH SCREEN — Clean, centered, branded
   ═══════════════════════════════════════════════════════════════ */
.portal-screen { min-height: 100vh; }

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--primary-rgb),.06) 0%, transparent 60%),
              var(--bg);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-elevated);
}

.auth-card .eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
}

.auth-card h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 6px;
  color: var(--text);
}

.btn-social.google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  background: #fff;
  color: #222;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,.1);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-social.google:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 14px;
  display: none;
  background: rgba(239,68,68,.08);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,.15);
}

/* Auth form inputs */
#signInForm input, #signUpForm input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
#signInForm input:focus, #signUpForm input:focus {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb),.03);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.08);
}
#signInForm input::placeholder, #signUpForm input::placeholder {
  color: var(--text-faint);
}


/* ═══════════════════════════════════════════════════════════════
   PORTAL LAYOUT — Social platform sidebar + content
   ═══════════════════════════════════════════════════════════════ */
.portal-layout {
  display: flex;
  min-height: calc(100vh - 68px);
  margin-top: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: calc(100vh - 68px);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 68px;
  left: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-profile {
  padding: 28px 24px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--primary-rgb),.04) 0%, transparent 100%);
  flex-wrap: wrap;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(var(--primary-rgb),.3);
}
.avatar-lg { width: 64px; height: 64px; font-size: 24px; border-width: 3px; }

.sidebar-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.sidebar-role { font-size: 12px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
  position: relative;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--primary-soft);
}
.sidebar-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-left-color: var(--primary);
  font-weight: 600;
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-bottom {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ── Theme Toggle ──────────────────────────────────────────── */
.theme-toggle-wrapper {
  padding: 8px 20px 4px;
  border-top: 1px solid var(--border);
}
.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.theme-toggle-btn:hover { color: var(--text); }
.theme-toggle-btn svg { width: 18px; height: 18px; flex-shrink: 0; }


/* ── Main Content ────────────────────────────────────────────── */
.portal-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--bg);
  padding: 0 40px 80px;
  max-width: 100%;
}

/* ── Community Tab Bar ───────────────────────────────────────── */
.community-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 0 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.community-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.community-tab:hover { color: var(--text); }
.community-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── Dashboard 3-Column Layout ───────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
.dash-center { min-width: 0; }

/* ── Right Sidebar ───────────────────────────────────────────── */
.right-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.right-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.right-widget h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.impact-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.impact-stat:last-child { border-bottom: none; }
.impact-stat-label { font-size: 13px; color: var(--text-sec); }
.impact-stat-value { font-size: 16px; font-weight: 700; color: var(--primary); }

.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trending-tag {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-soft);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition);
}
.trending-tag:hover { background: var(--primary-mid); }

.event-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-badge {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(239,68,68,.1);
  color: #EF4444;
  white-space: nowrap;
}
.event-info { font-size: 13px; color: var(--text-sec); line-height: 1.4; }
.event-info strong { color: var(--text); display: block; margin-bottom: 2px; }

.suggested-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.suggested-person:last-child { border-bottom: none; }
.suggested-person .avatar { width: 36px; height: 36px; font-size: 13px; }
.suggested-person-info { flex: 1; min-width: 0; }
.suggested-person-name { font-size: 13px; font-weight: 600; color: var(--text); }
.suggested-person-role { font-size: 11px; color: var(--text-muted); }
.connect-btn-sm {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: all var(--transition);
}
.connect-btn-sm:hover { background: var(--primary-soft); }

/* ── Welcome Hero ────────────────────────────────────────────── */
.welcome-hero {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.12), rgba(var(--primary-rgb),.04));
  border: 1px solid rgba(var(--primary-rgb),.15);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.08), transparent 70%);
}
.welcome-hero h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.welcome-hero p { font-size: 14px; color: var(--text-sec); margin-bottom: 16px; }
.welcome-hero-actions { display: flex; gap: 10px; position: relative; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── Post Composer ───────────────────────────────────────────── */
.post-composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.post-composer-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.post-composer-top .avatar { width: 40px; height: 40px; font-size: 15px; }
.post-composer-input {
  flex: 1;
  padding: 11px 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.post-composer-input:hover { border-color: var(--border-hover); }
.post-composer-input:focus { outline: none; border-color: var(--primary); }
.post-composer-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: space-between;
}
.composer-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.composer-action:hover { background: var(--primary-soft); color: var(--primary); }
.composer-action svg { width: 18px; height: 18px; }
.composer-post-btn {
  padding: 8px 24px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.composer-post-btn:hover { opacity: .88; }

/* ── Feed Filter Tabs ────────────────────────────────────────── */
.feed-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.feed-filter {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.feed-filter:hover { color: var(--text); background: var(--bg-elevated); }
.feed-filter.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ── Quick Actions ───────────────────────────────────────────── */
.quick-actions {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.quick-actions h5 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.quick-action-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.quick-action-link:hover { color: var(--primary); }
.quick-action-link svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

/* ── HA Score Badge in Sidebar ───────────────────────────────── */
.sidebar-ha-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   VIEWS — Smooth card-based social layout
   ═══════════════════════════════════════════════════════════════ */
.view { animation: viewSlide .35s ease; }
@keyframes viewSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.view-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 4px;
  color: var(--text);
}
.view-header p { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

.caption { font-size: 13px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — Stats + Feed (social home)
   ═══════════════════════════════════════════════════════════════ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.dash-stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}
.dash-stat-card:hover::before { opacity: 1; }

.dash-stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
}
.dash-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 500;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
}

.dash-section { margin-bottom: 8px; }
.dash-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sec);
}

.feed-item-sm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.feed-item-sm:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.feed-source {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.feed-item-sm a {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.feed-item-sm a:hover { color: var(--primary); }

.challenge-card-sm { padding: 4px 0; }
.challenge-card-sm h4 { font-size: 14px; margin-bottom: 8px; font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════
   FEED — Social post cards (LinkedIn/Facebook style)
   ═══════════════════════════════════════════════════════════════ */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.feed-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-elevated);
}

.feed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.feed-source-tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: .3px;
}

.feed-card h3 { font-size: 17px; line-height: 1.5; margin-bottom: 10px; font-weight: 600; }
.feed-card h3 a { color: var(--text); text-decoration: none; transition: color var(--transition); }
.feed-card h3 a:hover { color: var(--primary); }

.body-sm { font-size: 14px; color: var(--text-sec); line-height: 1.65; }

.feed-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2px;
}
.tag-muted { background: var(--bg-elevated); color: var(--text-muted); }
.tag-teal { background: var(--teal-soft); color: var(--teal); }
.tag-gold { background: var(--gold-soft); color: var(--gold); }

.feed-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 4px;
}

.feed-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-action-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.feed-read-more {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-top: 4px;
  display: inline-block;
}
.feed-read-more:hover { text-decoration: underline; }

.feed-discussion {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.5;
}

/* Feed content expand/collapse */
.feed-content-preview { margin-top: 10px; }
.feed-content-full { margin-top: 10px; }

.feed-comments-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feed-comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.feed-comment-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 38px;
}
.feed-comment-input:focus { outline: none; border-color: var(--primary); }

.feed-comments-list { display: flex; flex-direction: column; gap: 10px; }

.feed-comment {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.feed-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 13px;
}


/* ═══════════════════════════════════════════════════════════════
   CHALLENGES — Card-based with response thread
   ═══════════════════════════════════════════════════════════════ */
.challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.challenge-status {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: .3px;
}
.challenge-active { background: rgba(52,211,153,.1); color: var(--success); }
.challenge-ended { background: var(--bg-elevated); color: var(--text-muted); }

.challenge-card h3 { font-size: 18px; margin-bottom: 10px; font-weight: 600; }

.challenge-response {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: all var(--transition);
  line-height: 1.6;
}
.challenge-response:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.08);
}

.response-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 10px;
  transition: all var(--transition);
}
.response-card:hover { border-color: var(--border-hover); }

.response-header { font-size: 13px; margin-bottom: 8px; color: var(--text-sec); }

.vote-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.vote-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }


/* ═══════════════════════════════════════════════════════════════
   POLLS — Clean voting cards with animated bars
   ═══════════════════════════════════════════════════════════════ */
.poll-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.poll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.poll-status {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: .3px;
}
.poll-active { background: rgba(52,211,153,.1); color: var(--success); }
.poll-ended { background: var(--bg-elevated); color: var(--text-muted); }

.poll-card h3 { font-size: 17px; margin-bottom: 18px; font-weight: 600; line-height: 1.5; }

.poll-options { display: flex; flex-direction: column; gap: 10px; }

.poll-option {
  position: relative;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  transition: all var(--transition);
  user-select: none;
}
.poll-option:hover:not(.voted) {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb),.03);
}

.poll-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  border-radius: var(--radius-md);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.poll-option-text { position: relative; font-size: 14px; z-index: 1; font-weight: 500; }
.poll-option-pct {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  z-index: 1;
  min-width: 44px;
  text-align: right;
}
.poll-option.voted { cursor: default; }


/* ═══════════════════════════════════════════════════════════════
   MEMBERS — Grid cards (like LinkedIn connections)
   ═══════════════════════════════════════════════════════════════ */
.members-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.members-filter select {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: all var(--transition);
}
.members-filter select:focus { border-color: var(--primary); }

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.member-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.06), rgba(91,141,239,.04));
}
.member-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}
.member-card .avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  font-size: 28px;
  position: relative;
  border-width: 3px;
}
.member-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  position: relative;
}
.member-card .caption {
  font-size: 12px;
  position: relative;
}
.member-role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  position: relative;
  background: rgba(var(--primary-rgb),.12);
  color: var(--primary);
}
.member-skill-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  position: relative;
}
.member-skill-tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.member-connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 7px 24px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.member-connect-btn:hover { opacity: .88; transform: translateY(-1px); }

.member-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--blue-soft);
  transition: all var(--transition);
  position: relative;
}
.member-linkedin:hover { background: rgba(91,141,239,.18); }

.member-private { opacity: 0.7; }
.member-private .avatar { font-size: 20px; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-sec);
}
.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════════
   PROFILE — Full-width LinkedIn-style profile editor
   ═══════════════════════════════════════════════════════════════ */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-top h3 { font-size: 20px; font-weight: 700; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 4px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }
.form-group textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

.save-status { font-size: 13px; }

/* Badges */
.profile-badges h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }

.badges-grid { display: flex; gap: 14px; flex-wrap: wrap; }

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.badge-card:hover { border-color: var(--gold); }

.badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.badge-desc { font-size: 12px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════
   NAV AUTH
   ═══════════════════════════════════════════════════════════════ */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user-name { font-size: 13px; font-weight: 500; color: var(--text-sec); }
.nav-cta {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all var(--transition);
}
.nav-cta:hover { opacity: .88; }


/* ═══════════════════════════════════════════════════════════════
   SHARED
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: #111;
}
.btn-gold:hover { opacity: .9; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sec);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Leaderboard */
.leaderboard-grid { margin-bottom: 16px; }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .portal-main { padding: 0 24px 60px; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-layout { grid-template-columns: 1fr; }
  .right-sidebar { position: static; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-elevated); }
  .portal-main { margin-left: 0; padding: 0 16px 60px; max-width: 100%; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 36px 24px; }
  .feed-card { padding: 20px; }
  .challenge-card, .poll-card { padding: 22px; }
  .community-tabs { gap: 0; }
  .community-tab { padding: 10px 14px; font-size: 13px; }
  .welcome-hero { padding: 24px; }
  .welcome-hero h2 { font-size: 20px; }
}

@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr; }
  .members-filter { flex-direction: column; }
  .auth-card { padding: 28px 20px; }
}


/* ═══════════════════════════════════════════════════════════════
   AI-POWERED FEATURES — The Moat
   ═══════════════════════════════════════════════════════════════ */

/* ── AI Cards ─────────────────────────────────────────────────── */
.ai-card {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.04), rgba(91,141,239,.02));
  border: 1px solid rgba(var(--primary-rgb),.12);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.ai-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--blue), var(--primary));
  opacity: .5;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.ai-card-body { font-size: 14px; line-height: 1.7; color: var(--text-sec); }

.ai-action-btn {
  padding: 7px 16px;
  border: 1px solid rgba(var(--primary-rgb),.25);
  border-radius: 20px;
  background: rgba(var(--primary-rgb),.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.ai-action-btn:hover { background: rgba(var(--primary-rgb),.16); border-color: var(--primary); }

.ai-tag {
  display: inline-block;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: .3px;
}

/* ── AI Loading Animation ──────────────────────────────────── */
.ai-loading { display: flex; gap: 5px; padding: 10px 0; }
.ai-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: aiBounce .8s infinite;
}
.ai-dot:nth-child(2) { animation-delay: .15s; }
.ai-dot:nth-child(3) { animation-delay: .3s; }
@keyframes aiBounce {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40%           { opacity: 1; transform: scale(1.2); }
}

/* ── Feed: AI Relevance + Summary ────────────────────────── */
.ai-relevance { margin-top: 12px; }
.ai-relevance-text {
  font-size: 13px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid var(--primary-mid);
  line-height: 1.5;
}
.ai-action-sm { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.ai-action-sm svg { color: var(--primary); }
.ai-summary-box {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb),.04);
  border: 1px solid var(--primary-mid);
}
.ai-summary-content { font-size: 13px; line-height: 1.7; color: var(--text-sec); }

/* ── Challenge: AI Feedback ──────────────────────────────── */
.ai-feedback-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.04), rgba(91,141,239,.02));
  border: 1px solid rgba(var(--primary-rgb),.12);
}
.ai-feedback-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-sec);
  white-space: pre-line;
}

/* ── Polls: AI Context ───────────────────────────────────── */
.ai-poll-context { margin-top: 16px; }
.ai-context-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-sec);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--primary-mid);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ai-context-text svg { flex-shrink: 0; margin-top: 3px; color: var(--primary); }


/* ═══════════════════════════════════════════════════════════════
   FLOATING AI COACH
   ═══════════════════════════════════════════════════════════════ */
.ai-coach { position: fixed; bottom: 28px; right: 28px; z-index: 200; }

.ai-coach-fab {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(var(--primary-rgb),.4);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  animation: fabGlow 3s infinite;
}
.ai-coach-fab:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(var(--primary-rgb),.5); }
.ai-coach-fab.hidden { display: none; }
@keyframes fabGlow {
  0%, 100% { box-shadow: 0 4px 24px rgba(var(--primary-rgb),.4); }
  50%      { box-shadow: 0 4px 32px rgba(var(--primary-rgb),.6); }
}

.ai-coach-panel {
  position: absolute;
  bottom: 72px; right: 0;
  width: 400px;
  max-height: 540px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb),.15);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  transform: translateY(20px) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.ai-coach-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.ai-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.05), rgba(91,141,239,.02));
}
.ai-coach-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}
.ai-coach-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.ai-coach-close:hover { color: var(--text); }

.ai-coach-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 380px;
}
.ai-msg {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
  max-width: 88%;
  word-wrap: break-word;
}
.ai-msg-bot {
  background: var(--primary-soft);
  border: 1px solid var(--primary-mid);
  color: var(--text-sec);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.ai-msg-user {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ai-msg-loading { display: flex; gap: 5px; padding: 14px 16px; }

.ai-coach-input {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}
.ai-coach-input input {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
.ai-coach-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.08);
}
.ai-send-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.ai-send-btn:hover { opacity: .85; transform: scale(1.05); }

/* Responsive coach */
@media (max-width: 480px) {
  .ai-coach-panel { width: calc(100vw - 32px); right: -12px; bottom: 68px; }
  .ai-coach-fab { width: 50px; height: 50px; }
  .ai-coach { bottom: 20px; right: 16px; }
}
