/* ===========================================
   BUSINESS IDEAS HUB - MEMPHIS DARK THEME
   Extends detail.css variables and patterns
   =========================================== */

/* ===========================================
   HUB PAGE CONTAINER
   =========================================== */

.bi-hub-page {
  max-width: 1200px;
  padding: 32px 24px 80px;
}

@media (max-width: 640px) {
  .bi-hub-page {
    padding: 20px 16px 60px;
  }
}

/* ===========================================
   HERO HEADER
   =========================================== */

.bi-hub-hero {
  position: relative;
  padding: 64px 24px 48px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 32px;
}

.bi-hub-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, var(--bi-teal-glow) 0%, var(--bi-purple-glow) 40%, transparent 70%);
  pointer-events: none;
}

.bi-hub-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bi-border), transparent);
}

/* Counter Badge */
.bi-hub-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bi-teal-glow);
  border: 1px solid rgba(77, 184, 168, 0.2);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--bi-teal);
  margin-bottom: 20px;
  animation: fadeDown 0.5s ease-out both;
}

.bi-hub-counter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bi-teal);
  animation: pulse 2s ease-in-out infinite;
}

.bi-hub-counter-value {
  font-weight: 700;
}

.bi-hub-counter-label {
  font-weight: 400;
}

/* Title */
.bi-hub-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--bi-text-primary) 20%, var(--bi-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeDown 0.5s ease-out 0.05s both;
}

/* Subtitle */
.bi-hub-subtitle {
  font-size: 17px;
  color: var(--bi-text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
  animation: fadeDown 0.5s ease-out 0.1s both;
}

/* ===========================================
   AIO SECTIONS (Quick Answer, TL;DR, Insights)
   =========================================== */

/* Quick Answer Section */
.bi-hub-quick-answer {
  max-width: 680px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  background: var(--bi-teal-glow);
  border: 1px solid rgba(77, 184, 168, 0.2);
  border-radius: var(--bi-radius);
  text-align: left;
  animation: fadeDown 0.5s ease-out 0.12s both;
}

.bi-hub-quick-answer p {
  font-size: 14px;
  color: var(--bi-text-secondary);
  line-height: 1.65;
  margin: 0;
}

.bi-hub-quick-answer strong {
  color: var(--bi-teal);
  font-weight: 600;
}

/* TL;DR Section */
.bi-hub-tldr {
  max-width: 680px;
  margin: 0 auto 24px;
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  animation: fadeDown 0.5s ease-out 0.14s both;
}

.bi-hub-tldr summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--bi-text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-hub-tldr summary::-webkit-details-marker {
  display: none;
}

.bi-hub-tldr summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--bi-text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s;
}

.bi-hub-tldr[open] summary::before {
  transform: rotate(90deg);
}

.bi-hub-tldr summary strong {
  color: var(--bi-text-primary);
}

.bi-hub-tldr p {
  padding: 0 16px 14px;
  font-size: 13.5px;
  color: var(--bi-text-secondary);
  line-height: 1.65;
  margin: 0;
  text-align: left;
}

/* Key Insights Section */
.bi-hub-insights {
  max-width: 680px;
  margin: 0 auto 32px;
  text-align: left;
  animation: fadeDown 0.5s ease-out 0.16s both;
}

.bi-hub-insights-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--bi-text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.bi-hub-insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
}

.bi-hub-insights-list li {
  font-size: 13px;
  color: var(--bi-text-secondary);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}

.bi-hub-insights-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  background: var(--bi-teal);
  border-radius: 50%;
}

.bi-hub-insights-list li strong {
  color: var(--bi-text-primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .bi-hub-quick-answer,
  .bi-hub-tldr,
  .bi-hub-insights {
    max-width: 100%;
  }

  .bi-hub-insights-list {
    grid-template-columns: 1fr;
  }
}

/* Stats Row */
.bi-hub-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  animation: fadeDown 0.5s ease-out 0.15s both;
}

.bi-hub-stat {
  text-align: center;
}

.bi-hub-stat-value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--bi-text-primary);
}

