/**
 * DosiPlot v5.0 — Simulation Monte Carlo Interactive
 * © 2025 Pr. Yassine OULHOUQ
 * Université Mohammed Premier (UMP) — Oujda, Maroc
 * Module: TRS-398 — Layout, Step Cards, Formulas, Results
 */

/* ============================================
   TRS-398 LAYOUT
   ============================================ */
.trs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
  max-height: calc(100vh - 160px);
}

/* ============================================
   TRS CHART PANEL
   ============================================ */
.trs-chart {
  background: var(--gradient-surface, linear-gradient(180deg, var(--bg1), var(--bg0)));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.trs-chart:hover {
  border-color: var(--border2);
}

.trs-chart .cw {
  flex: 1;
  position: relative;
  min-height: 250px;
  max-height: 420px;
}

/* ============================================
   TRS STEPS PANEL
   ============================================ */
.trs-steps {
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: 100%;
}

.trs-steps-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   STEP CARDS
   ============================================ */
.step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.3;
}

/* Photon active state */
.step.active {
  opacity: 1;
  border-color: rgba(0, 180, 255, 0.3);
  background: rgba(0, 180, 255, 0.06);
  box-shadow: 0 0 15px rgba(0, 180, 255, 0.08);
}

/* Photon done state */
.step.done {
  opacity: 1;
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.06);
}

/* Electron active state */
.step.elec-active {
  opacity: 1;
  border-color: rgba(255, 176, 32, 0.3);
  background: rgba(255, 176, 32, 0.06);
  box-shadow: 0 0 15px rgba(255, 176, 32, 0.08);
}

/* Electron done state */
.step.elec-done {
  opacity: 1;
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.06);
}

/* ============================================
   STEP NUMBER BADGE
   ============================================ */
.step-num {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc, var(--blue));
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(0, 180, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Electron variant */
.step.elec-active .step-num,
.step.elec-done .step-num {
  background: linear-gradient(135deg, #cc7700, var(--amber));
  box-shadow: 0 0 8px rgba(255, 176, 32, 0.2);
}

/* Done variant */
.step.done .step-num,
.step.elec-done .step-num {
  background: linear-gradient(135deg, #009944, var(--green));
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}

/* ============================================
   STEP CONTENT
   ============================================ */
.step-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--t1);
  display: inline;
}

.step-body {
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--t2);
  line-height: 1.8;
}

/* ============================================
   STEP FORMULAS
   ============================================ */
.step-formula {
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 180, 255, 0.15);
  transition: all 0.3s;
}

.step-formula.elec {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 176, 32, 0.15);
}

/* ============================================
   STEP VALUES
   ============================================ */
.step-val {
  font-weight: 700;
  color: var(--blue);
  font-size: 12px;
  text-shadow: 0 0 8px rgba(0, 180, 255, 0.2);
  transition: all 0.3s;
}

.step-val.elec {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 176, 32, 0.2);
}

.step-val.result {
  font-size: 16px;
  color: var(--green);
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}

/* ============================================
   TRS RESULT DISPLAY
   ============================================ */
.trs-result {
  background: rgba(0, 230, 118, 0.06);
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-top: 6px;
  text-align: center;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.08);
}

.trs-result.show {
  opacity: 1;
}

.trs-result-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.trs-result-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  margin: 6px 0;
  text-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.trs-result-class {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--t2);
  font-weight: 500;
}

/* ============================================
   TRS PREAMBULE
   ============================================ */
.trs-preambule {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(100, 160, 255, 0.05), rgba(100, 160, 255, 0.02));
  border: 1px solid rgba(100, 160, 255, 0.1);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  line-height: 1.7;
  color: var(--t2);
}

.trs-preambule strong {
  color: var(--t1);
}

/* ============================================
   TRS WAIT STATE
   ============================================ */
.trs-wait {
  text-align: center;
  padding: 60px 20px;
  color: var(--t3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.trs-wait .icon {
  font-size: 42px;
  display: block;
  margin-bottom: 14px;
  opacity: 0.3;
}
