/* Custom CSS for AR Management Agent */

/* Add horizontal and vertical gap between action buttons */
.step button[class*="MuiButton"] {
  margin-right: 8px !important;
  margin-bottom: 1px !important;
}

/* Specific targeting for action buttons container */
div[class*="-ml-1.5"] button {
  margin-right: 8px !important;
  margin-bottom: 1px !important;
}

/* Gap between AskActionMessage buttons (reason codes, confirm/abort) */
/* Equal width for Confirm and Abort buttons */
button.break-words.h-auto.min-h-10.whitespace-normal {
  margin-right: 8px !important;
  margin-bottom: 1px !important;
  min-width: 180px !important;  /* Equal minimum width for all action buttons */
  width: 100% !important;  /* Full width in container */
  max-width: 300px !important;  /* Prevent excessive width */
}

/* Additional spacing for button groups */
.step-container button {
  margin-right: 8px !important;
  margin-bottom: 1px !important;
}

/* Scrollable table container */
.step table,
.message table {
  display: block !important;
  max-height: 400px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

html.dark .step table,
html.dark .message table {
  border-color: #475569 !important;
  background: #1e293b !important;
}

/* Make table headers sticky when scrolling */
.step table thead,
.message table thead {
  position: sticky !important;
  top: 0 !important;
  background: #f8fafc !important;
  z-index: 10 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html.dark .step table thead,
html.dark .message table thead {
  background: #334155 !important;
}

/* Table body */
.step table tbody,
.message table tbody {
  display: block !important;
  max-height: 350px !important;
  overflow-y: auto !important;
}

/* Ensure table rows maintain layout */
.step table thead tr,
.message table thead tr,
.step table tbody tr,
.message table tbody tr {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
}

/* Add padding to table cells */
.step table th,
.message table th,
.step table td,
.message table td {
  padding: 8px 12px !important;
  text-align: left !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html.dark .step table th,
html.dark .message table th,
html.dark .step table td,
html.dark .message table td {
  border-bottom-color: #475569 !important;
}

/* Alternate row colors for better readability */
.step table tbody tr:nth-child(even),
.message table tbody tr:nth-child(even) {
  background: #f9fafb !important;
}

html.dark .step table tbody tr:nth-child(even),
html.dark .message table tbody tr:nth-child(even) {
  background: #1e293b !important;
}

/* Custom scrollbar for tables */
.step table::-webkit-scrollbar,
.message table::-webkit-scrollbar,
.step table tbody::-webkit-scrollbar,
.message table tbody::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

.step table::-webkit-scrollbar-track,
.message table::-webkit-scrollbar-track,
.step table tbody::-webkit-scrollbar-track,
.message table tbody::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 4px !important;
}

.step table::-webkit-scrollbar-thumb,
.message table::-webkit-scrollbar-thumb,
.step table tbody::-webkit-scrollbar-thumb,
.message table tbody::-webkit-scrollbar-thumb {
  background: #94a3b8 !important;
  border-radius: 4px !important;
}

.step table::-webkit-scrollbar-thumb:hover,
.message table::-webkit-scrollbar-thumb:hover,
.step table tbody::-webkit-scrollbar-thumb:hover,
.message table tbody::-webkit-scrollbar-thumb:hover {
  background: #64748b !important;
}

html.dark .step table::-webkit-scrollbar-track,
html.dark .message table::-webkit-scrollbar-track,
html.dark .step table tbody::-webkit-scrollbar-track,
html.dark .message table tbody::-webkit-scrollbar-track {
  background: #334155 !important;
}

html.dark .step table::-webkit-scrollbar-thumb,
html.dark .message table::-webkit-scrollbar-thumb,
html.dark .step table tbody::-webkit-scrollbar-thumb,
html.dark .message table tbody::-webkit-scrollbar-thumb {
  background: #64748b !important;
}

html.dark .step table::-webkit-scrollbar-thumb:hover,
html.dark .message table::-webkit-scrollbar-thumb:hover,
html.dark .step table tbody::-webkit-scrollbar-thumb:hover,
html.dark .message table tbody::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}
