/* Enhanced Out-of-Class Tab UI/UX Improvements */

/* Clean up the out-of-class tab layout */
#outofclass-tab {
  max-width: 100%;
  overflow-x: hidden;
  padding: 1rem 0;
}

/* Improved section spacing and visual hierarchy */
#outofclass-tab .section-container {
  margin-bottom: 2.5rem;
  padding: 0 1rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

#outofclass-tab .section-header {
  margin-bottom: 2rem;
  text-align: center;
}

#outofclass-tab .section-title {
  font-size: 2rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

#outofclass-tab .section-description {
  color: #6b7280;
  font-size: 1.1rem;
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Enhanced search and filter functionality */
#outofclass-tab .controls-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 10px;
  z-index: 5;
}

#outofclass-tab .controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

#outofclass-tab .control-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

#outofclass-tab .modern-input,
#outofclass-tab .modern-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: white;
}

#outofclass-tab .modern-input:focus,
#outofclass-tab .modern-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

/* Live search feedback */
#outofclass-tab .modern-input[type="text"] {
  position: relative;
}

#outofclass-tab .modern-input[type="text"]::placeholder {
  color: #9ca3af;
  transition: all 0.2s ease;
}

#outofclass-tab .modern-input[type="text"]:focus::placeholder {
  opacity: 0.7;
  transform: translateY(-2px);
}

/* Enhanced button styling with better interaction feedback */
#outofclass-tab .modern-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

#outofclass-tab .modern-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#outofclass-tab .modern-btn:hover::before {
  left: 100%;
}

#outofclass-tab .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

#outofclass-tab .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

#outofclass-tab .btn-secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

#outofclass-tab .btn-secondary:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(107, 114, 128, 0.3);
}

/* Quick stats summary cards */
#outofclass-tab .quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

#outofclass-tab .quick-stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

#outofclass-tab .quick-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#outofclass-tab .quick-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

#outofclass-tab .quick-stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Enhanced data card styling with better visual hierarchy */
#outofclass-tab .data-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

#outofclass-tab .data-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

#outofclass-tab .data-card-header {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#outofclass-tab .data-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#outofclass-tab .data-card-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  animation: badge-pulse 3s infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Enhanced table styling with better data visualization */
#outofclass-tab .table-container {
  overflow-x: auto;
  background: white;
  border-radius: 0 0 12px 12px;
  max-height: 70vh;
  overflow-y: auto;
}

#outofclass-tab .outofclass-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.875rem;
}

#outofclass-tab .outofclass-table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e5e7eb;
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

#outofclass-tab .outofclass-table td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
  vertical-align: middle;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#outofclass-tab .outofclass-table tbody tr {
  transition: all 0.15s ease;
}

#outofclass-tab .outofclass-table tbody tr:hover {
  background-color: #f8fafc;
  transform: scale(1.01);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#outofclass-tab .outofclass-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

#outofclass-tab .outofclass-table tbody tr:nth-child(even):hover {
  background-color: #f1f5f9;
}

/* Enhanced pagination and filtering feedback */
#outofclass-tab .table-footer {
  background: #f9fafb;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #6b7280;
}

#outofclass-tab .filter-results {
  font-weight: 500;
}

#outofclass-tab .filter-results .highlight {
  color: #059669;
  font-weight: 600;
}

/* Enhanced bulk actions bar */
#outofclass-tab .bulk-actions-bar {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

#outofclass-tab .bulk-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #92400e;
}

#outofclass-tab .bulk-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Enhanced frequent flyers section */
#outofclass-tab .alert-card {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

#outofclass-tab .alert-header {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-bottom-color: #fecaca;
}

#outofclass-tab .alert-title {
  color: #991b1b;
}

#outofclass-tab .alert-icon {
  color: #ef4444;
  animation: pulse-alert 2s infinite;
}

@keyframes pulse-alert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#outofclass-tab .alert-badge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Enhanced stats grid */
#outofclass-tab .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#outofclass-tab .stat-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#outofclass-tab .stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--stat-color, #3b82f6);
}

#outofclass-tab .alert-stat::before { --stat-color: #ef4444; }
#outofclass-tab .warning-stat::before { --stat-color: #f59e0b; }
#outofclass-tab .info-stat::before { --stat-color: #3b82f6; }
#outofclass-tab .success-stat::before { --stat-color: #10b981; }

#outofclass-tab .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

#outofclass-tab .stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

#outofclass-tab .stat-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  opacity: 0.3;
}

/* Responsive improvements */
@media (max-width: 768px) {
  #outofclass-tab .controls-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #outofclass-tab .section-title {
    font-size: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #outofclass-tab .bulk-actions-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  #outofclass-tab .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  #outofclass-tab .stat-value {
    font-size: 2rem;
  }
}

/* Enhanced loading states */
#outofclass-tab .loading-indicator {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

#outofclass-tab .modern-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#outofclass-tab .loading-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#outofclass-tab .loading-subtext {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Enhanced empty states */
#outofclass-tab .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

#outofclass-tab .empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

#outofclass-tab .empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

#outofclass-tab .empty-state-desc {
  font-size: 1rem;
  opacity: 0.8;
}

/* Enhanced email button styling */
#outofclass-tab .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

#outofclass-tab .btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

#outofclass-tab .btn-success:active {
  transform: translateY(0);
}

/* Improved action buttons container */
#outofclass-tab .action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  min-width: 100px;
}

#outofclass-tab .action-buttons .btn {
  min-width: 36px;
  height: 36px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.875rem;
}

/* Enhanced frequent flyers table styling */
#frequentFlyersTable .action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

#frequentFlyersTable .action-buttons .btn {
  min-width: 36px;
  height: 32px;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

#frequentFlyersTable .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
}

#frequentFlyersTable .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

#frequentFlyersTable .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

#frequentFlyersTable .btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Enhanced frequent flyers table row styling */
#frequentFlyersTable tbody tr {
  transition: all 0.2s ease;
}

#frequentFlyersTable tbody tr:hover {
  background-color: #f8fafc;
  transform: translateX(2px);
}

#frequentFlyersTable td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

#frequentFlyersTable td:first-child {
  font-weight: 600;
  color: #1f2937;
}

/* Enhanced total logs badge styling */
#frequentFlyersTable .total-logs-badge {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
  animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Better visual feedback for interactive elements */
#outofclass-tab .sortable {
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
}

#outofclass-tab .sortable:hover {
  background-color: #f1f5f9;
}

#outofclass-tab .sort-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Enhanced accessibility */
#outofclass-tab .modern-input:focus,
#outofclass-tab .modern-select:focus,
#outofclass-tab .modern-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Better table cell content alignment */
#outofclass-tab .outofclass-table td {
  line-height: 1.4;
}

#outofclass-tab .outofclass-table .badge {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Improved count badge styling with proper pulse animation */
#outofclass-tab .outofclass-count-red,
#outofclass-tab .outofclass-count-bold-red,
#outofclass-tab .outofclass-count-critical,
#outofclass-tab .outofclass-count-severe {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: scale(1);
  }
}
