/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

// Main container - always compact
.agent-interaction {
  display: flex;
  flex-direction: column;
  background: #fafafa;
  padding: 8px 12px;

  &.compact {
    padding: 6px 8px;
  }
}

// Visualization rendering
.visualization-section {
  margin-bottom: 10px;
}

.visualization-iframe {
  width: 100%;
  height: 450px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #fff;
}

// Sample Records Table
.sample-records-section {
  margin-bottom: 10px;
}

.sample-records-table-wrapper {
  max-height: 200px;
  overflow: auto;
  border: 1px solid #e8e8e8;
  border-radius: 4px;

  // Custom scrollbar
  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  &::-webkit-scrollbar-track {
    background: #f0f0f0;
  }
  &::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
    &:hover {
      background: #999;
    }
  }
}

.sample-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;

  th,
  td {
    padding: 4px 8px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #f0f0f0;
  }

  th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #e8e8e8;
  }

  td {
    color: #333;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  tbody tr:hover {
    background: #f5f5f5;
  }

  .ellipsis-row td {
    text-align: center;
    color: #999;
    font-weight: 500;
    padding: 2px 8px;
    background: #fafafa;
  }
}

// Column Statistics
.column-stats-section {
  margin-bottom: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #fff;
}

.column-stats-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px;
  font-weight: 600;
  color: #555;

  i {
    font-size: 12px;
    color: #1890ff;
  }
}

.column-stats-list {
  max-height: 180px;
  overflow: auto;
  scrollbar-width: thin;

  &::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  &::-webkit-scrollbar-track {
    background: #f0f0f0;
  }
  &::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }
}

.column-stat-item {
  padding: 4px 10px;
  border-bottom: 1px solid #f5f5f5;

  &:last-child {
    border-bottom: none;
  }
}

.column-stat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;

  .col-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    font-family: "SFMono-Regular", Consolas, monospace;
  }

  .col-type {
    font-size: 10px;
    color: #8c8c8c;
    background: #f0f0f0;
    padding: 0 4px;
    border-radius: 2px;
  }
}

.column-stat-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;

  .stat-entry {
    font-size: 10px;
    color: #595959;
  }

  .stat-key {
    color: #8c8c8c;
  }
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-select {
  flex: 1;
  min-width: 100px;
  max-width: 180px;
}

.agent-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #d9d9d9;
  margin-right: 6px;
  vertical-align: middle;

  &.connected {
    background-color: #52c41a;
  }
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.feedback-input {
  width: 100%;
  font-size: 13px;
  resize: none;
}

.controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.hint-text {
  font-size: 11px;
  color: #999;
  margin-right: auto;
}

.send-btn {
  display: flex;
  align-items: center;
  gap: 4px;

  i {
    font-size: 12px;
  }
}

.not-connected-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: #999;
  font-size: 13px;
  background: #f5f5f5;
  border-radius: 6px;
  margin-top: 8px;

  i {
    font-size: 18px;
  }
}
