/* ============================================================
   URBot FAQ Widget Styles
   Dark theme accordion with search, helpful votes, guide cards
   ============================================================ */

.urbot-faq-widget {
  --faq-bg: #0f1117;
  --faq-surface: #1a1d27;
  --faq-border: #2a2d3a;
  --faq-text: #e2e4ea;
  --faq-text-muted: #8b8fa4;
  --faq-accent: #3b82f6;
  --faq-accent-hover: #60a5fa;
  --faq-green: #22c55e;
  --faq-red: #ef4444;
  --faq-radius: 8px;
  --faq-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--faq-text);
  max-width: 800px;
  margin: 0 auto;
}

/* ---- Search ---- */
.faq-search-wrap {
  margin-bottom: 1.5rem;
}

.faq-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-radius);
  background: var(--faq-surface);
  color: var(--faq-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--faq-transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b8fa4' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  box-sizing: border-box;
}

.faq-search-input:focus {
  border-color: var(--faq-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.faq-search-input::placeholder {
  color: var(--faq-text-muted);
}

/* ---- Category Sections ---- */
.faq-category {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.faq-category--visible {
  opacity: 1;
  transform: translateY(0);
}

.faq-category-header {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faq-accent);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--faq-border);
}

/* ---- Accordion Item ---- */
.faq-item {
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-radius);
  margin-bottom: 0.5rem;
  background: var(--faq-surface);
  overflow: hidden;
  transition: border-color var(--faq-transition);
}

.faq-item:hover {
  border-color: var(--faq-accent);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  background: none;
  color: var(--faq-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  gap: 0.75rem;
  font-family: inherit;
}

.faq-question:focus-visible {
  outline: 2px solid var(--faq-accent);
  outline-offset: -2px;
}

.faq-q-text {
  flex: 1;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
  transition: transform var(--faq-transition);
}

.faq-chevron::before,
.faq-chevron::after {
  content: '';
  position: absolute;
  background: var(--faq-text-muted);
  border-radius: 1px;
}

.faq-chevron::before {
  width: 10px;
  height: 2px;
  top: 9px;
  left: 2px;
  transform: rotate(45deg);
}

.faq-chevron::after {
  width: 10px;
  height: 2px;
  top: 9px;
  right: 2px;
  transform: rotate(-45deg);
}

.faq-item--open .faq-chevron {
  transform: rotate(180deg);
}

/* ---- Answer ---- */
.faq-answer-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s ease;
}

.faq-item--open .faq-answer-wrap {
  max-height: 600px;
  padding: 0 1.25rem 1rem;
}

.faq-answer {
  color: var(--faq-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---- Helpful Votes ---- */
.faq-helpful {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--faq-border);
}

.faq-helpful-label {
  font-size: 0.8rem;
  color: var(--faq-text-muted);
  margin-right: 0.25rem;
}

.faq-helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--faq-border);
  border-radius: 999px;
  background: transparent;
  color: var(--faq-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--faq-transition);
  font-family: inherit;
}

.faq-helpful-btn:hover:not(:disabled) {
  border-color: var(--faq-accent);
  color: var(--faq-text);
}

.faq-helpful-yes:hover:not(:disabled) {
  border-color: var(--faq-green);
  color: var(--faq-green);
}

.faq-helpful-no:hover:not(:disabled) {
  border-color: var(--faq-red);
  color: var(--faq-red);
}

.faq-helpful-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.faq-helpful-btn--voted {
  opacity: 1 !important;
  border-color: var(--faq-accent);
  color: var(--faq-accent);
}

.faq-thumb {
  font-size: 0.85rem;
}

.faq-vote-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ---- Empty State ---- */
.faq-empty {
  text-align: center;
  color: var(--faq-text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

/* ---- Guides Section ---- */
.faq-guides-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--faq-text);
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--faq-border);
}

.faq-guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.faq-guide-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-radius);
  background: var(--faq-surface);
  text-decoration: none;
  color: var(--faq-text);
  transition: border-color var(--faq-transition), transform var(--faq-transition);
}

.faq-guide-card:hover {
  border-color: var(--faq-accent);
  transform: translateY(-2px);
}

.faq-guide-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faq-accent);
  margin-bottom: 0.5rem;
}

.faq-guide-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.faq-guide-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.faq-guide-time {
  font-size: 0.75rem;
  color: var(--faq-text-muted);
}

.faq-guide-featured {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--faq-accent);
  color: #fff;
  border-radius: 999px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .faq-guides-grid {
    grid-template-columns: 1fr;
  }

  .faq-question {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }

  .faq-helpful {
    flex-wrap: wrap;
  }
}
