/* Scenario Manifest & Comparison View Styling */

.scenarios-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.scenarios-modal {
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
  color: #0f172a;
}

.scenarios-header {
  padding: 20px 24px;
  background: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scenarios-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scenarios-header .close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.scenarios-header .close-btn:hover {
  color: #ffffff;
}

.scenarios-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.scenarios-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.scenarios-search {
  flex: 1;
  min-width: 260px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.scenarios-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.scenarios-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.scenario-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.scenario-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.scenario-card.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.scenario-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.scenario-card .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  align-self: flex-start;
}

.scenario-card.active .badge {
  background: #dbeafe;
  color: #1e40af;
}

.scenario-card .stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 4px;
}

.scenario-card .stats-row b {
  color: #0f172a;
}

.scenario-card .btn-load {
  margin-top: auto;
  padding: 8px 12px;
  background: #1e293b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.scenario-card .btn-load:hover {
  background: #2563eb;
}

.comparison-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.comparison-table th {
  background: #f1f5f9;
  padding: 12px 14px;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  white-space: nowrap;
}

.comparison-table tr:hover td {
  background: #f8fafc;
}

.comparison-table .highlight-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.comparison-table .tag-fatalities {
  color: #dc2626;
  font-weight: 600;
}

.comparison-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.chart-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.chart-panel h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.chart-bar-row {
  margin-bottom: 10px;
}

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.chart-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AidEM Top Floating Actions (AI Agent + Settings Modal Toggle) */
.aidem-top-floating-cluster {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

body.tools .aidem-top-floating-cluster {
  right: calc(var(--sidebar-width) + 12px);
}

.settings-toggle-btn {
  display: none !important; /* Temporarily hidden for demos; restore after demos by removing display:none */
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  border: 1.5px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  font-size: 18px;
  flex-shrink: 0;
  user-select: none;
}

.settings-toggle-btn:hover {
  background: #1e293b;
  color: #38bdf8;
  border-color: #38bdf8;
  transform: scale(1.06);
}

.agent-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #0b57d0;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(11, 87, 208, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.agent-floating-btn:hover {
  background: #0842a0;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(11, 87, 208, 0.45);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .aidem-top-floating-cluster {
    top: 8px;
    right: 8px;
    gap: 6px;
  }
  body.tools .aidem-top-floating-cluster {
    right: 8px;
  }
  .agent-floating-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .settings-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

@media (max-width: 440px) {
  .agent-floating-btn .agent-btn-text-full {
    display: none;
  }
  .agent-floating-btn .agent-btn-text-short {
    display: inline;
  }
}
@media (min-width: 441px) {
  .agent-floating-btn .agent-btn-text-full {
    display: inline;
  }
  .agent-floating-btn .agent-btn-text-short {
    display: none;
  }
}
