/* RishionBot v4 — Guided Assistant styles (scoped to .rb-* selectors only) */

/* ─── Page Layout ────────────────────────────────────────────── */
.rb-guide-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ─── Hero Section ───────────────────────────────────────────── */
.rb-hero {
  background: linear-gradient(135deg, #e8eaed 0%, #f4f5f7 100%);
  border-radius: 16px;
  padding: 40px 28px 36px;
  text-align: center;
  margin-bottom: 28px;
}
.rb-hero-logo {
  height: 140px;
  max-width: 90%;
  object-fit: contain;
  margin: 0 auto 2px;
  display: block;
}
.rb-hero-subtitle {
  font-size: 1.05rem;
  color: #4a5568;
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

/* ─── Topic Cards Grid ───────────────────────────────────────── */
.rb-topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.rb-topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.rb-topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: var(--c-primary, #2563eb);
}
.rb-topic-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rb-topic-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--c-primary, #2563eb);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rb-topic-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-text, #0f172a);
}
.rb-topic-count {
  font-size: 0.75rem;
  color: var(--c-text-muted, #64748b);
}
.rb-topic-card--image {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
  border-color: rgba(37, 99, 235, 0.15);
}
.rb-topic-card--image .rb-topic-icon {
  background: rgba(37, 99, 235, 0.12);
}

/* ─── Panel Header (shared) ──────────────────────────────────── */
.rb-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.rb-panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-text, #0f172a);
  margin: 0;
}

/* ─── Back Button ────────────────────────────────────────────── */
.rb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--c-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.rb-back-btn:hover {
  background: var(--c-bg, #f1f5f9);
  color: var(--c-text, #0f172a);
  border-color: var(--c-primary, #2563eb);
}
.rb-back-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ─── Questions List ─────────────────────────────────────────── */
.rb-questions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rb-question-item {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  transition: all 0.15s ease;
  color: inherit;
}
.rb-question-item:hover {
  border-color: var(--c-primary, #2563eb);
  background: rgba(37, 99, 235, 0.03);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.rb-question-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text, #0f172a);
  line-height: 1.5;
}
.rb-question-summary {
  font-size: 0.8rem;
  color: var(--c-text-muted, #64748b);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Answer Panel ───────────────────────────────────────────── */
.rb-answer-panel {
  animation: rb-fadeIn 0.3s ease;
}
.rb-answer-card {
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.rb-answer-question {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text, #0f172a);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ─── Category Badge ─────────────────────────────────────────── */
.rb-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* ─── Answer Body ────────────────────────────────────────────── */
.rb-answer-body {
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--c-text, #0f172a);
}
.rb-answer-body a {
  color: var(--c-primary, #2563eb);
  text-decoration: underline;
}

/* ─── Inline Link ────────────────────────────────────────────── */
.rb-inline-link {
  color: var(--c-primary, #2563eb);
  text-decoration: underline;
  font-weight: 500;
}
.rb-inline-link:hover {
  text-decoration: none;
}

/* ─── Chips (shared) ─────────────────────────────────────────── */
.rb-chips,
.rb-related-chips,
.rb-refinement-chips,
.rb-followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.rb-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--c-primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: start;
  line-height: 1.3;
}
.rb-chip:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
}
.rb-related-label,
.rb-refinement-label {
  font-size: 0.75rem;
  color: var(--c-text-muted, #64748b);
  margin-top: 16px;
  margin-bottom: 4px;
}

/* ─── Image Discovery ────────────────────────────────────────── */
.rb-image-tags-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rb-image-tag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--c-text, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.rb-image-tag-btn:hover {
  border-color: var(--c-primary, #2563eb);
  background: rgba(37, 99, 235, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.rb-image-tag-btn.active {
  background: var(--c-primary, #2563eb);
  color: #fff;
  border-color: var(--c-primary, #2563eb);
}

/* ─── Photo Grid (reused from v3) ────────────────────────────── */
.rb-photo-intro {
  margin-bottom: 14px;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--c-text, #0f172a);
}
.rb-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.rb-photo-card {
  display: block;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--c-border, #e2e8f0);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--c-surface, #fff);
}
.rb-photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.rb-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.rb-photo-info {
  padding: 6px 8px 8px;
}
.rb-photo-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c-text, #0f172a);
}
.rb-photo-meta {
  font-size: 0.72rem;
  color: var(--c-text-muted, #64748b);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-no-results {
  text-align: center;
  color: var(--c-text-muted, #64748b);
  padding: 24px 0;
  font-size: 0.9rem;
}

/* ─── Loading Spinner ────────────────────────────────────────── */
.rb-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.rb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border, #e2e8f0);
  border-top-color: var(--c-primary, #2563eb);
  border-radius: 50%;
  animation: rb-spin 0.7s linear infinite;
}
@keyframes rb-spin {
  to { transform: rotate(360deg); }
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes rb-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rb-animate-in {
  animation: rb-fadeIn 0.3s ease;
}

/* ─── RTL Support ────────────────────────────────────────────── */
[dir="rtl"] .rb-back-btn svg {
  transform: scaleX(-1);
}
[dir="rtl"] .rb-question-item {
  text-align: right;
}

/* ─── Responsive: Tablet ─────────────────────────────────────── */
@media (max-width: 900px) {
  .rb-guide-page {
    padding: 12px 10px 40px;
  }
  .rb-hero {
    padding: 30px 20px 28px;
    border-radius: 12px;
  }
}

/* ─── Responsive: Mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
  .rb-guide-page {
    padding: 8px 8px 32px;
  }
  .rb-hero {
    padding: 28px 16px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
  }
  .rb-hero-logo {
    height: 90px;
  }
  .rb-hero-subtitle {
    font-size: 0.9rem;
  }
  .rb-topics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rb-topic-card {
    flex-direction: row;
    padding: 18px 16px;
    gap: 14px;
    justify-content: flex-start;
    text-align: start;
  }
  .rb-question-item {
    padding: 14px 16px;
  }
  .rb-answer-card {
    padding: 18px 16px;
    border-radius: 12px;
  }
  .rb-image-tags-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .rb-image-tag-btn {
    padding: 14px 10px;
    font-size: 0.85rem;
  }
  .rb-chip {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .rb-photo-grid {
    gap: 8px;
  }
  .rb-photo-info {
    padding: 4px 6px 6px;
  }
  .rb-photo-title {
    font-size: 0.78rem;
  }
  .rb-photo-meta {
    font-size: 0.68rem;
  }
}