.bi-hub-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bi-text-muted);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .bi-hub-hero {
    padding: 40px 16px 32px;
  }

  .bi-hub-stats {
    gap: 20px;
  }

  .bi-hub-stat-value {
    font-size: 20px;
  }
}

/* ===========================================
   FILTERS SECTION
   =========================================== */

.bi-hub-filters {
  margin-bottom: 32px;
  animation: fadeDown 0.5s ease-out 0.2s both;
}

.bi-hub-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.bi-hub-search-box {
  flex: 1;
  position: relative;
}

.bi-hub-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bi-text-muted);
  pointer-events: none;
}

.bi-hub-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  color: var(--bi-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.bi-hub-search-input::placeholder {
  color: var(--bi-text-muted);
}

.bi-hub-search-input:focus {
  border-color: var(--bi-teal);
}

.bi-hub-sort-dropdown {
  padding: 12px 36px 12px 16px;
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  color: var(--bi-text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b8a' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s;
}

.bi-hub-sort-dropdown:focus {
  border-color: var(--bi-teal);
}

/* Filter Groups */
.bi-hub-filter-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.bi-hub-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bi-hub-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bi-text-muted);
  font-weight: 600;
  min-width: 70px;
  flex-shrink: 0;
}

.bi-hub-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bi-hub-chip {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bi-surface);
  color: var(--bi-text-secondary);
  border: 1px solid var(--bi-border);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  text-decoration: none;
}

.bi-hub-chip:hover {
  border-color: var(--bi-border-light);
  color: var(--bi-text-primary);
}

.bi-hub-chip.active {
  background: var(--bi-teal-glow);
  color: var(--bi-teal);
  border-color: rgba(77, 184, 168, 0.3);
}

/* Trend chip colors */
.bi-hub-chip-trend.rising.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.bi-hub-chip-trend.stable.active {
  background: var(--bi-yellow-glow);
  color: var(--bi-yellow);
  border-color: rgba(245, 215, 110, 0.3);
}

.bi-hub-chip-trend.declining.active {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Results Meta */
.bi-hub-filters-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--bi-border);
}

.bi-hub-results-count {
  font-size: 13px;
  color: var(--bi-text-muted);
}

.bi-hub-results-count strong {
  color: var(--bi-text-secondary);
  font-weight: 600;
}

.bi-hub-clear-btn {
  font-size: 12px;
  color: var(--bi-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
}

.bi-hub-clear-btn:hover {
  color: var(--bi-text-secondary);
}

@media (max-width: 768px) {
  .bi-hub-search-row {
    flex-direction: column;
  }

  .bi-hub-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ===========================================
   IDEAS GRID
   =========================================== */

.bi-hub-ideas-section {
  margin-bottom: 40px;
}

.bi-hub-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .bi-hub-ideas-grid {
    grid-template-columns: 1fr;
  }
}

/* Empty State */
.bi-hub-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  background: var(--bi-surface);
  border: 3px solid var(--bi-border);
  border-radius: var(--bi-radius);
}

.bi-hub-empty-icon {
  color: var(--bi-text-muted);
  margin-bottom: 16px;
}

.bi-hub-empty-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--bi-text-primary);
  margin-bottom: 8px;
}

.bi-hub-empty-state p {
  font-size: 14px;
  color: var(--bi-text-secondary);
  margin-bottom: 20px;
}

.bi-hub-empty-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--bi-teal);
  color: var(--bi-bg);
  font-size: 14px;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.2s;
}

.bi-hub-empty-btn:hover {
  background: #5dcab9;
  transform: translateY(-2px);
}

/* ===========================================
   IDEA CARD
   =========================================== */

