/* Custom styles for the database component */

/* Make the grid fill the entire available space */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

#myGrid {
  width: 100%;
  height: 100%;
}

/* Custom styling for AG Grid cells */
.ag-cell {
  padding: 4px 12px;
}

/* Style for column headers */
.ag-header-cell-label {
  font-weight: 600;
  color: #16423c;
  /* brand-300 color */
  font-size: 15px;
  /* Increased font size */
}

/* Adjust header height and alignment */
.ag-header-cell {
  padding: 10px 12px !important;
  /* Increased padding */
}

/* Styling for the filter inputs */
input,
select {
  padding: 0.25rem;
  border: 1px solid #c4dad2;
  /* brand-100 color */
  border-radius: 0.25rem;
}

/* Custom cell styling for different data types */
.numeric-cell {
  text-align: right;
}

.boolean-cell-true {
  color: #6a9c89;
  /* brand-200 color */
  font-weight: 500;
}

.boolean-cell-false {
  color: #b91c1c;
}

/* Hover effect for rows */
.ag-row:hover {
  background-color: #eaf3ef !important;
  /* brand-bg-2 color */
}

/* Custom loading overlay style */
.ag-overlay-loading-center {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #c4dad2;
  /* brand-100 color */
  font-family: 'Inter', sans-serif;
  color: #16423c;
  /* brand-300 color */
}

/* Pagination buttons styling */
#prevPage:disabled,
#nextPage:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ag-header-cell-label {
    font-size: 0.875rem;
  }

  .ag-cell {
    padding: 4px 8px;
    font-size: 0.875rem;
  }
}

/* Make the grid itself more visible with brand colors */
.ag-theme-alpine {
  --ag-header-height: 42px;
  /* Increased header height */
  --ag-header-background-color: #eaf3ef;
  /* brand-bg-2 color */
  --ag-header-foreground-color: #16423c;
  /* brand-300 color */
  --ag-header-cell-hover-background-color: #d6e6db;
  /* Slightly darker on hover */
  --ag-row-height: 36px;
  --ag-row-border-color: #e9efec;
  /* brand-50 color */
  --ag-cell-horizontal-border: solid 1px var(--ag-row-border-color);
  --ag-border-color: #c4dad2;
  /* brand-100 color */
  --ag-selected-row-background-color: rgba(106, 156, 137, 0.2);
  /* brand-200 with transparency */
  --ag-font-family: 'Inter', sans-serif;
  --ag-font-size: 13px;
  --ag-alpine-active-color: #6a9c89;
  /* brand-200 color */
}

/* Style button states */
button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

/* Additional grid customizations */
.ag-header {
  border-bottom: 2px solid #6a9c89;
  /* brand-200 color */
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Remove the additional bottom padding from header */
.ag-header-row {
  padding-bottom: 0 !important;
}

.ag-row-odd {
  background-color: #f6fcf9;
  /* brand-bg color */
}

.ag-row-even {
  background-color: #ffffff;
}

/* Customized filters popup */
.ag-menu {
  border-radius: 4px;
  border-color: #6a9c89;
  /* brand-200 color */
}

/* Pagination info styling */
#paginationInfo {
  color: #16423c;
  /* brand-300 color */
  font-weight: 500;
}

/* Custom filter input styling */
input:focus,
select:focus {
  outline: none;
  border-color: #6a9c89;
  /* brand-200 color */
  box-shadow: 0 0 0 1px rgba(106, 156, 137, 0.2);
  /* brand-200 with transparency */
}

/* Page display styling */
#pageDisplay {
  background-color: #f6fcf9;
  border: 1px solid #c4dad2;
  border-radius: 0.25rem;
  color: #16423c;
  font-weight: 500;
  font-size: 0.8rem;
}

/* Floating filter styling - more compact */
.ag-floating-filter-body input {
  border: 1px solid #c4dad2;
  border-radius: 0.25rem;
  padding: 0.1rem 0.25rem;
  font-size: 0.75rem;
  margin: 5px 0;
}

/* Move floating filter closer to header */
.ag-floating-filter-full-body {
  margin-top: 0;
  padding: 5px 0;
}

/* Add space between the green border and input fields */
.ag-floating-filter-input {
  margin: 5px 0;
}

/* Add padding to floating filter container */
.ag-floating-filter {
  padding: 4px 0;
}

/* Fix for filter input positioning */
.ag-floating-filter-body {
  height: auto;
  padding: 3px 0;
}

/* Filter button container spacing */
.ag-floating-filter-button {
  margin: 3px 0;
}

/* Make the horizontal scrollbar thinner with green thumbs */
::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #6a9c89;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #16423c;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #6a9c89 #f1f1f1;
}

/* Country flag styles */
.country-cell {
  display: flex;
  align-items: center;
}

.country-flag {
  width: 20px;
  height: auto;
  margin-right: 6px;
  border-radius: 2px;
  border: 1px solid #e5e7eb;
}

/* Clean up some AG Grid defaults for more space */
.ag-root-wrapper {
  border: none;
}

.ag-cell-focus,
.ag-cell-no-focus {
  border: none !important;
}

/* Smaller filter buttons */
.ag-filter-apply-panel {
  padding: 4px;
}

.ag-filter-apply-panel button {
  font-size: 0.75rem;
  padding: 2px 6px;
}