/**
 * Modern Table Styles for Bootstrap 5.3+
 * Enhanced table design with modern aesthetics
 */

/* Modern Table Container */
.table-responsive {
  /* border-radius: 1rem; */
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

/* Modern Table Base Styles */
.table {
  margin-bottom: 0;
  background: #ffffff;
  /* border-collapse: separate; */
  border-spacing: 0;
}

.card-table {
  border: none;
}

/* Modern Table Header */
.card-header {
  background: linear-gradient(135deg, #003a75 0%, #004d94 100%) !important;
  border: none !important;
  /* border-radius: 1rem 1rem 0 0 !important; */
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 58, 117, 0.2);
}

.card-header .card-title {
  color: #ffffff !important;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header .card-options {
  display: flex;
  gap: 0.75rem;
}

/* Modern Table Head */
.table thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table thead th {
  border-bottom: 2px solid #dee2e6;
  color: #343a40;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.8px;
  padding: 1rem 1.25rem;
  white-space: nowrap;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.table thead th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #467fcf 0%, #5d92e0 100%);
}

/* Modern Table Body */
.table tbody {
  background: #ffffff;
}

.table tbody tr {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table tbody tr:hover {
  background: linear-gradient(135deg, rgba(70, 127, 207, 0.03) 0%, rgba(93, 146, 224, 0.03) 100%);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  color: #495057;
  font-size: 0.9375rem;
  border-top: none;
}

/* Striped Rows */
.table-striped tbody tr:nth-of-type(odd) {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.01) 0%, rgba(0, 0, 0, 0.02) 100%);
}

.table-striped tbody tr:nth-of-type(odd):hover {
  background: linear-gradient(135deg, rgba(70, 127, 207, 0.05) 0%, rgba(93, 146, 224, 0.05) 100%);
}

/* Modern Table Bordered */
.table-bordered {
  border: none;
}

.table-bordered thead th,
.table-bordered thead td {
  border-bottom-width: 2px;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Modern Status Badges in Tables */
.table .badge {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table .badge-success,
.table .bg-success {
  background: linear-gradient(135deg, #5eba00 0%, #7bd235 100%) !important;
  color: #ffffff;
}

.table .badge-danger,
.table .bg-danger {
  background: linear-gradient(135deg, #cd201f 0%, #f66d9b 100%) !important;
  color: #ffffff;
}

.table .badge-warning,
.table .bg-warning {
  background: linear-gradient(135deg, #f1c40f 0%, #fd9644 100%) !important;
  color: #ffffff;
}

.table .badge-info,
.table .bg-info {
  background: linear-gradient(135deg, #45aaf2 0%, #2bcbba 100%) !important;
  color: #ffffff;
}

.table .badge-primary,
.table .bg-primary {
  background: linear-gradient(135deg, #467fcf 0%, #5d92e0 100%) !important;
  color: #ffffff;
}

.table .badge-secondary,
.table .bg-secondary {
  background: linear-gradient(135deg, #868e96 0%, #6c757d 100%) !important;
  color: #ffffff;
}

/* Modern Action Buttons in Tables */
.table .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.table .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.table .btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* Modern Dropdown in Table Header */
.card-header .dropdown .btn {
  background: linear-gradient(135deg, #06324e 0%, #084a6e 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header .dropdown .btn:hover {
  background: linear-gradient(135deg, #084a6e 0%, #0a5f8c 100%);
  border-color: #04a9f4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(4, 169, 244, 0.3);
}

.card-header .dropdown .btn i {
  margin-right: 0.5rem;
}

/* Modern Dropdown Menu */
.card-header .dropdown-menu {
  background: linear-gradient(135deg, #3991d5 0%, #21a3ff 100%);
  border: 1px solid #04a9f4;
  border-radius: 0.75rem;
  padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-header .dropdown-item {
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.25rem 0;
}

.card-header .dropdown-item:hover {
  background: linear-gradient(135deg, rgba(4, 169, 244, 0.2) 0%, rgba(43, 203, 186, 0.2) 100%);
  color: #04a9f4;
  transform: translateX(4px);
}

.card-header .dropdown-item i {
  margin-right: 0.5rem;
  font-size: 0.9375rem;
}

/* Empty State */
.table tbody tr.empty-state td {
  padding: 3rem;
  text-align: center;
  color: #6c757d;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Loading State */
.table tbody tr.loading-state td {
  padding: 2rem;
  text-align: center;
}

.table .spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 0.25rem;
}

/* Pagination with Tables */
.pagination {
  margin-top: 1.5rem;
  gap: 0.5rem;
}

.page-link {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  color: #495057;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-link:hover {
  background: linear-gradient(135deg, #467fcf 0%, #5d92e0 100%);
  border-color: #467fcf;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(70, 127, 207, 0.3);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, #467fcf 0%, #5d92e0 100%);
  border-color: #467fcf;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(70, 127, 207, 0.3);
}

/* Responsive Table Adjustments - Maintained in responsive-fixes.css */
/* Tables now use horizontal scroll on all screen sizes instead of card layout */

/* Print Styles */
@media print {
  .table {
    border: 1px solid #dee2e6;
  }
  
  .table thead {
    background: #f8f9fa !important;
  }
  
  .table thead th {
    border: 1px solid #dee2e6 !important;
    color: #000 !important;
  }
  
  .table tbody tr {
    page-break-inside: avoid;
  }
  
  .table tbody td {
    border: 1px solid #dee2e6;
  }
}