.bi-hub-idea-card {
  position: relative;
  background: var(--bi-surface);
  border: 3px solid var(--bi-border);
  border-radius: var(--bi-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  min-height: 280px;
}

.bi-hub-idea-card:hover {
  border-color: var(--bi-border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Card animation */
.bi-hub-idea-card {
  animation: fadeUp 0.4s ease-out both;
}

.bi-hub-idea-card:nth-child(1) { animation-delay: 0s; }
.bi-hub-idea-card:nth-child(2) { animation-delay: 0.03s; }
.bi-hub-idea-card:nth-child(3) { animation-delay: 0.03s; }
.bi-hub-idea-card:nth-child(4) { animation-delay: 0.06s; }
.bi-hub-idea-card:nth-child(5) { animation-delay: 0.06s; }
.bi-hub-idea-card:nth-child(6) { animation-delay: 0.09s; }
.bi-hub-idea-card:nth-child(7) { animation-delay: 0.09s; }
.bi-hub-idea-card:nth-child(8) { animation-delay: 0.12s; }
.bi-hub-idea-card:nth-child(9) { animation-delay: 0.12s; }
.bi-hub-idea-card:nth-child(10) { animation-delay: 0.15s; }
.bi-hub-idea-card:nth-child(11) { animation-delay: 0.15s; }
.bi-hub-idea-card:nth-child(12) { animation-delay: 0.18s; }

/* Card Top (badges + indicators) */
.bi-hub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.bi-hub-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

/* Indicators wrapper (score + sparkline) */
.bi-hub-card-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bi-hub-badge {
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

.bi-hub-badge-cat {
  background: var(--bi-blue-glow);
  color: var(--bi-blue);
  border: 1px solid rgba(91, 141, 239, 0.2);
}

.bi-hub-badge-niche {
  background: var(--bi-surface-elevated);
  color: var(--bi-text-muted);
  border: 1px solid var(--bi-border);
}

/* Sparkline */
.bi-hub-sparkline-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.bi-hub-sparkline {
  width: 64px;
  height: 24px;
}

.bi-hub-trend-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bi-hub-trend-rising {
  color: #10b981;
}

.bi-hub-trend-stable {
  color: var(--bi-yellow);
}

.bi-hub-trend-declining {
  color: #ef4444;
}

/* Card Title */
.bi-hub-card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--bi-text-primary);
}

/* Card Description */
.bi-hub-card-desc {
  font-size: 13.5px;
  color: var(--bi-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Card Footer */
.bi-hub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--bi-border);
  margin-top: auto;
}

.bi-hub-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.bi-hub-meta-item {
  font-size: 11.5px;
  color: var(--bi-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.bi-hub-meta-item svg {
  opacity: 0.6;
}

.bi-hub-meta-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--bi-text-secondary);
  font-size: 11px;
}

/* Arrow */
.bi-hub-card-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bi-surface-elevated);
  border: 1px solid var(--bi-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  color: var(--bi-text-muted);
}

.bi-hub-idea-card:hover .bi-hub-card-arrow {
  background: var(--bi-teal-glow);
  border-color: rgba(77, 184, 168, 0.3);
  color: var(--bi-teal);
}

/* AI Score Badge */
.bi-hub-card-score {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid;
  flex-shrink: 0;
}

.bi-hub-score-high {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

.bi-hub-score-medium {
  background: var(--bi-yellow-glow);
  color: var(--bi-yellow);
  border-color: rgba(245, 215, 110, 0.4);
}

.bi-hub-score-low {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
  .bi-hub-card-meta {
    gap: 10px;
  }
}

/* ===========================================
   PAGINATION
   =========================================== */

.bi-hub-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
}

.bi-hub-page-btn {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bi-radius-sm);
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  color: var(--bi-text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.bi-hub-page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--bi-border-light);
  color: var(--bi-text-primary);
}

.bi-hub-page-btn.active {
  background: var(--bi-teal);
  border-color: var(--bi-teal);
  color: var(--bi-bg);
}

.bi-hub-page-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

.bi-hub-page-ellipsis {
  color: var(--bi-text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0 4px;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .bi-hub-hero::before,
  .bi-hub-counter,
  .bi-hub-title,
  .bi-hub-subtitle,
  .bi-hub-stats,
  .bi-hub-filters,
  .bi-hub-idea-card {
    animation: none;
  }

  .bi-hub-counter-dot {
    animation: none;
  }
}
