/**
 * DosiPlot v5.0 — Simulation Monte Carlo Interactive
 * © 2025 Pr. Yassine OULHOUQ
 * Université Mohammed Premier (UMP) — Oujda, Maroc
 * Module: Comparison — Comparison Tab, Unlock State, Export Button, Guidance Panel
 */

/* ============================================
   COMPARISON TAB — Lock/Unlock States
   ============================================ */
#tab-cmp.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

#tab-cmp.locked::after {
  content: ' \1F512';
  font-size: 10px;
}

#tab-cmp.unlocked {
  opacity: 1;
  cursor: pointer;
}

#tab-cmp.unlocked::after {
  content: ' \2713';
  font-size: 10px;
  color: #10b981;
}

/* ============================================
   COMPARISON UNLOCK MESSAGE
   ============================================ */
.cmp-unlock-msg {
  text-align: center;
  padding: 20px;
  color: #f59e0b;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.6;
}

.cmp-unlock-msg .icon {
  font-size: 32px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ============================================
   COMPARISON EXPORT BUTTON
   ============================================ */
.btn-export-cmp {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #10b981;
  background: transparent;
  color: #10b981;
  font-size: 10px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 6px;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-export-cmp:hover {
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-export-cmp:active {
  transform: translateY(0);
}

/* Disabled state */
.btn-export-cmp:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   COMPARISON GUIDANCE PANEL
   ============================================ */
.cmp-guidance {
  margin: 12px 0 4px;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(100, 160, 255, 0.06), rgba(0, 200, 180, 0.04));
  border: 1.5px solid rgba(100, 160, 255, 0.12);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--t2);
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmp-guidance:hover {
  border-color: rgba(100, 160, 255, 0.2);
}

.cmp-guidance-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmp-guidance ol {
  margin: 8px 0 0 18px;
  padding: 0;
  list-style: decimal;
}

.cmp-guidance ol li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.cmp-guidance ol li strong {
  color: var(--t1);
}

/* ============================================
   COMPARISON CHART LAYOUT
   ============================================ */
.cmp-chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cmp-chart-box {
  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;
  min-height: 0;
  flex: 1;
  box-shadow: var(--shadow);
  position: relative;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */
.cmp-table-wrap {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
}

.cmp-table th {
  background: var(--bg2);
  color: var(--blue);
  padding: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.cmp-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(100, 160, 255, 0.06);
  color: var(--t2);
}

.cmp-table tr:hover td {
  background: rgba(0, 180, 255, 0.04);
  color: var(--t1);
}

/* Difference column styling */
.cmp-table .diff-ok {
  color: var(--green);
  font-weight: 600;
}

.cmp-table .diff-warn {
  color: var(--amber);
  font-weight: 600;
}

.cmp-table .diff-error {
  color: var(--red);
  font-weight: 600;
}

/* ============================================
   COMPARISON SIDEBAR CONTROLS
   ============================================ */
.cmp-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmp-select-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cmp-select-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   COMPARISON SUMMARY CARDS
   ============================================ */
.cmp-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.cmp-summary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.cmp-summary-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.cmp-summary-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}

.cmp-summary-value.match {
  color: var(--green);
}

.cmp-summary-value.mismatch {
  color: var(--amber);
}
