/* Quantum Siddhar — Search Page */
/* Uses course's existing classes: hero-gradient, gold-shimmer, slide-up, card, module-card, etc. */

/* ─── Naukri-style Search Bar ─── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 8px 8px 8px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: border-color 0.3s, box-shadow 0.3s;
  min-height: 64px;
}

.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(74,108,247,0.15);
}

.search-bar__icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 14px;
}

.search-bar__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  padding: 14px 0;
  font-family: inherit;
}

.search-bar__input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.search-bar__clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.search-bar__clear:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.search-bar__divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ─── Custom Dropdown ─── */
.search-bar__dropdown {
  position: relative;
  flex-shrink: 0;
}

.search-bar__dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.search-bar__dropdown-trigger:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.search-bar__dropdown-arrow {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.search-bar__dropdown-trigger.open .search-bar__dropdown-arrow {
  transform: rotate(180deg);
}

.search-bar__dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: all 0.2s ease;
  z-index: 100;
}

.search-bar__dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.search-bar__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.search-bar__dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.search-bar__dropdown-item.active {
  background: rgba(74,108,247,0.1);
  color: var(--gold);
  font-weight: 600;
}

.search-bar__dropdown-item.active::after {
  content: '✓';
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--gold);
}

.search-bar__btn {
  background: var(--gradient-gold);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.search-bar__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74,108,247,0.3);
}

.search-bar__btn:active {
  transform: translateY(0);
}

/* ─── Filter Chips ─── */
.search-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  justify-content: center;
}

