/* ============================================================
   BER4 Digital Simulation Toolkit — SIM1: Urban Earthquake
   Crisis Command Center Aesthetics & Interactive Components
   ============================================================ */

.sim-page {
  background: #06111e;
  color: #e2ebf5;
  min-height: 100vh;
  font-family: var(--body);
}

/* Header & Command Bar */
.sim-command-bar {
  background: linear-gradient(180deg, #0b1a2d 0%, #081322 100%);
  border-bottom: 1px solid rgba(224, 89, 42, 0.3);
  padding: 14px 0;
  position: sticky;
  top: 74px;
  z-index: 150;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}

.sim-bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sim-brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(224, 89, 42, 0.15);
  border: 1px solid rgba(224, 89, 42, 0.4);
  color: #ff7849;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sim-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff522b;
  box-shadow: 0 0 0 0 rgba(255, 82, 43, 0.7);
  animation: simPulse 1.8s infinite;
}

@keyframes simPulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 82, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 82, 43, 0); }
}

.sim-title-text h2 {
  font-family: var(--head);
  color: #fff;
  font-size: 22px;
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.sim-title-text small {
  color: #8da4be;
  font-size: 12px;
}

/* Resources Dashboard */
.sim-resource-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(13, 33, 58, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
}

.sim-res-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #c7d8e8;
}

.sim-res-item svg {
  width: 18px;
  height: 18px;
  color: #e0592a;
}

.sim-res-item strong {
  color: #fff;
  font-size: 14px;
  font-family: var(--head);
}

.sim-res-badge {
  background: rgba(31, 157, 107, 0.2);
  color: #38d39f;
  border: 1px solid rgba(56, 211, 159, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* Time Clock Display */
.sim-clock-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #030a14;
  border: 1px solid #1c3756;
  padding: 6px 14px;
  border-radius: 10px;
}

.sim-clock-time {
  font-family: monospace, var(--head);
  font-size: 20px;
  font-weight: 700;
  color: #38d39f;
  letter-spacing: 2px;
}

.sim-clock-label {
  font-size: 10px;
  color: #7994b2;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Main Grid Layout */
.sim-main-section {
  padding: 30px 0 60px;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 26px;
  align-items: start;
}

@media (max-width: 1024px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }
}

/* Broadcast Screen & Video Container */
.sim-screen-card {
  background: #091728;
  border: 1px solid #1c3a5e;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

.sim-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #02070f;
  overflow: hidden;
}

.sim-video-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HUD Overlay on Video */
.sim-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: radial-gradient(circle at center, transparent 60%, rgba(2, 8, 16, 0.8) 100%);
}

.sim-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sim-location-badge {
  background: rgba(6, 17, 30, 0.85);
  border: 1px solid rgba(224, 89, 42, 0.5);
  padding: 6px 12px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.sim-location-badge span {
  display: block;
  font-size: 10px;
  color: #ff9d7b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sim-location-badge strong {
  font-size: 14px;
  color: #fff;
}

.sim-rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ff4d4d;
}

.sim-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.2; }
}

/* News Ticker Bar */
.sim-news-ticker {
  background: #c4471c;
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  height: 38px;
}

.sim-ticker-label {
  background: #091728;
  color: #ff7849;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  flex-shrink: 0;
  border-right: 2px solid #e0592a;
}

.sim-ticker-content {
  white-space: nowrap;
  animation: tickerScroll 25s linear infinite;
  padding-left: 100%;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Control Controls under Video */
.sim-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #0b1d33;
  border-top: 1px solid #1c3a5e;
}

.sim-btn-play {
  background: linear-gradient(135deg, #e0592a, #c4471c);
  color: #fff;
  border: 0;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.sim-btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(224, 89, 42, 0.4);
}

.sim-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cdddef;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sim-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Timeline Stepper Component */
.sim-timeline-card {
  background: #091728;
  border: 1px solid #1c3a5e;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.sim-card-title {
  font-family: var(--head);
  font-size: 20px;
  color: #fff;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-card-title span {
  font-size: 12px;
  color: #7994b2;
  font-weight: 400;
  font-family: var(--body);
}

.sim-stepper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.sim-stepper::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #173250;
}

.sim-step-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s;
}

.sim-step-node.active {
  opacity: 1;
}

.sim-step-node.completed {
  opacity: 0.95;
}

.sim-step-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #091728;
  border: 3px solid #3c597d;
  margin-top: 3px;
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}

.sim-step-node.active .sim-step-icon {
  border-color: #ff522b;
  background: #ff522b;
  box-shadow: 0 0 0 4px rgba(255, 82, 43, 0.25);
}

.sim-step-node.completed .sim-step-icon {
  border-color: #38d39f;
  background: #38d39f;
}

.sim-step-content h4 {
  font-family: var(--head);
  font-size: 16px;
  color: #fff;
  margin: 0;
}

