/**
 * interactive.css
 * High-Density Interactive Widgets, Simulator Probes, and Visual Protocol Card Styling
 * Systematization of Knowledge (SoK): Multimodal Foundation Model Evaluation
 * Author: Alireza Abbaszadeh (Islamic Azad University, Mashhad, Iran)
 */

/* =========================================================================
   1. Interactive Diagnostic Traps & Probes Sandbox (Tab 3)
   ========================================================================= */
.probes-sandbox-container {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border-dark);
}

.sandbox-header {
  margin-bottom: 1.5rem;
}

.sandbox-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sandbox-pill {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.sandbox-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.sandbox-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 960px;
  line-height: 1.5;
}

.probes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.probe-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.probe-card:hover {
  box-shadow: var(--shadow-md);
}

.probe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.probe-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.probe-tag.tag-vl { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.probe-tag.tag-vid { background: #FAF5FF; color: #7C3AED; border: 1px solid #DDD6FE; }
.probe-tag.tag-emb { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }

.probe-suite-ref {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}

.probe-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.probe-explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.probe-controls {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.probe-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.probe-select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-dark);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
}

.probe-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mode-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-dark);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-btn.active {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
  box-shadow: 0 1px 3px rgba(37,99,235,0.15);
}

.probe-query-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.query-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.ground-truth-badge {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #475569;
}

.probe-run-btn {
  margin-top: 6px;
  width: 100%;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 6px;
}

.probe-slider {
  width: 100%;
  accent-color: #2563EB;
  cursor: pointer;
}

.frame-config-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-main);
}
.frame-config-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.probe-results-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  animation: fadeIn 0.25s ease-out;
}

.sim-output-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.res-label {
  color: var(--text-muted);
}

.res-value {
  color: var(--text-main);
  text-align: right;
}

.metrics-bar-wrap {
  margin-bottom: 6px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563EB;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-fill.fill-rose { background: #DC2626; }

.verdict-banner {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
  font-weight: 600;
}
.verdict-pass {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #047857;
}
.verdict-fail {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.verdict-warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #B45309;
}


/* =========================================================================
   2. Live Visual Protocol Card Preview (Tab 4)
   ========================================================================= */
.preview-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.protocol-rendered-card {
  background: #FFFFFF;
  border: 2px solid #2563EB;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  margin-bottom: 1rem;
}

.p-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #E2E8F0;
  margin-bottom: 10px;
}

.p-card-venue {
  font-size: 0.78rem;
  font-weight: 800;
  color: #2563EB;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.p-card-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  margin-top: 2px;
}

.p-card-cap-badge {
  text-align: right;
}

.cap-score-label {
  font-size: 0.72rem;
  color: #64748B;
  display: block;
}

.cap-score-num {
  font-size: 1.35rem;
  font-weight: 900;
  color: #2563EB;
  font-family: 'JetBrains Mono', monospace;
}

.cap-score-sub {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
}

.p-card-section {
  margin-bottom: 8px;
}

.p-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.p-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.p-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.p-badge-mod {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.p-badge-cap {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}
.p-badge.p-empty {
  background: #F1F5F9;
  color: #94A3B8;
  border: 1px dashed #CBD5E1;
}

.p-card-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748B;
}

.spec-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0F172A;
  margin-top: 2px;
}

.p-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #E2E8F0;
}

.canary-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.canary-lbl {
  color: #64748B;
  font-weight: 600;
}

.canary-code {
  background: #0F172A;
  color: #38BDF8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.so-k-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 2px 8px;
  border-radius: 4px;
}


/* =========================================================================
   3. Dark Mode Palette Overrides (WCAG AAA Contrast)
   ========================================================================= */
[data-theme="dark"] .probes-sandbox-container {
  border-top-color: #334155;
}

[data-theme="dark"] .probe-card {
  background: #0F172A;
  border-color: #1E293B;
}

[data-theme="dark"] .probe-controls {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .probe-select {
  background: #0F172A;
  border-color: #475569;
  color: #F8FAFC;
}

[data-theme="dark"] .mode-btn {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .mode-btn.active {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #93C5FD;
}

[data-theme="dark"] .probe-query-box {
  background: #0F172A;
  border-color: #334155;
  color: #F8FAFC;
}

[data-theme="dark"] .protocol-rendered-card {
  background: #0F172A;
  border-color: #3B82F6;
}

[data-theme="dark"] .p-card-top {
  border-bottom-color: #334155;
}

[data-theme="dark"] .p-card-name {
  color: #F8FAFC;
}

[data-theme="dark"] .p-card-specs-grid {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .spec-val {
  color: #F8FAFC;
}

[data-theme="dark"] .p-card-footer {
  border-top-color: #334155;
}

[data-theme="dark"] .btn-action {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}

[data-theme="dark"] .btn-action:hover {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #93C5FD;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
