/* ag-Grid Dark Mode Support for Enterprise */
/* This file provides dark mode theming for ag-Grid Enterprise */

/* Dark mode CSS custom properties for ag-theme-quartz */
.dark .ag-theme-quartz {
  /* Core colors */
  --ag-background-color: rgb(31 41 55); /* gray-800 */
  --ag-foreground-color: rgb(243 244 246); /* gray-100 */
  --ag-border-color: rgb(75 85 99); /* gray-600 */
  --ag-secondary-border-color: rgb(55 65 81); /* gray-700 */
  
  /* Header colors */
  --ag-header-background-color: rgb(31 41 55); /* gray-800 */
  --ag-header-foreground-color: rgb(229 231 235); /* gray-200 */
  --ag-header-cell-hover-background-color: rgb(55 65 81); /* gray-700 */
  --ag-header-cell-moving-background-color: rgb(55 65 81); /* gray-700 */
  
  /* Row colors */
  --ag-row-hover-color: rgb(55 65 81); /* gray-700 */
  --ag-selected-row-background-color: rgba(59 130 246 / 0.1); /* blue-500/10 */
  --ag-odd-row-background-color: rgba(0 0 0 / 0.03);
  --ag-modal-overlay-background-color: rgba(0 0 0 / 0.66);
  
  /* Input colors */
  --ag-input-border-color: rgb(75 85 99); /* gray-600 */
  --ag-input-focus-border-color: rgb(59 130 246); /* blue-500 */
  --ag-input-background-color: rgb(55 65 81); /* gray-700 */
  --ag-input-disabled-background-color: rgb(31 41 55); /* gray-800 */
  --ag-input-disabled-border-color: rgb(55 65 81); /* gray-700 */
  
  /* Cell editing */
  --ag-cell-editing-background-color: rgb(55 65 81); /* gray-700 */
  
  /* Widget colors */
  --ag-widget-container-horizontal-padding: 0.75rem;
  --ag-widget-container-vertical-padding: 0.75rem;
  --ag-widget-horizontal-spacing: 0.5rem;
  --ag-widget-vertical-spacing: 0.5rem;
  
  /* Menu colors */
  --ag-menu-background-color: rgb(31 41 55); /* gray-800 */
  --ag-menu-border-color: rgb(75 85 99); /* gray-600 */
  --ag-menu-separator-color: rgb(55 65 81); /* gray-700 */
  
  /* Tooltip colors */
  --ag-tooltip-background-color: rgb(31 41 55); /* gray-800 */
  --ag-tooltip-border-color: rgb(75 85 99); /* gray-600 */
  
  /* Checkbox & toggle colors */
  --ag-checkbox-background-color: rgb(55 65 81); /* gray-700 */
  --ag-checkbox-checked-color: rgb(59 130 246); /* blue-500 */
  --ag-checkbox-unchecked-color: rgb(107 114 128); /* gray-500 */
  --ag-checkbox-indeterminate-color: rgb(107 114 128); /* gray-500 */
  
  /* Range selection */
  --ag-range-selection-border-color: rgb(59 130 246); /* blue-500 */
  --ag-range-selection-background-color: rgba(59 130 246 / 0.2); /* blue-500/20 */
  --ag-range-selection-background-color-2: rgba(59 130 246 / 0.36);
  --ag-range-selection-background-color-3: rgba(59 130 246 / 0.49);
  --ag-range-selection-background-color-4: rgba(59 130 246 / 0.59);
  
  /* Icon colors */
  --ag-icon-font-color: rgb(156 163 175); /* gray-400 */
  
  /* Chip colors */
  --ag-chip-background-color: rgba(107 114 128 / 0.2); /* gray-500/20 */
  --ag-chip-border-color: transparent;
  
  /* Advanced filter */
  --ag-advanced-filter-builder-button-bar-background-color: rgb(31 41 55); /* gray-800 */
  --ag-advanced-filter-builder-button-bar-border: 1px solid rgb(75 85 99); /* gray-600 */
  --ag-advanced-filter-builder-indent-size: 1.5rem;
  --ag-advanced-filter-builder-join-pill-color: rgb(59 130 246); /* blue-500 */
}

/* Ensure proper text color inheritance in dark mode */
.dark .ag-theme-quartz .ag-cell,
.dark .ag-theme-quartz .ag-header-cell-label,
.dark .ag-theme-quartz .ag-header-group-cell-label {
  color: inherit;
}

/* Fix filter input styling in dark mode */
.dark .ag-theme-quartz .ag-filter-toolpanel-search,
.dark .ag-theme-quartz .ag-floating-filter-input,
.dark .ag-theme-quartz input[type="text"],
.dark .ag-theme-quartz input[type="number"],
.dark .ag-theme-quartz select {
  background-color: rgb(55 65 81); /* gray-700 */
  border-color: rgb(75 85 99); /* gray-600 */
  color: rgb(243 244 246); /* gray-100 */
}

.dark .ag-theme-quartz input[type="text"]:focus,
.dark .ag-theme-quartz input[type="number"]:focus,
.dark .ag-theme-quartz select:focus {
  border-color: rgb(59 130 246); /* blue-500 */
  outline: none;
}

/* Fix button styling in dark mode */
.dark .ag-theme-quartz .ag-button {
  background-color: rgb(55 65 81); /* gray-700 */
  border-color: rgb(75 85 99); /* gray-600 */
  color: rgb(243 244 246); /* gray-100 */
}

.dark .ag-theme-quartz .ag-button:hover {
  background-color: rgb(75 85 99); /* gray-600 */
}

/* Fix pagination styling in dark mode */
.dark .ag-theme-quartz .ag-paging-number,
.dark .ag-theme-quartz .ag-paging-row-summary {
  color: rgb(209 213 219); /* gray-300 */
}

/* Fix context menu styling in dark mode */
.dark .ag-theme-quartz .ag-menu-option {
  color: rgb(243 244 246); /* gray-100 */
}

.dark .ag-theme-quartz .ag-menu-option:hover {
  background-color: rgb(55 65 81); /* gray-700 */
}

/* Fix column menu tabs in dark mode */
.dark .ag-theme-quartz .ag-tab {
  background-color: transparent;
  color: rgb(156 163 175); /* gray-400 */
}

.dark .ag-theme-quartz .ag-tab.ag-tab-selected {
  background-color: rgb(55 65 81); /* gray-700 */
  color: rgb(243 244 246); /* gray-100 */
}