/* ==========================================================================
   App 2: Grok Bot Marketplaces Lab — Orbital Violet + Emerald Theme
   ========================================================================== */

.market-hero {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.market-hero h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.14;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.bot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.bot-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 28, 0.8);
  border: 1px solid var(--border);
  transition: transform 0.22s var(--ease-spring), border-color 0.22s, box-shadow 0.22s;
}

.bot-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.52);
  box-shadow: 0 14px 32px rgba(167, 139, 250, 0.14);
}

.bot-card.comparing {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.1), rgba(7, 12, 28, 0.85));
}

.bot-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.bot-meta-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-2);
}

.bot-card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

/* Radar & Comparator */
.radar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(5, 9, 24, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.compare-table th,
.compare-table td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.compare-table th {
  color: var(--text-2);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* MRR Chart & KPIs */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi-box {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(6, 11, 26, 0.82);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-box strong {
  font-size: 1.32rem;
  font-family: var(--font-mono);
}

.chart-box {
  background: rgba(5, 9, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Auditor Gauge & Checklist */
.gauge-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(6, 11, 26, 0.84);
  border: 1px solid var(--border);
}

.audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(6, 11, 26, 0.72);
  font-size: 0.83rem;
}

.audit-row.pass { border-color: rgba(16, 185, 129, 0.45); }
.audit-row.fail { border-color: rgba(251, 113, 133, 0.48); }

/* Sandbox Trace Console */
.dryrun-console {
  background: rgba(3, 6, 18, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-height: 210px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.trace-step {
  display: flex;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  animation: popIn 0.25s var(--ease-spring);
}

.trace-tag {
  color: #a78bfa;
  font-weight: 700;
  flex-shrink: 0;
}

.trace-step.gate {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.drawer-panel {
  width: min(720px, 100%);
}

@media (max-width: 1020px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .filter-bar,
  .bot-grid,
  .kpi-strip { grid-template-columns: 1fr; }
}
