$bg-dark: #1e1e1e;
$bg-item: #2a2a2a;
$bg-item-hover: #3a3a3a;
$accent-blue: #6562f5;
$border-color: #404040;
$text-light: #e0e0e0;
$text-secondary: #aaa;
$shadow-color: rgba(0, 0, 0, 0.2);
$transition-default: all 0.2s ease;

.wrapper {
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 1px 1px 10px rgba(3, 3, 5, 0.35);
}

// ::ng-deep .ag-grid-staff {
//   .ag-center-cols-container {
//     min-height: 180px;
//   }
// }
// ::ng-deep .ag-grid-staff {
//   .ag-viewport {
//     &.ag-center-cols-viewport {
//       min-height: 100px;
//     }
//   }
// }
// ::ng-deep .ag-grid-staff {
//   .ag-root-wrapper {
//     overflow: visible;
//   }
// }
::ng-deep .ag-grid-staff {
  .ag-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
}
//index column
//cells
::ng-deep .ag-grid-staff .index-cell {
  padding: 0 !important;
}

//tags column
//cells
::ng-deep .ag-grid-staff .tags-cell-wrapper {
  padding: 5px;
}

::ng-deep .ag-grid-staff .tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  padding: 4px 10px;
  line-height: 1.2;
  border-radius: 6px;
  background-color: #2a2a2a;
  color: #e6e6e6;
  border: 1px solid #3a3a3a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  cursor: pointer;
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 24px;
  margin-bottom: 6px;
}

::ng-deep .ag-grid-staff .tag:hover {
  background-color: #333;
  border-color: #444;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
//tools column
//cells
::ng-deep .ag-grid-staff .tools-cell-wrapper {
  display: flex;
  flex-direction: column;

  gap: 4px;
  margin: 5px 0;
  padding: 5px;
  color: #f0f0f0; // Light text for visibility

  .tool-item {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    border: 1px solid $border-color;

    border-radius: 4px;
    padding: 6px 8px;

    margin-bottom: 4px; // Adds spacing between tool items

    .tool-icon {
      margin-right: 6px;
      font-style: normal;
      color: #f0f0f0; // Light icon color
    }
    &:hover {
      background-color: #3a3a3a;
    }
    .tool-name-text {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 13px;
      font-weight: 500;
      color: #f0f0f0; // Light text color
    }
  }
}

::ng-deep .ag-grid-staff .no-tools {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  color: $text-secondary;
  font-style: italic;
  padding: 4px 8px;
  font-size: 0.8rem;
}
//checkbox cells
::ng-deep .ag-grid-staff .ag-checkbox-cell {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

::ng-deep .ag-grid-staff .ag-checkbox-edit {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

//agent role cells
::ng-deep .ag-grid-staff .ag-cell.agent-role-cell .ag-cell-wrapper {
  //   :where(.ag-cell-value) {
  //     height: auto !important;
  //   }
  font-weight: 500;
  font-size: 14px;
}

//large input
::ng-deep .ag-large-text-input .ag-input-field-input.ag-text-area-input {
  font-size: 14px !important; // Set minimum font size
  line-height: 1.6;
}

//actions-cell
::ng-deep .ag-grid-staff .action-cell {
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  .action-icon {
    font-size: 1.2rem;
    color: #b1b1b1;
    transition: color 0.2s, transform 0.2s;

    &:hover {
      color: #3498db; // Change to a light blue on hover
      transform: scale(1.1); // Slightly increase the size on hover
    }
  }
}
::ng-deep .ag-grid-staff .ag-cell.popup-open {
  border: 1px solid #6562f5 !important; /* Example: a blue border */
}

::ng-deep .ag-grid-staff .llm-item {
  display: inline-flex;
  align-items: center;
  margin: 6px auto !important;
  padding: 6px 8px;
  background-color: #2a2a2a;
  border-radius: 4px;
  cursor: default; // or pointer if you want it clickable
  transition: background-color 0.3s, border 0.3s;
  width: 100%; // Ensure the item uses available width inside the cell
  border: 1px solid $border-color;

  &:hover {
    background-color: #3a3a3a;
  }

  &.selected {
    background-color: #444;
    border: 2px solid #6562f5;
  }

  .chatgpt-logo {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    border-radius: 4px;
  }

  .item-content {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0; // Ensures proper ellipsis functionality
    justify-content: flex-start;

    .item-text {
      line-height: 1.3;
      font-size: 13px;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
      max-width: 100%; // Allow text to stretch based on content

      .custom-name {
        color: #aaa;
        margin-left: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}

::ng-deep .ag-grid-staff .cell-warning {
  border: 1px solid orange !important;
}
