/* Tabulator table base styling - light theme */
.backup-comparison-container .tabulator {
  font-size: 0.9rem;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Header styling - light background with dark text for readability */
.backup-comparison-container .tabulator-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
}

.backup-comparison-container .tabulator-col {
  background-color: #f8f9fa;
  border-right: 1px solid #ddd;
}

.backup-comparison-container .tabulator-col-title {
  color: #333;
  font-weight: 600;
}

/* Header filter inputs and dropdowns */
.backup-comparison-container .tabulator-header-filter input,
.backup-comparison-container .tabulator-header-filter select {
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
}

.backup-comparison-container .tabulator-header-filter input:focus,
.backup-comparison-container .tabulator-header-filter select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Range sliders should not inherit text-input spacing, or the thumb won't reach the visual edges */
.backup-comparison-container .tabulator-header-filter input[type="range"] {
  padding: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
}

/* Multi-select filter styling */
.backup-comparison-container .tabulator-header-filter select[multiple] {
  min-height: 60px;
  max-height: 120px;
}

/* Checkbox filter styling */
.backup-comparison-container .tabulator-header-filter label {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  margin: 0;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.backup-comparison-container .tabulator-header-filter label:hover {
  background-color: #f0f0f0;
}

.backup-comparison-container .tabulator-header-filter input[type="checkbox"] {
  margin: 0 8px 0 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* Filter popup */
.filter-popup {
  position: absolute;
  z-index: 1000;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  min-width: 200px;
  max-width: 300px;
}

.filter-popup-content {
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

/* Clear all button */
.filter-clear-btn {
  width: 100%;
  padding: 6px 12px;
  margin-bottom: 8px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #666;
  transition: background-color 0.15s ease;
}

.filter-clear-btn:hover {
  background-color: #e9ecef;
}

/* Checkbox labels in popup */
.filter-checkbox-label {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  margin: 0;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s ease;
  user-select: none;
}

.filter-checkbox-label:hover {
  background-color: #f0f0f0;
}

.filter-checkbox-label input[type="checkbox"] {
  margin: 0 8px 0 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.filter-icon {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.filter-icon:hover {
  opacity: 1;
}

/* Status row above the table */
.backup-comparison-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  color: #333;
  font-size: 0.9rem;
}

.backup-comparison-filters {
  display: none;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid #bbb;
  color: #555;
}

.backup-comparison-status-number {
  font-weight: 700;
}

.backup-comparison-clear-filters {
  border: 0;
  padding: 0;
  background: transparent;
  color: #0066cc;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.backup-comparison-clear-filters:hover {
  color: #004c99;
}

/* Table cells */
.backup-comparison-container .tabulator-cell {
  padding: 10px 12px;
  border-right: 1px solid #e5e5e5;
}

/* Make provider names bold and stand out */
.backup-comparison-container .tabulator-cell:first-child,
.backup-comparison-container .tabulator-row .tabulator-cell[tabulator-field="provider"] {
  font-weight: 700;
  color: #222;
}

/* Also make provider names bold in the plain HTML table before JS loads */
.backup-comparison-container table tbody td:first-child {
  font-weight: 700;
  color: #222;
}

.provider-link {
  transition: opacity 0.2s ease;
  width: 100%;
  font-weight: normal;
  text-align: center;
}

.provider-link:hover {
  opacity: 0.7;
}

.provider-name {
  font-weight: 400;
  font-size: 0.85rem;
  color: #333;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

/* Provider logo styling - maintain aspect ratio */
.backup-comparison-container .provider-logo {
  max-width: 100px !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block;
}

/* Row styling */
.backup-comparison-container .tabulator-row {
  min-height: 40px;
}

.backup-comparison-container .tabulator-row:hover {
  background-color: #f9f9f9 !important;
}

.backup-comparison-container .tabulator-row.tabulator-row-even {
  background-color: #fafafa;
}

/* Pagination styling */
.backup-comparison-container .tabulator-footer {
  padding: 10px;
  border-top: 1px solid #ddd;
  background-color: #f5f5f5;
  font-size: 0.85rem;
}

.backup-comparison-container .tabulator-page {
  margin: 0 2px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background-color: #fff;
  cursor: pointer;
}

.backup-comparison-container .tabulator-page:hover {
  background-color: #e9e9e9;
}

.backup-comparison-container .tabulator-page.active {
  background-color: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

/* Responsive collapse button styling */
.backup-comparison-container .tabulator-responsive-collapse-toggle {
  padding: 0 8px;
  cursor: pointer;
  font-size: 1.1rem;
  user-select: none;
}

.backup-comparison-container .tabulator-responsive-collapse-toggle:hover {
  opacity: 0.7;
}

/* Collapsed row details */
.backup-comparison-container .tabulator-responsive-collapse {
  padding: 10px;
  background-color: #f9f9f9;
  border-top: 1px solid #e5e5e5;
}

.backup-comparison-container .tabulator-responsive-collapse-table {
  width: 100%;
}

.backup-comparison-container .tabulator-responsive-collapse-table tr {
  display: flex;
  padding: 4px 0;
}

.backup-comparison-container .tabulator-responsive-collapse-table td {
  flex: 1;
  padding: 4px;
}

.backup-comparison-container .tabulator-responsive-collapse-table td:first-child {
  font-weight: 600;
  min-width: 40%;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .backup-comparison-status {
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
  }

  .backup-comparison-container .tabulator {
    font-size: 0.85rem;
  }

  .backup-comparison-container .tabulator-cell {
    padding: 8px 10px;
  }

  .backup-comparison-container .tabulator-header-filter input {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  .backup-comparison-container .tabulator-footer {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .backup-comparison-container .tabulator {
    font-size: 0.8rem;
  }

  .backup-comparison-container .tabulator-cell {
    padding: 6px 8px;
  }

  /* Make pagination controls more compact */
  .backup-comparison-container .tabulator-page {
    padding: 3px 6px;
    font-size: 0.75rem;
  }
}

/* Empty table placeholder */
.backup-comparison-container .tabulator-placeholder {
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

/* Ensure table is readable with sufficient contrast */
.backup-comparison-container .tabulator-cell,
.backup-comparison-container .tabulator-col-title {
  color: #333;
}

/* Sort arrows */
.backup-comparison-container .tabulator-col-sorter {
  color: #999;
}

.backup-comparison-container .tabulator-col.tabulator-sortable:hover .tabulator-col-sorter {
  color: #666;
}

/* Loading spinner (if data is loaded dynamically in the future) */
.backup-comparison-container .tabulator-loader {
  border-top-color: #0066cc;
}

/* Fallback table for no-JS users */
.backup-comparison-fallback {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.backup-comparison-fallback th,
.backup-comparison-fallback td {
  padding: 10px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.backup-comparison-fallback thead {
  background-color: #f8f9fa;
  font-weight: 600;
}

.backup-comparison-fallback tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.backup-comparison-fallback tbody tr:hover {
  background-color: #f9f9f9;
}
