/* ============================================
   Q&A REDESIGN — Filters, Vote Column, Best Answer, Modal
   ============================================ */

:root {
  --qa-brand-orange: #ff5200;
  --qa-brand-orange-light: #FFF3EC;
  --qa-brand-orange-hover: #D9621A;
  --qa-green-bg: #ECFDF5;
  --qa-green-border: #34D399;
  --qa-green-text: #065F46;
  --qa-green-badge: #059669;
  --qa-red-light: #FEF2F2;
  --qa-red-text: #991B1B;
  --qa-gray-50: #F9FAFB;
  --qa-gray-100: #F3F4F6;
  --qa-gray-200: #E5E7EB;
  --qa-gray-300: #D1D5DB;
  --qa-gray-400: #9CA3AF;
  --qa-gray-500: #6B7280;
  --qa-gray-600: #4B5563;
  --qa-gray-700: #374151;
  --qa-gray-800: #1F2937;
  --qa-gray-900: #111827;
  --qa-purple-bg: #F3E8FF;
  --qa-purple-text: #6B21A8;
  --qa-blue-bg: #EFF6FF;
  --qa-blue-text: #1D4ED8;
  --qa-radius-sm: 6px;
  --qa-radius-md: 10px;
  --qa-radius-lg: 14px;
}

/* ============================================
   FILTERS BAR
   ============================================ */
.filters-bar {
  background: white;
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--qa-gray-100);
  margin-bottom: 12px;
  border-radius: var(--qa-radius-md);
  flex-wrap: nowrap;
}
.filters-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--qa-gray-200);
  background: white;
  color: var(--qa-gray-600);
  text-decoration: none;
}
.filter-chip:hover {
  border-color: var(--qa-gray-300);
  background: var(--qa-gray-50);
  text-decoration: none;
  color: var(--qa-gray-600);
}
.filter-chip.active {
  background: var(--qa-brand-orange-light);
  border-color: var(--qa-brand-orange);
  color: var(--qa-brand-orange);
}
.filter-chip .count {
  font-size: 11px;
  background: var(--qa-gray-100);
  color: var(--qa-gray-500);
  border-radius: 10px;
  padding: 1px 6px;
}
.filter-chip.active .count {
  background: var(--qa-brand-orange);
  color: white;
}

/* Sort dropdown */
.sort-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--qa-gray-200);
  background: white;
  color: var(--qa-gray-600);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  white-space: nowrap;
}

/* ============================================
   ANSWER CARD (vote column layout)
   ============================================ */
.answer-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--qa-radius-md);
  border: 1px solid var(--qa-gray-200);
  margin-bottom: 10px;
  background: white;
  transition: border-color 0.15s;
  position: relative;
}

.answer-card.best-answer {
  background: var(--qa-green-bg);
  border: 2px solid var(--qa-green-border);
}

.best-badge {
  position: absolute;
  bottom: -22px;
  right: 10px;
  background: var(--qa-green-badge);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.best-badge svg {
  width: 12px;
  height: 12px;
}

/* Vote column */
.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 32px;
}
.vote-btn {
  width: 30px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--qa-gray-200);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 10px;
  padding: 0;
  line-height: 1;
}
.vote-btn:hover {
  background: var(--qa-gray-50);
  border-color: var(--qa-gray-300);
}
.vote-btn.up:hover { border-color: var(--qa-green-border); color: var(--qa-green-text); }
.vote-btn.down:hover { border-color: #FCA5A5; color: var(--qa-red-text); }
.vote-btn.voted-up {
  background: var(--qa-green-bg);
  border-color: var(--qa-green-border);
  color: var(--qa-green-text);
}
.vote-btn.voted-down {
  background: var(--qa-red-light);
  border-color: #FCA5A5;
  color: var(--qa-red-text);
}
.vote-btn.voted {
  pointer-events: none;
  opacity: 0.5;
}
.vote-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--qa-gray-700);
  line-height: 1.2;
  padding: 2px 0;
}
.answer-card.best-answer .vote-count {
  color: var(--qa-green-text);
}

/* Answer content */
.answer-content {
  flex: 1;
  min-width: 0;
}
.answer-word {
  font-size: 19px;
  font-weight: 700;
  color: var(--qa-gray-900);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--qa-gray-500);
  flex-wrap: wrap;
}
.answer-meta .avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
}
.answer-meta .username {
  color: var(--qa-gray-600);
  font-weight: 500;
}
.answer-meta .username a {
  color: var(--qa-gray-600);
  font-weight: 500;
  text-decoration: none;
}
.answer-meta .username a:hover {
  color: var(--qa-brand-orange);
}
.answer-meta .level {
  color: var(--qa-gray-400);
}
.answer-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--qa-gray-300);
  flex-shrink: 0;
}

