/* Modern AG Grid Styling - Drop-in replacement for leads-grid.css */
:root {
  --primary-color: #3b82f6;
  --primary-light: rgba(59, 130, 246, 0.1);
  --primary-hover: rgba(59, 130, 246, 0.15);
  --secondary-color: #10b981;
  --text-color: #1f2937;
  --light-text: #6b7280;
  --background-color: #ffffff;
  --hover-color: #f9fafb;
  --border-color: #e5e7eb;
  --row-height: 48px; /* Reduced from 56px */
  --header-height: 40px; /* Reduced from 48px */
  --font-family: 'Gilroy-Medium', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Grid Container */
.ag-root-wrapper {
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #e5e7eb !important;
  overflow: hidden;
}

.ag-layout-normal {
  height: 100% !important;
}

/* Header Styling */
.ag-header {
  background-color: #f9fafb !important;
  border-bottom: 1px solid var(--border-color) !important;
  height: 40px !important; /* Reduced from 48px */
}

.ag-header-cell {
  font-family: var(--font-family) !important;
  font-weight: 600 !important;
  color: var(--text-color) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
  font-size: 12px !important;
  line-height: 40px !important; /* Reduced from var(--header-height) */
  padding: 0 16px !important;
  border-right: 1px solid #e5e7eb !important;
}

.ag-header-cell-label {
  color: var(--light-text) !important;
}

.ag-header-cell-resize {
  opacity: 0;
  transition: opacity 0.2s ease;
  width: 8px !important;
  right: -4px !important;
}

.ag-header-cell:hover .ag-header-cell-resize {
  opacity: 1;
}

/* Row Styling */
.ag-row {
  height: 48px !important; /* Reduced from 56px */
  border-bottom: 1px solid #f3f4f6 !important;
  transition: background-color 0.2s ease-in-out;
}

.ag-row:hover {
  background-color: var(--hover-color) !important;
}

.ag-row-even {
  background-color: #ffffff !important;
}

.ag-row-odd {
  background-color: #f9fafb !important;
}

/* Highlight the current row on hover */
.ag-row.ag-row-hover {
  background-color: #f0f7ff !important;
}

/* Cell Styling */
.ag-cell {
  font-family: var(--font-family) !important;
  font-size: 14px !important;
  color: var(--text-color) !important;
  line-height: 48px !important; /* Matches reduced row height */
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  border-right: 1px solid #e5e7eb !important;
}

/* Name Column Styling */
.ag-cell[col-id="name"] {
  font-weight: 600 !important;
}

.ag-cell-wrapper {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

/* Row Selection Styling */
.ag-row-selected {
  background-color: var(--primary-light) !important;
}

.ag-row-selected:hover {
  background-color: var(--primary-hover) !important;
}

/* Checkbox Styling */
.ag-checkbox-input-wrapper {
  border: 2px solid #d1d5db !important;
  border-radius: 4px !important;
  width: 18px !important;
  height: 18px !important;
  margin-right: 8px !important;
  transition: all 0.2s ease;
}

.ag-checkbox-input-wrapper.ag-checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* Loading overlay */
.ag-overlay-loading-wrapper {
  background-color: rgba(255, 255, 255, 0.75) !important;
  align-items: center !important;
  justify-content: center !important;
}

.ag-overlay-loading-center {
  background-color: white !important;
  border-radius: 8px !important;
  padding: 16px 24px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  font-family: var(--font-family) !important;
}

/* Custom Utility Classes */
.lead_cell {
  font-family: var(--font-family) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 25px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--text-color) !important;
}

.cell_label {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 200px !important;
}

/* Last Activity Column */
.ag-cell[col-id="lastActivity"] {
  color: var(--light-text) !important;
}

/* Created Date Column */
.ag-cell[col-id="createdAt"] {
  color: var(--light-text) !important;
}

/* Source Column */
.ag-cell[col-id="integration"] {
  font-size: 13px !important;
}

/* Scrollbars */
.ag-body-viewport::-webkit-scrollbar {
  width: 8px;
  height: 12px; /* Increased height for horizontal scrollbar */
}

.ag-body-viewport::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.ag-body-viewport::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  border: 1px solid #f1f1f1;
}

.ag-body-viewport::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Make horizontal scrollbar more visible */
.ag-body-horizontal-scroll-viewport::-webkit-scrollbar {
  height: 14px; /* Even thicker for the dedicated horizontal scrollbar */
}

.ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb {
  background: #a1a1a1;
  border-radius: 4px;
  min-width: 50px; /* Ensure the thumb has a minimum width */
}

/* Action Buttons */
.ag-cell .action-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  color: var(--text-color);
  transition: all 0.2s ease;
  cursor: pointer;
  opacity: 0.7;
}

.ag-cell .action-button:hover {
  background-color: #e5e7eb;
  opacity: 1;
}

/* Empty State */
.ag-overlay-no-rows-center {
  padding: 24px !important;
  background-color: white !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  font-family: var(--font-family) !important;
}

/* Distribution Chart Icon */
.ag-header-cell .chart-icon {
  cursor: pointer;
  margin-left: 4px;
  color: var(--light-text);
}

.ag-header-cell .chart-icon:hover {
  color: var(--primary-color);
}

/* No results state */
.ag-overlay-no-rows-wrapper {
  padding: 32px !important;
}

/* Filter active state */
.ag-header-cell.filter-active .ag-header-cell-label {
  color: var(--primary-color) !important;
  font-weight: 700 !important;
}

/* Preserve existing pill styles from your code */
.ag-cell .pending, 
.ag-cell .demo,
.ag-cell .approved,
.ag-cell .admin, 
.ag-cell .org, 
.ag-cell .ddd {
  /* Maintain existing styles while ensuring readability */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 16px !important;
  padding: 4px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-align: center !important;
  min-width: 70px !important;
}