/* Table Component Enhancements - Minimal overrides */

/* Enhanced table styling */
.table thead.table-primary th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.table-responsive {
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow-sm);
}

.table td {
  vertical-align: middle;
}

/* DataTables Bootstrap 5 integration improvements */
.dataTables_wrapper {
  font-family: inherit;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5rem;
}

/* Pagination styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.375rem 0.75rem;
  margin-left: 0.125rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  color: var(--bs-link-color);
  text-decoration: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-link-hover-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white;
}

/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  color: var(--bs-body-color);
  font-size: 1rem;
  padding: 1rem;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_processing {
  background: rgba(33, 37, 41, 0.9);
  color: var(--bs-body-color);
}

/* Table loading state */
.table-loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.table-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

[data-bs-theme="dark"] .table-loading::after {
  background: rgba(33, 37, 41, 0.8);
}

/* Compact table variant */
.table-compact {
  font-size: 0.875rem;
}

.table-compact th,
.table-compact td {
  padding: 0.5rem;
}

/* Mobile responsive improvements */
@media (max-width: 767.98px) {
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }
  
  .table .btn {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }
}

/* Smart devices table specific styling */
#smartDevicesTable th.actions-col { 
  width: 420px; 
}

#smartDevicesTable td.actions-cell { 
  width: 420px; 
  white-space: nowrap; 
}

#smartDevicesTable td.actions-cell .actions-wrap {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
}

#smartDevicesTable td.actions-cell .btn { 
  white-space: nowrap; 
}

@media (max-width: 1199.98px) {
  #smartDevicesTable th.actions-col,
  #smartDevicesTable td.actions-cell { 
    width: 360px; 
  }
}

@media (max-width: 991.98px) {
  #smartDevicesTable th.actions-col,
  #smartDevicesTable td.actions-cell { 
    width: 320px; 
  }
}

/* Filter table styling */
#filters,
#auditfilter {
  margin-bottom: 1rem;
}

#filters th,
#auditfilter th {
  border: none;
  background: transparent;
  padding: 0.5rem 0;
}

#filters td,
#auditfilter td {
  border: none;
  padding: 0.25rem 0.5rem 0.25rem 0;
}