.search-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.search-chip:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.search-chip.active {
  background: var(--gradient-gold);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

/* ─── Results ─── */
.search-results-wrap {
  padding: 40px 0 60px;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.search-results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.search-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-result-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.search-result-card__book {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.search-result-card__section {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.search-result-card__text {
  font-size: 1.05rem;
  line-height: 1.9;
  white-space: pre-line;
}

.search-result-card__text mark {
  background: rgba(74,108,247,0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

/* ─── Pagination ─── */
.search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.search-pagination__btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.search-pagination__btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--text-primary);
}

.search-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-pagination__btn.active {
  background: var(--gradient-gold);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.search-pagination__info {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ─── Loading spinner for search ─── */
.search-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

/* ─── Breadcrumb / Back Link ─── */
.section-view__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem !important;
  font-weight: 600;
  color: var(--gold) !important;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(74,108,247,0.08);
  border: 1px solid rgba(74,108,247,0.2);
  transition: all 0.2s;
}

.section-view__back:hover {
  background: rgba(74,108,247,0.15);
  border-color: var(--gold);
}

/* ─── Verse List (book browse) ─── */
.verse-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verse-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.verse-list-item:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(74,108,247,0.1);
  transform: translateX(4px);
}

.verse-list-item__num {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74,108,247,0.1);
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.verse-list-item__preview {
  flex: 1;
  min-width: 0;
}

.verse-list-item__label {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.verse-list-item__text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.6;
}

.verse-list-item__arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.verse-list-item:hover .verse-list-item__arrow {
  color: var(--gold);
  transform: translateX(2px);
}

/* ─── Verse Detail — Premium Sacred Text ─── */
.verse-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  min-height: 100vh;
  animation: verseFadeIn 0.4s ease;
}

@keyframes verseFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.verse-page__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.verse-page__breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.verse-page__breadcrumb a:hover {
  color: var(--gold);
}

.verse-page__breadcrumb-sep {
  opacity: 0.4;
}

.verse-page__label {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.verse-page__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.verse-page__ornament::before,
.verse-page__ornament::after {
  content: '';
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, #b8964e);
}

.verse-page__ornament::after {
  background: linear-gradient(90deg, #b8964e, transparent);
}

.verse-page__ornament-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b8964e;
  opacity: 0.7;
}

/* Verse stage — centered verse container */
.verse-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.verse-stage__line {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #f5f0e8;
  text-align: center;
  width: 100%;
  opacity: 0;
  animation: verseLineIn 0.4s ease forwards;
}

.verse-stage__line:nth-child(even) {
  margin-bottom: 20px;
}

.verse-stage__line:last-child {
  margin-bottom: 0;
}

@keyframes verseLineIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lock section — compact */
.verse-page__lock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 32px;
}

.verse-page__lock-icon {
  font-size: 0.85rem;
  opacity: 0.5;
}

.verse-page__lock-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Nav — prev/next */
.verse-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.verse-nav__btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  min-width: 130px;
}

.verse-nav__btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(184,150,78,0.12);
}

.verse-nav__dir {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.verse-nav__title {
  font-size: 0.85rem;
}

/* ─── Light Theme Overrides ─── */
[data-theme="light"] .verse-stage__line {
  color: #2a2520;
}

[data-theme="light"] .verse-page__ornament::before {
  background: linear-gradient(90deg, transparent, #c4a35a);
}

[data-theme="light"] .verse-page__ornament::after {
  background: linear-gradient(90deg, #c4a35a, transparent);
}

[data-theme="light"] .verse-page__ornament-dot {
  background: #c4a35a;
}

[data-theme="light"] .verse-page__breadcrumb,
[data-theme="light"] .verse-page__breadcrumb a {
  color: #b0a898;
}

[data-theme="light"] .verse-page__label {
  color: #b0a898;
}

[data-theme="light"] .verse-nav__btn:hover {
  box-shadow: 0 0 16px rgba(184,150,78,0.08);
  background: rgba(184,150,78,0.04);
}

/* ─── Decode Flowchart ─── */
.decode {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.decode__header {
  text-align: center;
  margin-bottom: 12px;
}

.decode__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
}

.decode__summary {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 8px;
}

.decode__siddhars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.decode__siddhar-badge {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(184,150,78,0.3);
  color: var(--gold);
  background: rgba(184,150,78,0.06);
  white-space: nowrap;
}

.decode__siddhar-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Timeline */
.decode-flow {
  position: relative;
  padding-left: 36px;
}

.decode-flow::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, #b8964e, rgba(184,150,78,0.15));
  border-radius: 2px;
}

/* Step */
.decode-step {
  position: relative;
  margin-bottom: 28px;
  animation: verseFadeIn 0.4s ease;
}

.decode-step:last-child {
  margin-bottom: 0;
}

.decode-step__dot {
  position: absolute;
  left: -36px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid #b8964e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 1;
}

.decode-step__coded {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 6px;
  font-style: italic;
}

.decode-step__keyword {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  padding: 2px 10px;
  border: 1px solid rgba(184,150,78,0.3);
  border-radius: 6px;
  background: rgba(184,150,78,0.06);
  margin-bottom: 8px;
}

.decode-step__arrow {
  display: inline-block;
  color: var(--gold);
  margin: 0 8px;
  font-size: 0.75rem;
}

.decode-step__dict {
  font-size: 0.82rem;
  color: var(--gold);
  opacity: 0.85;
  line-height: 1.5;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: rgba(212,175,55,0.06);
  border-left: 2px solid var(--gold);
  border-radius: 0 4px 4px 0;
}

.decode-step__decoded {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5f0e8;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Science bridge */
.decode-step__science {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 8px 12px;
  background: rgba(74,108,247,0.04);
  border-left: 2px solid rgba(74,108,247,0.3);
  border-radius: 0 6px 6px 0;
  margin-bottom: 10px;
}

.decode-step__science-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(74,108,247,0.6);
  margin-bottom: 4px;
}

/* Proof badges */
.decode-step__proofs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.decode-proof {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(184,150,78,0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.decode-proof:hover {
  border-color: rgba(184,150,78,0.3);
  color: var(--gold);
}

/* Expanded proof */
.decode-proof-detail {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: none;
}

.decode-proof-detail.open {
  display: block;
}

.decode-proof-detail__line {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid rgba(184,150,78,0.3);
}

.decode-proof-detail__line-book {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 600;
}

.decode-proof-detail__line-text {
  color: var(--text-secondary);
}

/* Decode stats footer */
.decode__footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.decode__footer-stat {
  display: inline-block;
  margin: 0 10px;
}

.decode__footer-num {
  font-weight: 700;
  color: var(--gold);
}

/* Light theme decode overrides */
[data-theme="light"] .decode-step__dict {
  background: rgba(212,175,55,0.08);
  color: #8b7330;
}

[data-theme="light"] .decode-step__decoded {
  color: #2a2520;
}

[data-theme="light"] .decode-step__science {
  background: rgba(74,108,247,0.03);
}

[data-theme="light"] .decode-proof-detail {
  background: #faf8f5;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .search-bar {
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 10px;
    min-height: auto;
    gap: 0;
  }

  .search-bar__icon {
    margin-right: 8px;
    margin-left: 4px;
  }

  .search-bar__input {
    font-size: 1rem;
    padding: 10px 0;
  }

  .search-bar__divider {
    display: none;
  }

  .search-bar__dropdown {
    width: 100%;
    order: 4;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 4px;
  }

  .search-bar__dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .search-bar__dropdown-menu {
    left: 0;
    right: 0;
    min-width: auto;
  }

  .search-bar__btn {
    padding: 10px 18px;
    font-size: 0.95rem;
  }

  .search-bar__clear {
    order: 2;
  }

  .search-result-card {
    padding: 16px;
  }

  .search-result-card__text {
    font-size: 0.95rem;
  }

  .verse-list-item {
    padding: 12px 14px;
    gap: 12px;
  }

  .verse-list-item__num {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .verse-list-item__text {
    font-size: 0.85rem;
  }

  .verse-page {
    padding: 90px 16px 40px;
  }

  .verse-stage__line {
    font-size: 0.98rem;
    line-height: 1.8;
  }

  .verse-stage__line:nth-child(even) {
    margin-bottom: 16px;
  }

  .verse-nav__btn {
    min-width: 100px;
    padding: 8px 12px;
  }

  .decode-flow {
    padding-left: 30px;
  }

  .decode-flow::before {
    left: 11px;
  }

  .decode-step__dot {
    left: -30px;
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  .decode-step__decoded {
    font-size: 0.88rem;
  }

  .decode__siddhars {
    gap: 4px;
  }
}

/* ─── Book Confidence Stars ─── */
.book-confidence {
  margin-top: 4px;
  font-size: 0.75rem;
}

.book-confidence__stars {
  color: var(--gold, #d4af37);
  letter-spacing: 1px;
  font-size: 0.8rem;
}

[data-theme="light"] .book-confidence__stars {
  color: #b8942e;
}
