@import url('smart_trade_advisor.css');

.trp-toolbar {
  margin-bottom: 8px;
}

.trp-ind-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--peps-surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--peps-border, rgba(255, 255, 255, 0.08));
}

.trp-ind-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted, #8b949e);
}

.trp-ind-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.trp-ind-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #30363d);
  background: var(--bg-subtle, #161b22);
  color: var(--fg-muted, #8b949e);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.trp-ind-chip:hover {
  border-color: var(--fg-subtle, #6e7681);
  color: var(--fg-default, #e6edf3);
}

.trp-ind-chip.is-active {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.trp-ind-chip:not(.is-active) {
  border-color: #484f58;
  color: #8b949e;
  background: rgba(13, 17, 23, 0.6);
}

.trp-side-toggle {
  display: inline-flex;
  gap: 6px;
}

.trp-side {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--peps-border, rgba(255, 255, 255, 0.12));
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.trp-side.is-active[data-side="buy"] {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.trp-side.is-active[data-side="sell"] {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.trp-click-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--fg-muted, #8b949e);
}

.trp-chart-levels {
  display: none;
}

#trp-chart-panel .sta-chart-stage {
  position: relative;
}

.trp-click-line-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #22c55e;
  pointer-events: none;
  z-index: 4;
  display: none;
}

.trp-click-line-h {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed #22c55e;
  pointer-events: none;
  z-index: 4;
  display: none;
}

.trp-indicator-chart-panel {
  display: grid;
  gap: 10px;
  margin-top: -6px;
  margin-bottom: 12px;
}

.trp-indicator-chart {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-subtle, #161b22);
  border: 1px solid var(--border-default, var(--peps-border, rgba(255, 255, 255, 0.08)));
}

.trp-indicator-chart.is-hidden {
  display: none;
}

.trp-indicator-chart header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-muted, rgba(255, 255, 255, 0.06));
  font-size: 11px;
  color: var(--fg-muted, #8b949e);
}

.trp-indicator-chart header strong {
  color: var(--fg-default, #e6edf3);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trp-indicator-canvas {
  height: 120px;
  min-height: 120px;
}

.trp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.trp-panel {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--peps-surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--peps-border, rgba(255, 255, 255, 0.08));
}

.trp-panel h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.trp-panel-wide {
  grid-column: 1 / -1;
}

.trp-decision {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.trp-decision.is-buy { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.trp-decision.is-sell { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.trp-decision.is-wait { background: rgba(234, 179, 8, 0.15); color: #eab308; }

.trp-reasons {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted, #8b949e);
}

.trp-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.trp-outcome-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.trp-outcome-stat {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  min-width: 120px;
}

.trp-outcome-stat span {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}

.trp-outcome-stat strong {
  font-size: 18px;
}

.trp-outcome-stat.is-win strong { color: #22c55e; }
.trp-outcome-stat.is-loss strong { color: #ef4444; }

.trp-returns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trp-returns-table th,
.trp-returns-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-muted, rgba(255, 255, 255, 0.06));
}

.trp-explain-grid {
  display: grid;
  gap: 10px;
}

.trp-explain-block {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-muted, rgba(255, 255, 255, 0.06));
}

.trp-explain-block h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.trp-explain-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-muted, #8b949e);
}

.trp-align-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.trp-align-badge.is-yes {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.trp-align-badge.is-no {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

@media (max-width: 900px) {
  .trp-layout {
    grid-template-columns: 1fr;
  }
}
