/* Column Toggle Styling */

/* Ensure columns have a smooth transition */
[data-column-toggle-target="column"] {
  transition: all 0.3s ease-in-out;
}

/* Collapsed column styling */
.column-collapsed {
  width: 1.5rem !important;
  min-width: 1.5rem !important;
  max-width: 1.5rem !important;
  overflow: visible !important;
  position: relative;
  border-right: 1px solid #e5e7eb; /* border-border */
  z-index: 5;
  background-color: #f9fafb; /* bg-background-light */
}

/* Hide column header content in collapsed state, except for the toggle button */
.column-collapsed > div:first-child {
  opacity: 0.2;
  overflow: hidden;
  height: 3rem;
}

/* Keep toggle button visible in collapsed state */
.column-collapsed > div:first-child button[data-action*="column-toggle#toggle"] {
  opacity: 1;
  position: absolute;
  right: 0.25rem;
  z-index: 20;
}

/* Rotate label for collapsed columns */
.column-collapsed .column-label {
  transform: rotate(-90deg);
  position: absolute;
  top: 50%;
  left: -2rem;
  width: 6rem;
  text-align: center;
  transform-origin: center right;
  font-weight: 500;
  color: #4b5563; /* text-text-secondary */
  background: rgba(249, 250, 251, 0.9); /* bg-background-light with opacity */
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  z-index: 10;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Make toggle button more visible when column is collapsed */
.column-collapsed .toggle-button {
  position: absolute;
  top: 1rem;
  right: 0.25rem;
  background-color: #f3f4f6; /* bg-background-light */
  border: 1px solid #d1d5db; /* border-border */
  padding: 0.375rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 20;
}

/* Add hover effect for toggle button */
.column-collapsed .toggle-button:hover {
  background-color: #e5e7eb; /* bg-border-light */
  color: #4f46e5; /* text-primary */
}

/* Special styling for editing mode */
.editing-active [data-column-id="details"] {
  flex: 1;
  width: 100%;
}

/* Make the details panel expand to fill width when in edit mode */
.editing-mode-details .col-details-expanded {
  grid-column: span 11 / span 11 !important;
  flex: 1 !important;
  width: 100% !important;
  max-width: none !important;
  transition: all 0.3s ease-in-out;
}

/* When other columns are collapsed, make sure edit pane expands */
.editing-mode-details [data-column-id="details"] {
  flex-grow: 1;
  min-width: 0;
  width: auto !important;
}

/* Hide other columns more aggressively in editing mode */
.editing-mode-details .column-collapsed:not([data-column-id="details"]) {
  width: 1rem !important;
  min-width: 1rem !important;
  max-width: 1rem !important;
  flex: 0 0 1rem !important;
}

/* Ensure the editing container uses all available space */
.editing-mode-details {
  display: flex !important;
  width: 100% !important;
}

/* Ensure the edit form content doesn't overflow */
.editing-mode-details [data-column-id="details"] form {
  max-width: 100%;
  width: 100%;
}

/* Make form fields use available width in edit mode */
.editing-mode-details [data-column-id="details"] input,
.editing-mode-details [data-column-id="details"] select,
.editing-mode-details [data-column-id="details"] textarea {
  width: 100% !important;
  max-width: 100% !important;
}

/* Make sure collapsed panel is completely contained */
.column-collapsed {
  position: relative !important;
  overflow: hidden !important;
}

/* Ensure the collapsed column's content is hidden */
.column-collapsed [data-column-toggle-target="contentArea"] {
  display: none !important;
}

/* Ensure collapsed buttons remain visible with proper styling */
.column-collapsed .toggle-button svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Make sure column layout works in all browser widths */
@media (max-width: 1280px) {
  .column-collapsed {
    width: 1rem !important;
    min-width: 1rem !important;
    max-width: 1rem !important;
  }
  
  .column-collapsed .column-label {
    font-size: 0.75rem;
  }
}
