/* ===== ROLE MANAGEMENT CREATIVE UI ===== */

/* User Card Styles */
.user-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e8e8f0;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.user-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8b7ff5 0%, #241443 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(139, 127, 245, 0.15);
  border-color: #d4d0e8;
}

.user-card:hover::before {
  opacity: 1;
}

/* Card Header with Email */
.user-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8f0;
}

.user-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b7ff5 0%, #241443 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-email {
  font-size: 14px;
  font-weight: 600;
  color: #241443;
  word-break: break-word;
  margin-bottom: 4px;
}

.user-card-email-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Role Badge */
.user-card-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  width: 100%;
  justify-content: space-between;
}

.role-badge-staff {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
}

.role-badge-admin {
  background: linear-gradient(135deg, #8b7ff5 0%, #6f68d1 100%);
  color: white;
}

.role-badge-super-admin {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
}

.role-icon {
  font-size: 14px;
}

/* Status and Date Info */
.user-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f5;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.meta-value {
  font-size: 13px;
  color: #333;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Action Buttons */
.user-card-actions {
  display: flex;
  gap: 8px;
}

.card-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-btn-edit {
  background: linear-gradient(135deg, #8b7ff5 0%, #6f68d1 100%);
  color: white;
}

.card-btn-edit:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 127, 245, 0.3);
}

.card-btn-delete {
  background: linear-gradient(135deg, #f0f0f5 0%, #e8e8f0 100%);
  color: #666;
  border: 1px solid #e0e0e8;
}

.card-btn-delete:hover {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
  border-color: transparent;
}

/* Empty State */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  border: 2px dashed #e8e8f0;
}

.empty-state-icon {
  font-size: 4rem;
  color: #e0e0e8;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: #241443;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: #999;
  margin-bottom: 24px;
  max-width: 300px;
}

/* Loading State */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.animated-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #e8e8f0;
  border-top-color: #8b7ff5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal Enhancements */
#roleEditModal .modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

#roleEditModal .modal-header {
  background: linear-gradient(135deg, #8b7ff5 0%, #241443 100%);
  border: none;
  padding: 24px;
}

#roleEditModal .modal-title {
  font-weight: 700;
  font-size: 18px;
}

#roleEditModal .modal-body {
  background: #f8f9fa;
}

#roleEditModal .form-control,
#roleEditModal .form-select {
  border-radius: 8px;
  border: 1px solid #e0d9f0;
  padding: 10px 14px;
  font-size: 14px;
}

#roleEditModal .form-control:focus,
#roleEditModal .form-select:focus {
  border-color: #8b7ff5;
  box-shadow: 0 0 0 3px rgba(139, 127, 245, 0.1);
}

#roleEditModal .alert {
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  color: #333;
  padding: 12px 16px;
}

#roleEditModal .alert i {
  margin-right: 8px;
  color: #8b7ff5;
}

#roleEditModal .btn-primary {
  background: linear-gradient(135deg, #8b7ff5 0%, #6f68d1 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#roleEditModal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 127, 245, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-card {
    padding: 16px;
  }

  .user-card-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .user-card-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-card-actions {
    flex-direction: column;
  }

  .card-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #allowedUsersGrid {
    grid-template-columns: 1fr !important;
  }

  .user-card {
    padding: 12px;
  }

  .user-card-header {
    gap: 8px;
    margin-bottom: 12px;
  }

  .user-card-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .user-card-email {
    font-size: 12px;
  }
}
