/* ═══════════════════════════════════════════════════════════════
   Elite Club — Modern Discussion Forum
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero banner ────────────────────────────────────────────── */
.ec-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  border-radius: 14px;
  padding: 36px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.ec-hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.ec-hero-inner { position: relative; z-index: 1; }
.ec-hero h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.ec-hero p  { margin: 0; font-size: 14px; color: rgba(255,255,255,.8); max-width: 520px; line-height: 1.5; }

/* ── Layout ─────────────────────────────────────────────────── */
.ec-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .ec-wrap { grid-template-columns: 1fr; }
  .ec-sidebar { order: 1; }
  .ec-main { order: 0; }
}

/* ── Sidebar ────────────────────────────────────────────────── */
.ec-sidebar {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
}
.ec-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.ec-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}
.ec-new-icon { font-size: 16px; }

.ec-search-wrap {
  position: relative;
  margin-top: 16px;
}
.ec-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}
.ec-search {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg, #f9fafb);
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.ec-search:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}

.ec-nav-section { margin-top: 20px; }
.ec-nav-section h4 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
  font-weight: 600;
}
.ec-cats {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ec-cats li {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #374151;
  transition: all .15s;
  margin-bottom: 2px;
}
.ec-cats li:hover { background: #f3f4f6; color: #111827; }
.ec-cats li.active {
  background: #eef2ff;
  color: #1e40af;
  font-weight: 600;
}
.ec-cat-count {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.ec-cats li.active .ec-cat-count {
  background: #c7d2fe;
  color: #1e3a8a;
}

.ec-sidebar-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.ec-sidebar-footer p {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
}

/* ── Main content area ──────────────────────────────────────── */
.ec-main {
  min-height: 400px;
}

/* ── Summary banner ─────────────────────────────────────────── */
.ec-summary {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.ec-summary h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ec-summary h2::before { content: '📊'; font-size: 16px; }
.ec-summary-day {
  padding: 10px 0;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.ec-summary-day:first-of-type { border-top: 0; padding-top: 4px; }
.ec-day-label { font-weight: 600; color: #1e3a8a; }
.ec-day-meta { color: #6b7280; font-size: 12px; }
.ec-summary-day a { color: #2563eb; text-decoration: none; font-weight: 500; }
.ec-summary-day a:hover { text-decoration: underline; }
.ec-loading { color: #9ca3af; font-size: 13px; }

/* ── Toolbar ────────────────────────────────────────────────── */
.ec-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.ec-toolbar-left { display: flex; align-items: center; gap: 10px; }
.ec-toolbar-right { display: flex; align-items: center; gap: 14px; }
.ec-toolbar-title { margin: 0; font-size: 18px; font-weight: 700; color: #111827; }
.ec-select-wrap select {
  padding: 7px 28px 7px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card, #fff);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}
.ec-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.ec-check-label input[type=checkbox] {
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
}

/* ── Thread cards ───────────────────────────────────────────── */
.ec-thread-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  gap: 16px;
}
.ec-thread-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  transform: translateY(-1px);
}
.ec-thread-card.suggestion {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 60%);
}
.ec-thread-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  padding-top: 2px;
  flex-shrink: 0;
}
.ec-thread-vote-count {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}
.ec-thread-vote-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ca3af;
  font-weight: 600;
}
.ec-thread-body { flex: 1; min-width: 0; }
.ec-thread-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.ec-thread-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  flex: 1;
  line-height: 1.35;
}
.ec-thread-cat {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.ec-thread-cat.discussion { background: #e0e7ff; color: #3730a3; }
.ec-thread-cat.suggestion { background: #fef3c7; color: #92400e; }
.ec-thread-cat.question   { background: #dbeafe; color: #1e40af; }
.ec-thread-cat.strategy   { background: #d1fae5; color: #065f46; }
.ec-thread-cat.news       { background: #fee2e2; color: #991b1b; }
.ec-thread-cat.offtopic   { background: #f3f4f6; color: #6b7280; }
.ec-thread-excerpt {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-thread-meta {
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.ec-thread-meta .ec-pin {
  color: #d97706;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ec-meta-dot { color: #d1d5db; }
.ec-meta-replies {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  font-weight: 500;
}

/* ── Empty state ────────────────────────────────────────────── */
.ec-empty {
  padding: 60px 20px;
  text-align: center;
  color: #9ca3af;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
}
.ec-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.ec-empty a { color: #2563eb; font-weight: 600; }

/* ── Thread detail view ─────────────────────────────────────── */
.ec-detail-back {
  background: none;
  border: 1px solid var(--border, #e5e7eb);
  color: #6b7280;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  margin-bottom: 20px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ec-detail-back:hover { background: #f3f4f6; color: #111827; border-color: #d1d5db; }

.ec-detail-header {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.ec-detail-title { margin: 8px 0 10px; font-size: 24px; font-weight: 700; color: #111827; line-height: 1.3; }
.ec-detail-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ec-detail-meta strong { color: #374151; }
.ec-detail-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: #1f2937;
  white-space: pre-wrap;
  padding: 20px;
  background: #f9fafb;
  border-radius: 10px;
  border-left: 4px solid #2563eb;
}
.ec-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}
.ec-vote-btn {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #374151;
}
.ec-vote-btn:hover { background: #eef2ff; border-color: #c7d2fe; color: #1e40af; }
.ec-vote-btn.upvote:hover { background: #dcfce7; border-color: #86efac; color: #166534; }
.ec-vote-btn.downvote:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ── Replies section ────────────────────────────────────────── */
.ec-replies-section {
  margin-top: 20px;
}
.ec-replies-head {
  font-weight: 700;
  font-size: 16px;
  color: #111827;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ec-replies-head::before { content: '💬'; }
.ec-reply {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.ec-reply:hover { border-color: #d1d5db; }
.ec-reply-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ec-reply-meta strong { color: #374151; font-size: 13px; }
.ec-reply-body {
  font-size: 14px;
  line-height: 1.6;
  color: #1f2937;
  white-space: pre-wrap;
}
.ec-reply-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ── Forms ──────────────────────────────────────────────────── */
.ec-reply-form, .ec-new-form {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}
.ec-form-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ec-reply-form input, .ec-reply-form textarea,
.ec-new-form input, .ec-new-form textarea, .ec-new-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 10px;
  background: var(--bg, #f9fafb);
  transition: border-color .2s, box-shadow .2s;
}
.ec-reply-form input:focus, .ec-reply-form textarea:focus,
.ec-new-form input:focus, .ec-new-form textarea:focus, .ec-new-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.ec-reply-form textarea { min-height: 80px; resize: vertical; }
.ec-new-form textarea { min-height: 140px; resize: vertical; }
.ec-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 560px) { .ec-form-row { grid-template-columns: 1fr; } }
.ec-form-row > * { margin-bottom: 0; }

.ec-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.ec-submit {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 2px 6px rgba(37,99,235,.25);
}
.ec-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.ec-cancel {
  background: var(--card, #fff);
  color: #6b7280;
  border: 1px solid var(--border, #e5e7eb);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.ec-cancel:hover { background: #f3f4f6; color: #374151; }
.ec-form-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
}

/* ── Tags & misc ────────────────────────────────────────────── */
.ec-error { color: #dc2626; font-size: 13px; padding: 10px 0; font-weight: 500; }
.ec-tag {
  display: inline-block;
  background: #e5e7eb;
  color: #374151;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.ec-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c7d2fe, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #3730a3;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Auth Modal & User Badge
   ═══════════════════════════════════════════════════════════════ */

/* Overlay */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.auth-overlay[hidden] { display: none; }
.auth-modal {
  background: #fff; color: #1f2937;
  border-radius: 16px; padding: 32px 28px;
  width: 100%; max-width: 400px;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
  position: relative;
  animation: authFadeIn .2s ease;
}
@keyframes authFadeIn { from { opacity:0; transform:translateY(16px); } }
.auth-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 24px; color: #9ca3af; cursor: pointer;
}
.auth-close:hover { color: #374151; }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; color: #1e3a8a; }
.auth-header p { margin: 0; }

/* Social buttons */
.auth-social { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid #d1d5db;
  background: #fff; color: #374151; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.auth-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.auth-google:hover { border-color: #4285F4; }
.auth-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.auth-facebook:hover { background: #166FE5; }
.auth-facebook svg path { fill: #fff; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: #9ca3af; font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

/* Tabs */
.auth-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #e5e7eb; }
.auth-tab {
  flex: 1; padding: 8px 0; text-align: center; font-weight: 600; font-size: 14px;
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; color: #6b7280; cursor: pointer; transition: all .15s;
}
.auth-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form[hidden] { display: none; }
.auth-form input {
  padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; color: #1f2937; background: #f9fafb;
  transition: border-color .15s;
}
.auth-form input:focus { outline: none; border-color: #2563eb; background: #fff; }
.auth-submit {
  padding: 10px 16px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.auth-submit:hover { opacity: .9; }
.auth-forgot, .auth-back-login {
  font-size: 13px; color: #2563eb; text-align: center;
  text-decoration: none; margin-top: -4px;
}
.auth-forgot:hover, .auth-back-login:hover { text-decoration: underline; }
.auth-error { color: #dc2626; font-size: 13px; font-weight: 500; padding: 4px 0; }
.auth-success { color: #16a34a; font-size: 13px; font-weight: 500; padding: 4px 0; }

/* User badge in header */
.auth-user-badge {
  display: flex; align-items: center; gap: 8px;
}
.auth-avatar-img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.auth-avatar-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.auth-user-name {
  font-size: 13px; font-weight: 600; color: #e5e7eb;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-login-btn {
  padding: 6px 16px; border-radius: 8px; border: 1px solid #3b82f6;
  background: transparent; color: #60a5fa; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.auth-login-btn:hover { background: #2563eb; color: #fff; }
.auth-logout-btn {
  background: none; border: none; color: #9ca3af; font-size: 14px;
  cursor: pointer; padding: 2px 4px; line-height: 1;
}
.auth-logout-btn:hover { color: #ef4444; }
