/* ==========================================================================
   FUTURE WAVE ANALYSIS — Market Ideas Stylesheet (Phase 5A)
   Scenario-Based Market Setups & Risk Management Context
   ========================================================================== */

/* 1. Hero Section */
.ideas-hero {
  padding: 3.5rem 0 2rem;
  text-align: center;
  position: relative;
}

.ideas-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tide);
  background: var(--tide-bg);
  border: 1px solid var(--tide-border);
  margin-bottom: 1rem;
}

.ideas-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.15;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.ideas-body {
  color: var(--mist);
  font-size: 1.1rem;
  max-width: 44rem;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.ideas-hero-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--mist-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
}

.ideas-hero-note svg {
  color: var(--signal);
  flex-shrink: 0;
}

/* 2. Filter Navigation Bar */
.ideas-filter-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 2.5rem;
}

.ideas-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel-2);
  padding: 0.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-subtle);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.ideas-filter-bar::-webkit-scrollbar {
  display: none;
}

.ideas-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mist);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.ideas-filter-btn:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
}

.ideas-filter-btn.active {
  color: #071321;
  background: var(--tide);
  border-color: var(--tide);
  box-shadow: 0 2px 10px rgba(45, 212, 191, 0.35);
}

.ideas-filter-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: currentColor;
}

.ideas-filter-btn.active .ideas-filter-count {
  background: rgba(7, 19, 33, 0.25);
  color: #071321;
}

/* 3. Cards Grid */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

/* 4. Reusable Idea Card */
.idea-card {
  background: var(--bg-panel-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.idea-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-highlight);
  box-shadow: var(--shadow-elevated), var(--shadow-glow);
}

.idea-card.card-hidden {
  display: none !important;
}

/* Demo / Example Badge */
.idea-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.idea-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--tide);
}

.idea-demo-badge svg {
  width: 12px;
  height: 12px;
}

.idea-timeframe-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--mist);
}

/* Header: Ticker & Asset */
.idea-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.idea-asset-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.idea-ticker {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.idea-asset-name {
  font-size: 0.875rem;
  color: var(--mist);
  font-weight: 500;
}

.idea-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.type-bullish {
  background: var(--bull-bg);
  border: 1px solid var(--bull-border);
  color: var(--bull);
}

.type-bearish {
  background: var(--risk-bg);
  border: 1px solid var(--risk-border);
  color: var(--risk);
}

.type-watchlist {
  background: var(--signal-bg);
  border: 1px solid var(--signal-border);
  color: var(--signal);
}

/* Metadata Row */
.idea-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.idea-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.idea-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mist-dim);
  font-weight: 600;
}

.idea-meta-value {
  font-size: 0.8rem;
  color: var(--foreground);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transparency Sections (Clearly separated) */
.idea-scenario-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  margin-bottom: 1rem;
}

.idea-box-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tide);
  margin-bottom: 0.4rem;
}

.idea-scenario-text {
  font-size: 0.875rem;
  color: var(--foreground-muted);
  line-height: 1.5;
}

/* Key Parameters Grid (Trigger, Invalidation, Target Zone) */
.idea-parameters-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.idea-param-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg-panel-subtle);
}

.idea-param-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.idea-param-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag-trigger {
  color: var(--sky);
}

.tag-invalidation {
  color: var(--risk);
}

.tag-target {
  color: var(--bull);
}

.idea-param-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--foreground);
  line-height: 1.4;
  word-break: break-word;
}

/* Specific styling for Invalidation box to emphasize risk-first */
.idea-param-row.row-invalidation {
  border-left: 3px solid var(--risk);
  background: rgba(248, 113, 113, 0.04);
}

.idea-param-row.row-trigger {
  border-left: 3px solid var(--sky);
  background: rgba(96, 165, 250, 0.04);
}

.idea-param-row.row-target {
  border-left: 3px solid var(--bull);
  background: rgba(52, 211, 153, 0.04);
}

[dir="rtl"] .idea-param-row.row-invalidation {
  border-left: 1px solid var(--line);
  border-right: 3px solid var(--risk);
}

[dir="rtl"] .idea-param-row.row-trigger {
  border-left: 1px solid var(--line);
  border-right: 3px solid var(--sky);
}

[dir="rtl"] .idea-param-row.row-target {
  border-left: 1px solid var(--line);
  border-right: 3px solid var(--bull);
}

/* Card Footer: Status & Lifecycle */
.idea-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  gap: 0.5rem;
}

.idea-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.status-active {
  background: var(--bull-bg);
  border: 1px solid var(--bull-border);
  color: var(--bull);
}

.status-watching {
  background: var(--sky-bg);
  border: 1px solid var(--sky-border);
  color: var(--sky);
}

.status-completed {
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--tide);
}

.status-invalidated {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--risk);
}

.idea-card-date {
  font-size: 0.75rem;
  color: var(--mist-dim);
}

/* 5. How Market Ideas Work Section */
.how-ideas-section {
  background: var(--bg-panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  margin-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.how-ideas-section::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tide-glow) 0%, transparent 70%);
  pointer-events: none;
}

.how-ideas-header {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto 3rem;
}

.how-ideas-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.how-ideas-sub {
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1.6;
}

.how-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.how-step-card {
  background: var(--bg-panel-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.how-step-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-highlight);
}

.how-step-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--tide-bg);
  border: 1px solid var(--tide-border);
  color: var(--tide);
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
}

.how-step-desc {
  font-size: 0.875rem;
  color: var(--mist);
  line-height: 1.55;
}

.how-ideas-footer-cta {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* 6. Empty State */
.ideas-empty-state {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-panel-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

.ideas-empty-state.is-visible {
  display: block;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--mist-dim);
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  color: var(--mist);
  font-size: 0.95rem;
}

/* 7. Light Theme Overrides [data-theme="white"] */
[data-theme="white"] .ideas-hero-note {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="white"] .ideas-filter-bar {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme="white"] .ideas-filter-btn {
  color: #475569;
}

[data-theme="white"] .ideas-filter-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="white"] .ideas-filter-btn.active {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}

[data-theme="white"] .ideas-filter-btn.active .ideas-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-theme="white"] .idea-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

[data-theme="white"] .idea-card:hover {
  border-color: #0d9488;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="white"] .idea-timeframe-badge {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="white"] .idea-ticker {
  color: #0f172a;
}

[data-theme="white"] .idea-asset-name {
  color: #64748b;
}

[data-theme="white"] .idea-meta-grid {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="white"] .idea-meta-label {
  color: #64748b;
}

[data-theme="white"] .idea-meta-value {
  color: #0f172a;
}

[data-theme="white"] .idea-scenario-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="white"] .idea-box-title {
  color: #0d9488;
}

[data-theme="white"] .idea-scenario-text {
  color: #334155;
}

[data-theme="white"] .idea-param-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="white"] .idea-param-value {
  color: #0f172a;
}

[data-theme="white"] .idea-card-footer {
  border-top-color: #e2e8f0;
}

[data-theme="white"] .how-ideas-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="white"] .how-step-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="white"] .how-step-title {
  color: #0f172a;
}

[data-theme="white"] .how-step-desc {
  color: #475569;
}

/* 8. Mobile Responsiveness */
@media (max-width: 768px) {
  .ideas-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .ideas-filter-wrapper {
    margin: 1.5rem 0 2rem;
  }

  .ideas-filter-bar {
    width: 100%;
    justify-content: flex-start;
    padding: 0.35rem;
  }

  .how-ideas-section {
    padding: 2.5rem 1.5rem;
  }

  .how-ideas-grid {
    grid-template-columns: 1fr;
  }
}
