/* User Management Table Styles */
.users-table-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #6c757d;
}

/* View Selector Styles */
.view-selector {
  margin-bottom: 20px;
}

.view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e9ecef;
}

.admin-page .view-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  color: #2f2d2d;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.admin-page .view-tab:hover {
  color: #fff;
  background-color: rgba(47, 45, 45, 0.8);
}

.admin-page .view-tab.active {
  color: #fff;
  background-color: #2f2d2d;
  border-bottom-color: #2f2d2d;
  font-weight: 600;
}

/* Status and Event Badges */
.status-badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-badge.expired {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f1aeb5;
}

.event-badge {
  display: inline-block;
  padding: 2px 6px;
  margin: 1px;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
}

.event-badge.login_rate_limit {
  background-color: #d1ecf1;
  color: #0c5460;
}

.event-badge.registration_rate_limit {
  background-color: #f8d7da;
  color: #721c24;
}

.event-badge.password_reset_rate_limit {
  background-color: #fff3cd;
  color: #856404;
}

.violation-count {
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 3px;
}

.violation-count.low {
  background-color: #d4edda;
  color: #155724;
}

.violation-count.medium {
  background-color: #fff3cd;
  color: #856404;
}

.violation-count.high {
  background-color: #f8d7da;
  color: #721c24;
}

.ip-address {
  font-family: monospace;
  font-weight: bold;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.table-header h3 {
  margin: 0;
  color: #343a40;
  font-size: 1.3em;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-weight: 600;
}

.table-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.search-input, .filter-select {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 0.9em;
}

.search-input {
  width: 200px;
}

.filter-select {
  min-width: 120px;
}

.users-table-container {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

/* Keep user tables white even if global styles override table backgrounds */
.users-table,
.users-table .admin-table {
  background-color: #fff;
}

.users-table .admin-table th {
  background-color: #f8f9fa;
}

.users-table .admin-table td {
  background-color: #fff;
}

.users-table .admin-table tr:hover td {
  background-color: #f8f9fa;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.admin-table th {
  background: #f8f9fa;
  padding: 15px 12px;
  text-align: left;
  font-weight: 600;
  color: #343a40;
  border-bottom: 2px solid #e9ecef;
  font-size: 0.9em;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.9em;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #f8f9fa;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table .user-email {
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table .user-type {
  padding: 12px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.type-badge, .subscription-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 500;
  text-transform: uppercase;
}

.type-badge.admin {
  background: #dc3545;
  color: white;
}

.type-badge.teacher {
  background: #ffc107;
  color: #212529;
}

.type-badge.individual {
  background: #6c757d;
  color: white;
}

.subscription-badge.premium {
  background: #28a745;
  color: white;
}

.subscription-badge.teacher {
  background: #6f42c1;
  color: white;
}

.subscription-badge.free {
  background: #e9ecef;
  color: #495057;
}

.signin-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 500;
  text-transform: uppercase;
}

.signin-badge.Google {
  background: #4285f4;
  color: white;
}

.signin-badge.Email {
  background: #17a2b8;
  color: white;
}

.signin-badge.Unknown {
  background: #ffc107;
  color: #212529;
}

.user-projects {
  white-space: nowrap;
}

.project-count, .member-count {
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e9ecef;
  color: #495057;
}

.member-count {
  background: #d1ecf1;
  color: #0c5460;
}

.user-actions {
  display: flex;
  gap: 5px;
}

.admin-page .action-btn {
  padding: 5px 10px;
  border: 1px solid #2f2d2d !important;
  border-radius: 3px;
  background-color: #fff !important;
  color: #2f2d2d !important;
  cursor: pointer;
  font-size: 0.8em;
  font-family: 'Crimson Text', 'Georgia', serif;
  transition: all 0.2s ease;
  width: 70px;
  text-align: center;
}

.admin-page .action-btn.view {
  border-color: #2f2d2d !important;
  color: #2f2d2d !important;
  background-color: #fff !important;
}

.admin-page .action-btn.view:hover {
  background: #fff !important;
  border-color: #2f2d2d !important;
  color: #2f2d2d !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

.admin-page .action-btn.view:focus,
.admin-page .action-btn.view:active {
  background-color: #fff !important;
  color: #2f2d2d !important;
  border-color: #2f2d2d !important;
  box-shadow: none !important;
}

.admin-page .action-btn.edit {
  border-color: #ffc107 !important;
  color: #856404 !important;
  background-color: #fff !important;
}

.admin-page .action-btn.edit:hover {
  background: white !important;
  border-color: #ffc107 !important;
  color: #856404 !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

.admin-page .action-btn.delete {
  border-color: #dc3545 !important;
  color: #dc3545 !important;
  background-color: #fff !important;
}

.admin-page .action-btn.delete:hover {
  background: white !important;
  border-color: #dc3545 !important;
  color: #dc3545 !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

.admin-page .action-btn.ban {
  border-color: #dc3545 !important;
  color: #dc3545 !important;
  background-color: #fff !important;
}

.admin-page .action-btn.ban:hover {
  background: white !important;
  border-color: #dc3545 !important;
  color: #dc3545 !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

.admin-page .action-btn.ban:focus,
.admin-page .action-btn.ban:active {
  background-color: #fff !important;
  color: #dc3545 !important;
  border-color: #dc3545 !important;
  box-shadow: none !important;
}

.admin-page .action-btn.unban {
  border-color: #28a745 !important;
  color: #28a745 !important;
  background-color: #fff !important;
}

.admin-page .action-btn.unban:hover {
  background: white !important;
  border-color: #28a745 !important;
  color: #28a745 !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

.admin-page .action-btn.unban:focus,
.admin-page .action-btn.unban:active {
  background-color: #fff !important;
  color: #28a745 !important;
  border-color: #28a745 !important;
  box-shadow: none !important;
}

.admin-page .action-btn.warning {
  border-color: #2f2d2d !important;
  color: #2f2d2d !important;
  background-color: #fff !important;
}

.admin-page .action-btn.warning:hover {
  background: white !important;
  border-color: #2f2d2d !important;
  color: #2f2d2d !important;
  box-shadow: none !important;
  opacity: 0.8;
  transform: scale(1.1);
}

/* Pagination Styles */
.table-pagination {
  margin-top: 20px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.pagination-info {
  color: #6c757d;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 0.9em;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: white;
  color: #495057;
  cursor: pointer;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 0.9em;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.pagination-btn:hover:not(:disabled) {
  box-shadow: none !important;
  opacity: 0.8;
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: #2f2d2d;
  color: white;
  border-color: #2f2d2d;
}

.page-numbers {
  display: flex;
  gap: 5px;
}

.page-number {
  min-width: 40px;
  text-align: center;
}

/* Empty/Loading States */
.users-table.loading, .users-table.empty {
  padding: 40px;
  text-align: center;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 0;
}

.empty-message, .loading-message {
  color: #6c757d;
  font-family: 'Crimson Text', 'Georgia', serif;
}
