/* ================================================
   PRACTICE MEMBERS - MULTI-USER SYSTEM STYLING
   ================================================ */

/* ==================
   GEMEINSAME STYLES
   ================== */

.practice-members-container,
.pending-approvals-container,
.accept-invitation-container,
.upload-documents-container {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  transform: scale(0.95);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.badge-count {
  background-color: #ef4444;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ==================
   BUTTONS
   ================== */

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-small {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #38904E;
  color: white;
}

.btn-primary:hover {
  background-color: #38904E;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-success {
  background-color: #10b981;
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.btn-full-width {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================
   TABLES
   ================== */

.members-table-wrapper {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.members-table th:nth-child(1) { /* Name */
  width: 20%;
  min-width: 180px;
}

.members-table th:nth-child(2) { /* E-Mail */
  width: 25%;
  min-width: 220px;
}

.members-table th:nth-child(3) { /* Rolle */
  width: 15%;
}

.members-table th:nth-child(4) { /* Status */
  width: 15%;
}

.members-table th:nth-child(5) { /* Registriert am */
  width: 15%;
}

.members-table th:nth-child(6) { /* Aktionen */
  width: 15%;
  min-width: 200px;
}

.members-table thead {
  background-color: #f9fafb;
}

.members-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.members-table td {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  color: #1f2937;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.action-buttons button {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Email Cell Styles */
.email-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.email-text {
  font-family: monospace;
  font-size: 0.9rem;
  color: #1f2937;
  min-width: 150px;
}

.email-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
  border-radius: 0.25rem;
}

.email-toggle-btn:hover {
  color: #2E7A4E;
  background-color: #EAF7F3;
}

.email-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.members-table tbody tr:hover {
  background-color: #f9fafb;
}

.no-data {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-style: italic;
}

/* Status & Role Badges */
.status-badge,
.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.status-inactive {
  background-color: #e5e7eb;
  color: #374151;
}

.status-badge.status-deleted {
  background-color: #fee2e2;
  color: #991b1b;
}

.role-badge.role-admin {
  background-color: #DFF3EC;
  color: #2E7A4E;
}

.role-badge.role-practitioner {
  background-color: #e0e7ff;
  color: #4338ca;
}

.role-badge.role-mfa {
  background-color: #fce7f3;
  color: #9f1239;
}

/* ==================
   MODALS
   ================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding-top: 0 !important;
  z-index: 9999;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #1f2937;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* ==================
   FORMS
   ================== */

.invite-member-form,
.invitation-form,
.upload-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #38904E;
  box-shadow: 0 0 0 3px rgba(92, 184, 122, 0.1);
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  width: auto;
}

.checkbox-label span {
  font-size: 0.875rem;
  color: #374151;
}

.checkbox-label a {
  color: #2E7A4E;
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* ==================
   APPROVALS LIST
   ================== */

.approvals-list {
  display: grid;
  gap: 1.5rem;
}

.approval-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.approval-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.approval-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.approval-date {
  font-size: 0.875rem;
  color: #6b7280;
}

.approval-info {
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  margin-bottom: 0.5rem;
}

.info-row strong {
  min-width: 120px;
  color: #374151;
}

.info-row span {
  color: #1f2937;
}

.documents-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
}

.documents-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.documents-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-link {
  color: #2E7A4E;
  text-decoration: none;
  font-size: 0.875rem;
}

.document-link:hover {
  text-decoration: underline;
}

.document-missing {
  color: #6b7280;
  font-size: 0.875rem;
  font-style: italic;
}

.approval-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ==================
   INVITATION PAGE
   ================== */

.invitation-card,
.upload-card {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.invitation-header,
.upload-header {
  background: linear-gradient(135deg, #38904E 0%, #38904E 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.invitation-header h1,
.upload-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.invitation-header p,
.upload-header p {
  margin: 0;
  opacity: 0.9;
}

.invitation-footer,
.upload-footer {
  padding: 1.5rem;
  background-color: #f9fafb;
  text-align: center;
}

.help-text {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.help-text a {
  color: #2E7A4E;
  text-decoration: none;
}

.help-text a:hover {
  text-decoration: underline;
}

/* ==================
   INFO BOXES
   ================== */

.info-box {
  background-color: #EAF7F3;
  border-left: 4px solid #38904E;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.375rem;
}

.info-box h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #2E7A4E;
}

.info-box ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #2E7A4E;
}

.info-box li {
  margin-bottom: 0.5rem;
}

.error-box {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
}

.error-box h2 {
  color: #991b1b;
  margin-bottom: 1rem;
}

.error-box p {
  color: #7f1d1d;
  margin-bottom: 0.5rem;
}

.no-approvals,
.no-permission {
  background: white;
  border-radius: 0.5rem;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.no-approvals p,
.no-permission p {
  font-size: 1rem;
  color: #6b7280;
  margin: 0.5rem 0;
}

.no-permission h2 {
  color: #991b1b;
  margin-bottom: 1rem;
}

/* ==================
   FILE UPLOAD
   ================== */

.file-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #d1fae5;
  border-radius: 0.375rem;
  color: #065f46;
  font-size: 0.875rem;
}

input[type="file"] {
  border: 2px dashed #d1d5db !important;
  padding: 1rem !important;
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: #38904E !important;
}

/* ==================
   LOADING STATE
   ================== */

.loading {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  font-size: 1rem;
}

/* ==================
   SUCCESS MODAL
   ================== */

.success-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.success-modal {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  text-align: center;
  animation: slideUp 0.3s ease;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background-color: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
}

.success-modal h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  color: #1f2937;
}

.success-modal p {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================
   RESPONSIVE
   ================== */

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .approval-actions {
    flex-direction: column;
  }

  .approval-actions button {
    width: 100%;
  }

  .modal-content {
    width: 95%;
  }

  .members-table {
    font-size: 0.875rem;
  }

  .members-table th,
  .members-table td {
    padding: 0.5rem;
  }
}
