/* Base styling */
body {
  font-family: Arial, sans-serif;
  margin: 2rem;
  color: #d7d7d7;
}

.main-header {
  background-color: #2323239b;
  border-radius: 5px;
  padding: 15px;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}

/* ---------------- Simulation Settings (Config Container) ---------------- */
.config-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  background-color: #232323c8;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}

/* Title spans full width */
.config-container h2 {
  max-width: 1000px;
  grid-column: 1 / -1;
  margin: 0 0 10px 0;
}

/* Expected Packages should be on its own row */
.config-container .config-item:nth-child(2) {
  grid-column: 1 / -1;
}

/* For numColumns and numRows (children 3 and 4), they will share the same row */
.config-container .config-item {
  display: flex;
  flex-direction: column;
}

.config-container.disabled {
  pointer-events: none;
  opacity: 0.5;
}
/* ---------------- Simulation Controls (Control Container) ---------------- */
.control-container {
  display: grid;
  gap: 15px;
  background-color: #232323c8;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}
.control-container .control-item {
  display: flex;
  flex-direction: column;
}

/* Buttons in a single row */
.control-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* Timescale slider on its own line */
.control-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Progress container spans full width */
.control-progress {
  grid-column: 1 / -1;
}
.control-slider label {
  margin: 0;
}
.control-container .control-item label {
  margin-bottom: 5px;
}

/* Ensure progress bar spans full width */
.control-container .control-item[style*="grid-column: 1 / -1"] {
  margin-top: 10px;
}

/* ---------------- Input Fields & Slider ---------------- */
.config-container input[type="number"],
.config-container input[type="time"],
.control-container input[type="range"] {
  background-color: #232323c8;
  color: #d7d7d7;
  border-radius: 4px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Custom range slider styling */
.control-container input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #f0f0f0;
  outline: none;
  margin: 5px 0;
}
.control-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4c53af;
  cursor: pointer;
}
.control-container input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4c53af;
  cursor: pointer;
}

/* ---------------- Buttons ---------------- */
button {
  background-color: #4c53af;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: #7c81ce;
}
button:disabled {
  background-color: #777;
  cursor: not-allowed;
}

/* ---------------- Current Time ---------------- */
.current-time {
  background-color: #232323c8;
  border-radius: 5px;
  padding: 5px 15px;
  margin-top: 1rem;
  font-size: 1.2rem;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}

/* ---------------- Tables ---------------- */
table {
  background-color: #232323c8;
  border-radius: 5px;
  padding: 5px 15px;
  border-radius: 5px;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}

table,
th,
td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
}

/* ---------------- Output Log ---------------- */
#output {
  margin-top: 1rem;
  padding: 1rem;
  background: #232323c8;
  white-space: pre-wrap;
  height: 200px;
  overflow-y: auto;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10%;
  width: 90vw;
  max-width: 1000px;
}

/* ---------------- Chart ---------------- */
.chart-wrapper {
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
  display: flex;
  justify-content: center;
}

#chartCanvas {
  margin-top: 1rem;
  border-radius: 5px;
  padding: 15px;
  box-sizing: border-box;
  width: 100%; /* Fills the container */
  background-color: #232323c8; /* Semi-transparent background */
  font-family: Arial, sans-serif;
  color: #f0f0f0;
}

/* ---------------- Manager Notifications ---------------- */
#notificationContainer {
  border: 1px solid red;
  background-color: #ffcccc; /* This will be overridden by JS if no alerts exist */
  color: red;
  max-height: 100px;
  overflow-y: auto;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 1rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 90vw;
  max-width: 1000px;
}

#notificationContainer.simulation-active {
  display: block !important;
  background-color: green !important;
  color: white !important;
  max-height: none !important;
  min-height: 50px;
}
#notificationHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
#notification {
  max-height: 60px;
  overflow-y: auto;
}
.alert {
  margin: 0.5rem 0;
  padding: 0.4rem;
  border: 1px solid red;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert button {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: red;
  cursor: pointer;
}

/* ---------------- Loading Overlay ---------------- */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: #e6e6e6;
  z-index: 9999;
  display: none;
}

/* ---------------- Progress Bar ---------------- */
#progressContainer {
  width: 100%;
  background-color: #555;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1rem;
  display: none;
}
#progressBar {
  width: 0%;
  height: 20px;
  background-color: #4caf50;
}
#progressText {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 5px;
}
