/* ../styles/customers.css */

/* General Page Enhancements */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-header h1 {
  margin: 0;
  font-size: 1.8em;
}

/* Card and Table */
.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
}
.card-header h2 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
}
.card-body {
  padding: 20px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}
.data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  text-transform: uppercase;
  color: #495057;
}
.data-table tbody tr:hover {
  background-color: #f1f3f5;
}

/* User/Customer Info */
.user-info-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
}
.user-avatar.large {
  width: 60px;
  height: 60px;
  font-size: 2em;
  margin-bottom: 10px;
}

/* Status Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: capitalize;
}
.status-badge.end-user {
  background-color: #d1e7dd;
  color: #0f5132;
}
.status-badge.dealer {
  background-color: #e2d9f3;
  color: #583c87;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}
.btn-icon {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  font-size: 1.1em;
}
.btn-icon:hover {
  color: #007bff;
}
.btn-icon.delete:hover {
  color: #dc3545;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 5px;
}
.pagination-btn {
  background-color: #fff;
  border: 1px solid #dee2e6;
  color: #007bff;
  padding: 8px 12px;
  cursor: pointer;
}
.pagination-btn:hover:not([disabled]) {
  background-color: #e9ecef;
}
.pagination-btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}
.pagination-btn:disabled {
  color: #6c757d;
  cursor: not-allowed;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
  width: 90%;
  max-width: 600px;
}
.modal-content.large {
  max-width: 800px;
}
@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-header {
  padding: 15px 20px;
  background-color: #007bff;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.3em;
}
.close-modal {
  color: white;
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
}
.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Form Styling */
.form-group {
  margin-bottom: 15px;
}
.form-group label,
label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.9em;
}
.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
}
.form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.form-row {
  display: flex;
  gap: 15px;
}
.form-row .form-group {
  flex: 1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

/* View Modal Details */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}
.user-profile-info h3 {
  margin: 0 0 5px 0;
  font-size: 1.4em;
}
.user-profile-info p {
  margin: 0 0 8px 0;
  color: #6c757d;
}
.user-profile-details .detail-item {
  display: flex;
  padding: 10px 5px;
  border-bottom: 1px solid #f1f3f5;
}
.user-profile-details .detail-item:last-child {
  border-bottom: none;
}
.user-profile-details .detail-label {
  font-weight: 600;
  color: #495057;
  width: 120px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dynamic Details Section */
.details-section {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}
.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.details-header h4 {
  margin: 0;
  font-size: 1.1em;
}
.details-section-title {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  font-size: 1.1em;
  color: #343a40;
}
.user-detail-group {
  position: relative;
  padding: 20px 15px 15px 15px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 15px;
}
.user-detail-group .form-group {
  margin-bottom: 10px;
}
.delete-detail-row {
  position: absolute;
  top: 5px;
  right: 5px;
  color: #adb5bd;
}
.delete-detail-row:hover {
  color: #dc3545;
}

/* =================================================================
   BUTTON STYLES (Add to dashboard.css)
   ================================================================= */

/* --- Base Button Style --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* Space between icon and text */
  padding: 10px 15px;
  font-size: 0.95em;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* --- Primary Button (Blue) --- */
.btn-primary {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:hover {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
}

.btn-primary:focus,
.btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

/* --- Secondary Button (Gray) --- */
.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  color: #fff;
  background-color: #5a6268;
  border-color: #545b62;
}

/* --- Danger Button (Red) --- */
.btn-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  color: #fff;
  background-color: #c82333;
  border-color: #bd2130;
}

/* --- Small Button Variant --- */
.btn-sm {
  padding: 5px 10px;
  font-size: 0.875em;
  border-radius: 0.2rem;
}

/* --- Disabled State --- */
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
