*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


#editor_pack1 {
    position: absolute;
    top: 10px;
    right: 10px;
    /* background-color: brown; */
    z-index: 8999;
}

#sceneViewControls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 5vw;
}

#sceneViewControls button {
  margin: 5px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}

#playButtons1 {
  position: absolute;
  top: 20px;
  right: 200px;
  z-index: 10;
  width: 5vw;
}

#playButtons1 button {
  margin: 5px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}



.generalRowData td:nth-child(1), .generalRowData td:nth-child(8) {
  background-color: #0e3ea7 !important;
}


.modelRowData td:nth-child(1), .modelRowData td:nth-child(8) {
  background-color: #cf4610 !important;
}






/* Wrapper to position the popover relative to the input */
.trns2p-container {
  position: relative;
  display: inline-block;
}

.rot-container {
  position: relative;
  display: inline-block;
}

.rot-popover {
  display: none; /* Hidden by default; JS changes this to 'flex' */
  position: absolute;
  top: 100%; /* Position below the input */
  left: 0;   /* Align to the left of the input */
  width: 140px; /* A bit wider to accommodate the new button */
  background-color: #33373a;
  border: 1px solid #555;
  border-radius: 6px;
  z-index: 1010;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-direction: column;
  gap: 4px;
}

/* The popover menu */
.trns2p-popover {
  display: none; /* Hidden by default; JS changes this to 'flex' */
  position: absolute;
  top: 100%; /* Position below the input */
  left: 0;   /* Align to the left of the input */
  width: 140px; /* A bit wider to accommodate the new button */
  background-color: #33373a;
  border: 1px solid #555;
  border-radius: 6px;
  z-index: 1010;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-direction: column;
  gap: 4px;
}

.rot-button-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch; /* Make buttons the same height */
  gap: 4px;
}


/* MODIFIED: This is now a flex container for the two buttons */
.trns2p-button-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch; /* Make buttons the same height */
  gap: 4px;
}

.rot-option-btn {
  flex-grow: 1; /* Allows this button to take up the remaining space */
  background-color: #4a5057;
  color: #ddd;
  border: none;
  padding: 6px 10px;
  text-align: left;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

/* Main option button */
.trns2p-option-btn {
  flex-grow: 1; /* Allows this button to take up the remaining space */
  background-color: #4a5057;
  color: #ddd;
  border: none;
  padding: 6px 10px;
  text-align: left;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.trns2p-option-btn:hover {
  background-color: #5a6067;
}

.rot-action-btn {

  flex-shrink: 0; /* Prevents the button from shrinking */
  width: 28px;
  height: 28px;
  background-color: #4a5057;
  color: #ddd;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

/* NEW: Style for the small action button */
.trns2p-action-btn {
  flex-shrink: 0; /* Prevents the button from shrinking */
  width: 28px;
  height: 28px;
  background-color: #4a5057;
  color: #ddd;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.trns2p-action-btn:hover , .rot-action-btn:hover {
  background-color: #5a6067;
}

/* Generic style for ANY winning option */
.trns2p-option-btn.is-winner ,.rot-option-btn.is-winner  {
  color: #ffffff;
  font-weight: bold;
  padding-right: 28px;
}

/* Ranked background colors for the top 3 winners */
.trns2p-option-btn.is-winner-1 { background-color: #28a745; } /* Green */
.trns2p-option-btn.is-winner-2 { background-color: #fd7e14; } /* Orange */
.trns2p-option-btn.is-winner-3 { background-color: #dc3545; } /* Red */

/* The pseudo-element for the index number */
.trns2p-option-btn.is-winner::after {
  content: var(--winner-rank, '#'); 
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  background-color: rgba(0,0,0,0.3);
  border-radius: 3px;
  padding: 2px 5px;
  line-height: 1;
}

/* Container to correctly position the pop-up */
.substep-name-container {
  position: relative;
}

/* The pop-up container */
.substep-name-editor {
  display: none; /* Hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  width: 350px;
  z-index: 1000;
  background-color: #2d2d2d;
  border: 1px solid #555;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  
}

/* Styling for the textarea itself */
.substep-name-editor textarea {
  width: 100%;
  border: none;
  background-color: #070122;
  color: #ddd;
  padding: 8px;
  font-family: monospace;
  font-size: 12px;
  resize: vertical; /* Allow vertical resizing */
  outline: none;
  min-height: 50px;
}
/* Use a monospace font for the editor for better character alignment */
.substep-name-editor-div {
  display: none; /* Hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  width: 350px; /* Wider for better editing */
  min-height: 60px; /* Based on 3 rows of text */
  z-index: 1000;
  background-color: #2d2d2d;
  border: 1px solid #555;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  padding: 8px;
  font-family: monospace;
  font-size: 12px;
  color: #ddd;
  outline: none;
  white-space: pre-wrap; /* Preserve whitespace and wrap text */
}

/* --- Syntax Highlight Colors --- */

/* For macros like //#1={{...}}// */
.syntax-macro {
  color: #c586c0; /* Light purple */
}
.syntax-macro-brackets {
  color: #ffd700; /* Gold */
}

/* For keywords like **TST ME** */
.syntax-keyword {
  color: #569cd6; /* Light blue */
  font-weight: bold;
}