.sim-step-content p {
  font-size: 12.5px;
  color: #8fa6c2;
  margin: 2px 0 0;
}

.sim-step-time {
  font-size: 11px;
  color: #e0592a;
  font-weight: 700;
  text-transform: uppercase;
}

/* Inject Card Modal / Prompt Area */
.sim-inject-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sim-inject-overlay.show {
  opacity: 1;
  visibility: visible;
}

.sim-inject-modal {
  background: linear-gradient(145deg, #0e223a, #091727);
  border: 1px solid #2a4e78;
  border-radius: 20px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  padding: 30px;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.sim-inject-overlay.show .sim-inject-modal {
  transform: scale(1);
}

.sim-inject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.sim-inject-tag {
  background: rgba(224, 89, 42, 0.2);
  color: #ff7849;
  border: 1px solid rgba(224, 89, 42, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sim-inject-modal h3 {
  font-family: var(--head);
  font-size: 26px;
  color: #fff;
  margin: 10px 0 6px;
}

.sim-inject-desc {
  font-size: 15px;
  color: #c3d7eb;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #e0592a;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 24px;
}

.sim-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.sim-option-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.sim-option-card:hover {
  background: rgba(224, 89, 42, 0.1);
  border-color: rgba(224, 89, 42, 0.5);
  transform: translateX(4px);
}

.sim-option-card.selected {
  background: rgba(224, 89, 42, 0.2);
  border-color: #e0592a;
  box-shadow: 0 0 0 2px rgba(224, 89, 42, 0.3);
}

.sim-option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #5a7b9e;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.sim-option-card.selected .sim-option-radio {
  border-color: #e0592a;
  background: #e0592a;
}

.sim-option-card.selected .sim-option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.sim-option-text strong {
  display: block;
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
}

.sim-option-text p {
  margin: 0;
  font-size: 13px;
  color: #9cb4cd;
}

/* Input Fields inside Inject Form */
.sim-form-group {
  margin-bottom: 18px;
}

.sim-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #a6c0db;
  margin-bottom: 6px;
}

.sim-form-group input,
.sim-form-group select,
.sim-form-group textarea {
  width: 100%;
  background: rgba(4, 14, 26, 0.8);
  border: 1px solid #1f3e66;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--body);
  font-size: 14px;
  transition: border-color 0.2s;
}

.sim-form-group input:focus,
.sim-form-group select:focus,
.sim-form-group textarea:focus {
  outline: none;
  border-color: #e0592a;
  box-shadow: 0 0 0 3px rgba(224, 89, 42, 0.2);
}

.sim-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .sim-form-row {
    grid-template-columns: 1fr;
  }
}

/* Decision Log Section */
.sim-log-section {
  margin-top: 40px;
}

.sim-log-card {
  background: #091728;
  border: 1px solid #1c3a5e;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.sim-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.sim-log-header h3 {
  font-family: var(--head);
  font-size: 24px;
  color: #fff;
  margin: 0;
}

.sim-table-wrap {
  overflow-x: auto;
}

.sim-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.sim-log-table th {
  background: #0e243d;
  color: #ff9d7b;
  font-family: var(--head);
  font-size: 15px;
  padding: 12px 16px;
  border-bottom: 2px solid #204570;
  letter-spacing: 0.5px;
}

.sim-log-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #d1e2f3;
  vertical-align: top;
}

.sim-log-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.sim-time-badge {
  background: rgba(31, 157, 107, 0.15);
  color: #38d39f;
  border: 1px solid rgba(56, 211, 159, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.sim-actor-tag {
  display: inline-block;
  background: rgba(47, 111, 176, 0.2);
  color: #79b5f2;
  border: 1px solid rgba(121, 181, 242, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Debrief Modal */
.sim-debrief-modal {
  max-width: 850px;
}

.sim-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0 30px;
}

@media (max-width: 600px) {
  .sim-score-grid {
    grid-template-columns: 1fr;
  }
}

.sim-criterion-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.sim-criterion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sim-criterion-head h5 {
  font-size: 14px;
  color: #fff;
  margin: 0;
}

.sim-criterion-score {
  font-weight: 700;
  font-size: 13px;
}

.sim-criterion-score.pass { color: #38d39f; }
.sim-criterion-score.warn { color: #f0a500; }
.sim-criterion-score.fail { color: #ff522b; }

.sim-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.sim-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.sim-progress-fill.pass { background: #38d39f; }
.sim-progress-fill.warn { background: #f0a500; }
.sim-progress-fill.fail { background: #ff522b; }

.sim-overall-box {
  background: linear-gradient(135deg, #0e301f, #092015);
  border: 1px solid #1f9d6b;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
}

.sim-overall-box h4 {
  font-family: var(--head);
  font-size: 28px;
  color: #38d39f;
  margin: 0 0 6px;
}

.sim-overall-box p {
  color: #bce9d7;
  font-size: 14px;
  margin: 0;
}
