body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  background-color: #f5f5f5;
  overflow: hidden;
}

/* LEFT-SIDE MAIN CONTAINER */
.container {
  width: 50vw; /* exactly half the screen */
  height: calc(100vh - 40px);
  margin: 20px;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.container::-webkit-scrollbar {
  display: none;
}

/* HEADER SPACING */
h1 {
  margin: 0 0 24px 0;
}

/* FORM FIELDS */
label {
  display: block;
  margin-top: 16px;
  font-weight: bold;
}

input,
select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-top: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* BUTTON STYLING */
button {
  margin-top: 30px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background-color: #3f51b5;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

button:disabled {
  background-color: #bbb;
  cursor: not-allowed;
}

button:hover:enabled {
  background-color: #2c3a9f;
}

#run_number_error {
  font-size: 0.9em;
}

.error-message {
  color: red;
  font-size: 0.9em;
  display: block;
  margin-top: 4px;
}

.slide-container {
  display: flex;
  width: 200vw;
  transition: transform 0.7s ease-in-out;
}

.slide {
  width: 100vw;
  box-sizing: border-box;
  padding: 0; /* This is key — it's outside the .container */
}

body.slide-next .slide-container {
  transform: translateX(-100vw);
}

/* Tool String Component Styles */
.component-container {
  display: flex;
  flex-direction: row; /* Force horizontal layout */
  align-items: flex-end; /* Align items to the bottom */
  margin-bottom: 10px;
  padding: 5px; /* Reduced padding */
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f5f5f5;
  position: relative; /* For positioning context */
}

.component-number {
  font-weight: bold;
  margin-right: 10px;
  min-width: 30px;
}

.component-select {
  width: 400px; /* Fixed width for the dropdown */
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  margin-right: 5px; /* Reduced margin */
  flex-shrink: 0; /* Prevent dropdown from shrinking */
  margin-bottom: 0; /* Remove bottom margin */
}

.component-buttons {
  display: flex;
  flex-direction: row; /* Force horizontal layout */
  gap: 2px; /* Minimal space between buttons */
  flex-shrink: 0; /* Prevent buttons from shrinking */
  margin-bottom: 0; /* Remove bottom margin */
  padding-bottom: 0; /* Remove bottom padding */
}

/* More specific selectors with !important to override any conflicting styles */
.component-container .component-button {
  background-color: #3f51b5 !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  padding: 1px 4px !important; /* Minimal padding */
  cursor: pointer !important;
  font-size: 9px !important; /* Even smaller font size */
  height: 16px !important; /* Much smaller height */
  white-space: nowrap !important;
  min-width: fit-content !important; /* Ensure button width fits content */
  line-height: 14px !important; /* Adjust line height for vertical centering */
  margin: 0 !important; /* Remove all margins */
  margin-top: 0 !important; /* Override any top margin */
}

.component-container .component-button:hover {
  background-color: #2c3a9f !important;
}

.component-container .remove-component {
  background-color: #ff5252 !important;
}

.component-container .remove-component:hover {
  background-color: #ff1744 !important;
}

.component-container .move-up-button {
  background-color: #4CAF50 !important;
}

.component-container .move-up-button:hover {
  background-color: #388E3C !important;
}

.component-container .move-down-button {
  background-color: #2196F3 !important;
}

.component-container .move-down-button:hover {
  background-color: #1976D2 !important;
}
