/* Toggle Switch Styles */
.toggle-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--toggle-btn);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Status Text Styles */
.status-text {
  font-size: 14px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 70px;
  text-align: center;
}

.status-active {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

.status-inactive {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

/* Mobile Card Adjustments */
.mobile-person-card-row .toggle-switch-container {
  justify-content: flex-start;
}

/* Table adjustments */
.table td,
.table th {
  vertical-align: middle;
}

/* Loading indicator */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Form field indicator */
.optional-field {
  font-size: 0.8rem;
  color: #6c757d;
  margin-left: 5px;
}

/* Success message for individual field updates */
.field-success {
  border: 1px solid #28a745 !important;
  background-color: rgba(40, 167, 69, 0.1) !important;
}

/* Hide columns based on data availability */
.hide-title {
  display: none;
}

.hide-description {
  display: none;
}

.hide-image {
  display: none;
}

/* Mobile card adjustments */
.hide-title-mobile {
  display: none;
}

.hide-description-mobile {
  display: none;
}

.hide-image-mobile {
  display: none;
}

/* Image preview styling */
.file-upload-preview {
  max-width: 100%;
  max-height: 200px;
  display: none;
  object-fit: contain;
}

.file-upload-preview.show {
  display: block;
}

.file-upload-content.hidden {
  display: none;
}

/* Form mode indicator */
.form-mode-indicator {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 10px;
}

.insert-mode {
  background-color: #d1ecf1;
  color: #0c5460;
}

.update-mode {
  background-color: #d4edda;
  color: #155724;
}

/* Clear button style */
.clear-field-btn {
  margin-left: 5px;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  cursor: pointer;
}

.clear-field-btn:hover {
  background-color: #e9ecef;
  color: #495057;
}

/* Clear image button style */
.clear-image-btn {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  cursor: pointer;
  display: inline-block;
}

.clear-image-btn:hover {
  background-color: #e9ecef;
  color: #495057;
}