/* Select best answer button */
.select-best-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--qa-green-text);
  background: var(--qa-green-bg);
  border: 1px solid var(--qa-green-border);
  cursor: pointer;
  transition: all 0.15s;
}
.select-best-btn:hover {
  color: var(--qa-green-text);
  border-color: var(--qa-green-border);
  background: var(--qa-green-bg);
}
.select-best-btn svg {
  width: 14px;
  height: 14px;
}

/* Answer input row */
.answer-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--qa-gray-100);
  background: var(--qa-gray-50);
  border-radius: 0 0 var(--qa-radius-lg) var(--qa-radius-lg);
}

/* Answers section header */
.answers-section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--qa-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
  margin-top: 12px;
}

/* CTA for no answers */
.cta-first-answer {
  text-align: center;
  padding: 20px 15px;
  background: var(--qa-brand-orange-light);
  border-radius: 8px;
  border: 1px dashed var(--qa-brand-orange);
  margin: 10px 0;
}
.cta-first-answer i {
  font-size: 24pt;
  color: var(--qa-brand-orange);
  margin-bottom: 8px;
  display: block;
}
.cta-first-answer strong {
  font-size: 13pt;
  color: var(--qa-brand-orange);
}

/* ============================================
   QUESTION CARD
   ============================================ */
.question-card {
  background: white;
  border-radius: var(--qa-radius-lg);
  border: 1px solid var(--qa-gray-200);
  overflow: hidden;
  transition: border-color 0.15s;
  margin-bottom: 16px;
}
.question-card:hover {
  border-color: var(--qa-gray-300);
}

.question-header {
  padding: 14px 16px 12px;
}

.question-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--qa-brand-orange);
  line-height: 1.4;
  margin-bottom: 8px;
  text-decoration: none;
  display: block;
}
.question-title:hover {
  color: var(--qa-brand-orange-hover);
  text-decoration: none;
}

.question-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--qa-gray-600);
}
.question-meta-row {
  margin-top: 8px;
}

.question-meta .avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--qa-brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.question-meta .avatar-mini.anon {
  background: var(--qa-gray-400);
}

.question-meta .username {
  color: var(--qa-gray-600);
  font-weight: 500;
}
.question-meta .username a {
  color: var(--qa-gray-600);
  font-weight: 500;
  text-decoration: none;
}
.question-meta .username a:hover {
  color: var(--qa-brand-orange);
}

.question-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--qa-gray-300);
  display: inline-block;
  flex-shrink: 0;
}

.letter-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--qa-gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--qa-gray-500);
  flex-shrink: 0;
}

.letters-available {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.letter-box {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--qa-brand-orange);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--qa-gray-800);
}
.letter-box.empty {
  border-color: var(--qa-gray-200);
  background: var(--qa-gray-50);
}

/* Question footer — answer stats */
.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--qa-gray-100);
  background: var(--qa-gray-50);
}

.q-answer-count {
  font-size: 14px;
  color: var(--qa-gray-500);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.q-answer-count.has-answers { color: var(--qa-green-text); }
.q-answer-count.has-best { color: var(--qa-green-badge); font-weight: 600; }
.q-answer-count svg { width: 14px; height: 14px; }

.time-ago {
  font-size: 12px;
  color: var(--qa-gray-500);
}

/* CTA for no answers (footer strip) */
.cta-first {
  padding: 10px 16px;
  border-top: 1px solid var(--qa-gray-100);
  background: var(--qa-brand-orange-light);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--qa-brand-orange);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
}
.cta-first:hover {
  background: #FFE8D6;
  text-decoration: none;
  color: var(--qa-brand-orange);
}

/* ============================================
   FOLLOW BUTTON (watchlist — bell icon)
   ============================================ */
.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--qa-gray-500);
  background: var(--qa-gray-50);
  border: 1px solid var(--qa-gray-200);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.follow-btn:hover {
  border-color: var(--qa-brand-orange);
  color: var(--qa-brand-orange);
  text-decoration: none;
}
.follow-btn.active {
  background: var(--qa-brand-orange-light);
  border-color: var(--qa-brand-orange);
  color: var(--qa-brand-orange);
}
.follow-btn i {
  font-size: 16px;
}

/* ============================================
   QUESTION CARD — ANSWERS DETAIL (expanded)
   ============================================ */
.question-answers-detail {
  padding: 0 16px 12px;
}

/* Delete button on profile */
.question-delete-btn {
  color: var(--qa-gray-400);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.15s;
}
.question-delete-btn:hover {
  color: var(--qa-red-text);
}

/* ============================================
   LEGACY LETTER BOXES (kept for other pages)
   ============================================ */
.sb-md {
  display: inline-block;
  border: 1px solid #ff5200;
  border-radius: .5rem;
  background-color: #f3f3f9;
  color: #000;
  margin: 4px 1px;
  min-width: 12px;
  padding: 8pt;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none !important;
  min-width: 25pt;
  min-height: 25pt;
  line-height: 1em;
  width: 25pt;
  border-radius: .75rem;
  font-size: 12pt;
}

