/* ==========================================================================
   VectoreAI — Community, Interaction & Member Components
   Theme-aware, accessible, adhering to AetherMind Experience System
   ========================================================================== */

/* --- Public Header Member & Auth Controls --- */
.nav-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  white-space: nowrap;
}
.nav-member-badge:hover {
  border-color: var(--cyan);
  background: rgba(var(--cyan-rgb), .08);
  transform: translateY(-1px);
}
.member-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  flex-shrink: 0;
}
.member-spins-pill {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.7rem;
}
.nav-signin-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.nav-signin-link:hover {
  color: var(--cyan);
  border-color: var(--line);
}

/* Mobile drawer auth section */
.mobile-drawer-auth {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer-auth a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  font-size: 0.95rem;
}
.mobile-drawer-auth .auth-account-link {
  color: var(--cyan);
  font-weight: 700;
}
.mobile-drawer-auth .auth-logout-link {
  color: var(--danger);
  font-size: 0.85rem;
}
.mobile-drawer-auth .auth-join-link {
  color: var(--cyan);
  font-weight: 700;
}

/* Responsive header constraints: prevent header crowding on small viewports */
@media (max-width: 480px) {
  .nav-member-badge .member-name { display: none; }
  .nav-member-badge { padding: 5px 8px; gap: 4px; }
}
@media (max-width: 380px) {
  .nav-member-badge,
  .nav-signin-link {
    display: none !important;
  }
}

/* --- Article Reader Controls (Like Pill) --- */
.btn-like-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.btn-like-pill:hover,
.btn-like-pill.liked {
  border-color: rgba(255, 113, 126, .5);
  color: var(--danger);
  background: rgba(255, 113, 126, .1);
}
.btn-like-pill.liked .like-icon {
  transform: scale(1.18);
}
.btn-share-ref {
  color: var(--gold) !important;
}
.btn-share-ref:hover {
  background: rgba(255, 209, 132, .15) !important;
}

/* --- Signal Appreciation Bar --- */
.signal-appreciation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0;
  padding: 18px 24px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .04);
}
.appreciation-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-big-like {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.btn-big-like:hover,
.btn-big-like.liked {
  border-color: rgba(255, 113, 126, .6);
  background: rgba(255, 113, 126, .12);
  color: var(--danger);
  box-shadow: 0 0 15px rgba(255, 113, 126, .2);
}
.btn-big-like.liked .heart-icon {
  transform: scale(1.25);
  display: inline-block;
}
.heart-icon {
  color: var(--danger);
  font-size: 1.1rem;
  transition: transform .2s ease;
}
.like-badge {
  background: rgba(var(--cyan-rgb), .1);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
}
.appreciation-note {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.4;
}
.btn-share-referral {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(var(--cyan-rgb), .08);
  border: 1px solid rgba(var(--cyan-rgb), .25);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s ease;
}
.btn-share-referral:hover {
  background: rgba(var(--cyan-rgb), .16);
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(var(--cyan-rgb), .25);
}

/* --- Article Discussion / Comments Section --- */
.article-comments-section {
  margin: 48px 0;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.discussion-title {
  font-family: var(--display);
  font-size: 2rem;
  margin: 4px 0 0;
  color: var(--ink);
}
.comments-badge {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--cyan);
  vertical-align: middle;
}
.discussion-guideline-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.comment-submission-panel {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
}
.submission-guest-notice {
  text-align: center;
  padding: 16px 8px;
}
.submission-guest-notice p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.submission-guest-btns {
  display: inline-flex;
  gap: 12px;
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reply-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(var(--cyan-rgb), .08);
  border: 1px solid rgba(var(--cyan-rgb), .2);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
}
.reply-indicator button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.reply-indicator button:hover {
  color: var(--danger);
}
.comment-input-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  outline: none;
  resize: vertical;
  transition: border-color .2s ease;
}
.comment-input-wrap textarea:focus {
  border-color: var(--cyan);
}
.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.char-counter {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.comment-status-msg {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
}

/* Comments Stream */
.comments-stream {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.comment-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color .2s ease;
}
.comment-card:hover {
  border-color: var(--line-bright);
}
.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.comment-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comment-author-names {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.comment-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.comment-author-handle {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.comment-meta-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comment-time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.comment-body-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.comment-btn-action {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color .2s;
}
.comment-btn-action:hover {
  color: var(--cyan);
}
.comment-btn-delete:hover {
  color: var(--danger);
}

/* Threaded Replies (Theme-Aware) */
.comment-replies-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  padding-left: 20px;
  border-left: 2px solid rgba(var(--cyan-rgb), .25);
}
.reply-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* Interaction Dialogs */
dialog.referral-share-modal,
dialog.comment-report-modal {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(var(--canvas-rgb), .75);
  backdrop-filter: blur(4px);
}
.ref-modal-content {
  padding: 24px;
  position: relative;
}
.ref-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.ref-modal-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 8px 0 20px;
}
.ref-modal-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.ref-modal-link-box input {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  outline: none;
}
.btn-copy-ref {
  background: var(--cyan);
  color: #05070b;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  padding: 0 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.ref-social-shortcuts {
  display: flex;
  gap: 10px;
}
.btn-ref-social {
  flex: 1;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: border-color .2s;
}
.btn-ref-social:hover {
  border-color: var(--line-bright);
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.report-field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.report-field select,
.report-field textarea {
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--sans);
  font-size: 0.85rem;
  outline: none;
}
.stream-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(var(--cyan-rgb), .2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 20px auto 10px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.comments-loading {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 20px;
}

/* --- Community Member Pages (Account, Profile, Auth) --- */
.community-panel {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, .04);
}
.community-input,
.community-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.community-input:focus,
.community-textarea:focus {
  border-color: var(--cyan);
}
.community-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  padding-bottom: 1px;
}
.community-tab-link {
  padding: 10px 18px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: color .2s ease, border-color .2s ease;
}
.community-tab-link:hover {
  color: var(--ink);
}
.community-tab-link.is-active {
  border-bottom-color: var(--cyan);
  color: var(--ink);
}

/* Data Tables on Public Pages (e.g. Ledger, Referrals) */
.admin-table-shell {
  overflow-x: auto;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.admin-table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.admin-table tr:last-child td {
  border-bottom: none;
}
