/* Opportunities Page Styles - Clean Layout */

.opportunities-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Dashboard Stats - Compact Row */
.opp-dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.opp-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 120px;
}

.opp-stat-value {
  font-size: var(--t-4xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.opp-stat-hot .opp-stat-value { color: #ef4444; }
.opp-stat-warm .opp-stat-value { color: #f59e0b; }
.opp-stat-watch .opp-stat-value { color: #3b82f6; }

.opp-stat-label {
  font-size: var(--t-sm);
  color: #64748b;
}

/* Top Tickers */
.opp-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.opp-ticker-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: var(--t-md);
  font-weight: 600;
  cursor: pointer;
  color: #1e293b;
}

.opp-ticker-chip:hover {
  border-color: #818cf8;
}

.opp-ticker-count {
  color: #94a3b8;
  font-weight: 500;
}

.opp-ticker-score {
  background: #10b981;
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--t-xs);
  font-weight: 700;
}

/* Opportunity List */
.opp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Opportunity Card - Single Row Layout */
.opp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.opp-card:hover {
  border-color: #cbd5e1;
}

.opp-card.score-hot { border-left: 4px solid #ef4444; }
.opp-card.score-warm { border-left: 4px solid #f59e0b; }
.opp-card.score-watch { border-left: 4px solid #3b82f6; }
.opp-card.score-low { border-left: 4px solid #cbd5e1; opacity: 0.7; }

.opp-card.validating {
  opacity: 0.5;
  pointer-events: none;
}

/* Left: Ticker & Direction */
.opp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
}

.opp-ticker-dir {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opp-ticker {
  font-size: var(--t-xl);
  font-weight: 700;
  color: #1e293b;
}

.opp-direction {
  font-size: var(--t-xs);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.direction-long {
  background: #ecfdf5;
  color: #059669;
}

.direction-short {
  background: #fef2f2;
  color: #dc2626;
}

/* Center: Trade Details */
.opp-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.opp-trade-idea {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.opp-instrument {
  font-size: var(--t-sm);
  font-weight: 600;
  color: #7c3aed;
}

.opp-entry {
  font-size: var(--t-sm);
  color: #475569;
}

.opp-target {
  font-size: var(--t-sm);
  color: #059669;
  font-weight: 500;
}

.opp-stop {
  font-size: var(--t-sm);
  color: #dc2626;
  font-weight: 500;
}

.opp-rationale {
  font-size: var(--t-sm);
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Source Context - Why this opportunity */
.opp-source-context {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #6366f1;
}

.opp-source-summary {
  font-size: var(--t-sm);
  color: #334155;
  font-weight: 500;
  margin-bottom: 8px;
}

.opp-key-data {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.opp-data-point {
  font-size: var(--t-xs);
  background: #e0e7ff;
  color: #4338ca;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.opp-context-detail {
  font-size: var(--t-xs);
  color: #64748b;
  margin-bottom: 4px;
}

.opp-context-detail strong {
  color: #475569;
}

.opp-source-excerpt {
  font-size: var(--t-xs);
  color: #94a3b8;
  font-style: italic;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.opp-feed-author {
  font-size: var(--t-xs);
  color: #6366f1;
  font-weight: 600;
  margin-bottom: 6px;
}

.opp-ai-assessment {
  font-size: var(--t-xs);
  color: #475569;
  margin-top: 8px;
  padding: 8px;
  background: #fef3c7;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
}

.opp-rec {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  text-transform: uppercase;
  font-size: 10px;
}

.opp-rec-take { background: #dcfce7; color: #166534; }
.opp-rec-wait { background: #fef3c7; color: #92400e; }
.opp-rec-pass { background: #f1f5f9; color: #475569; }
.opp-rec-close { background: #fee2e2; color: #991b1b; }

.opp-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.opp-type {
  color: #64748b;
  font-weight: 500;
  text-transform: capitalize;
}

.opp-timeframe,
.opp-age {
  font-weight: 400;
}

.opp-status {
  font-weight: 600;
}

.opp-status-triggered { color: #10b981; }
.opp-status-expired { color: #94a3b8; }
.opp-status-invalidated { color: #ef4444; }

/* Right: Score & Actions */
.opp-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.opp-score-container {
  text-align: center;
  min-width: 50px;
}

.opp-score {
  font-size: var(--t-2xl);
  font-weight: 800;
  line-height: 1;
}

.opp-score.score-hot { color: #ef4444; }
.opp-score.score-warm { color: #f59e0b; }
.opp-score.score-watch { color: #3b82f6; }
.opp-score.score-low { color: #94a3b8; }

.opp-score-label {
  font-size: var(--t-2xs);
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 2px;
}

.opp-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  font-size: var(--t-sm);
  padding: 8px 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.btn-small:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-small.btn-icon {
  padding: 8px 10px;
}

/* Validation - Inline */
.opp-validation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  font-size: var(--t-sm);
}

.validation-result {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.validation-status {
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: var(--t-xs);
  text-transform: uppercase;
}

.valid-fresh .validation-status { background: #ecfdf5; color: #059669; }
.valid-partial .validation-status { background: #fffbeb; color: #b45309; }
.valid-missed .validation-status { background: #f1f5f9; color: #64748b; }
.valid-invalid .validation-status { background: #fef2f2; color: #dc2626; }

.validation-rec {
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: var(--t-xs);
  text-transform: uppercase;
}

.rec-take { background: #ecfdf5; color: #059669; }
.rec-wait { background: #fffbeb; color: #b45309; }
.rec-pass { background: #f1f5f9; color: #64748b; }
.rec-close { background: #fef2f2; color: #dc2626; }

.validation-alignment,
.validation-risk,
.validation-entry {
  color: #64748b;
}

.validation-note {
  color: #94a3b8;
  font-style: italic;
  margin-top: 4px;
}

/* Alert Badge */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: #fff;
  font-size: var(--t-2xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Score Breakdown */
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.score-name {
  width: 90px;
  font-size: var(--t-sm);
  color: #64748b;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: #818cf8;
  border-radius: 4px;
}

.score-value {
  width: 32px;
  font-size: var(--t-sm);
  font-weight: 600;
  text-align: right;
  color: #1e293b;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .opp-card {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .opp-header {
    grid-column: 1;
  }

  .opp-right {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .opp-content {
    grid-column: 1;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .opportunities-container {
    padding: 16px;
  }

  .opp-dashboard {
    flex-wrap: wrap;
    gap: 10px;
  }

  .opp-stat {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    padding: 14px 16px;
  }

  .opp-stat-value {
    font-size: var(--t-3xl);
  }

  .opp-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .opp-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .opp-right {
    order: -1;
    margin-left: auto;
  }

  .opp-content {
    width: 100%;
  }

  .opp-actions {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
  }

  .btn-small {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .opportunities-container {
    padding: 12px;
  }

  .opp-stat {
    padding: 12px 14px;
  }

  .opp-stat-value {
    font-size: var(--t-2xl);
  }

  .opp-stat-label {
    font-size: var(--t-xs);
  }

  .opp-ticker {
    font-size: var(--t-lg);
  }

  .opp-score {
    font-size: var(--t-xl);
  }
}

/* ============================================
   MULTI-AGENT ANALYSIS STYLES
   ============================================ */

/* Analyst Consensus Badges */
.opp-analyst-consensus {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.analyst-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 3px;
  letter-spacing: 0.01em;
}

.analyst-supporting {
  background: #10b981;
  color: #fff;
}

.analyst-analyzed {
  background: #f1f5f9;
  color: #64748b;
}

.analyst-skipped {
  background: #f8fafc;
  color: #cbd5e1;
}

/* PM Conviction Badge */
.opp-conviction {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 3px;
}

.opp-conviction-high {
  background: #dcfce7;
  color: #166534;
}

.opp-conviction-medium {
  background: #fef3c7;
  color: #92400e;
}

.opp-conviction-low {
  background: #f1f5f9;
  color: #64748b;
}

/* Pipeline Status Indicator */
.pipeline-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: var(--t-sm);
}

.pipeline-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-running .pipeline-status-dot {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

.status-completed .pipeline-status-dot {
  background: #10b981;
}

.status-failed .pipeline-status-dot {
  background: #ef4444;
}

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

.pipeline-phase {
  color: #64748b;
  font-size: var(--t-xs);
}

.pipeline-cost {
  margin-left: auto;
  color: #6366f1;
  font-weight: 600;
}

/* Agent Analysis Modal */
.opp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.opp-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.opp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.opp-modal-header h3 {
  margin: 0;
  font-size: var(--t-lg);
  font-weight: 600;
}

.opp-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.opp-modal-close:hover {
  color: #1e293b;
}

.opp-modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Analysis Modal Content */
.agent-analysis-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-section {
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.analysis-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.analysis-section h4 {
  margin: 0 0 12px 0;
  font-size: var(--t-sm);
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.score-item {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
}

.score-item .score-name {
  font-size: var(--t-xs);
  color: #64748b;
  text-transform: capitalize;
}

.score-item .score-value {
  font-size: var(--t-xl);
  font-weight: 700;
  color: #1e293b;
}

.consensus-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consensus-chip {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--t-xs);
  font-weight: 500;
}

.consensus-yes {
  background: #dcfce7;
  color: #166534;
}

.consensus-no {
  background: #f1f5f9;
  color: #64748b;
}

.supporting-analysts {
  width: 100%;
  margin-top: 8px;
  font-size: var(--t-xs);
  color: #059669;
  font-weight: 500;
}

.conviction-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: var(--t-sm);
}

.conviction-high {
  background: #dcfce7;
  color: #166534;
}

.conviction-medium {
  background: #fef3c7;
  color: #92400e;
}

.conviction-low {
  background: #f1f5f9;
  color: #64748b;
}

.risk-verdict {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: var(--t-sm);
}

.risk-approved {
  background: #dcfce7;
  color: #166534;
}

.risk-reduced {
  background: #fef3c7;
  color: #92400e;
}

.risk-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.risk-notes {
  margin-top: 8px;
  font-size: var(--t-sm);
  color: #64748b;
  font-style: italic;
}

.agent-detail {
  margin-bottom: 8px;
}

.agent-detail summary {
  cursor: pointer;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-weight: 500;
  font-size: var(--t-sm);
}

.agent-detail summary:hover {
  background: #f1f5f9;
}

.agent-detail pre {
  margin: 8px 0;
  padding: 12px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

.agent-meta {
  font-size: var(--t-xs);
  color: #94a3b8;
  padding: 4px 0;
}
