/**
 * Nyalife HMS - Z-index Management
 * This file defines standardized z-index values for the entire application
 * to prevent conflicts and ensure proper layering of elements.
 */

/* Base z-index values */
:root {
  /* Base layers (1-10) */
  --z-background: 1;
  --z-default: 5;
  --z-content: 10;
  
  /* UI components (11-100) */
  --z-card: 20;
  --z-dropdown: 1050;
  --z-sticky: 1020;
  --z-navbar: 1030;
  --z-sidebar: 60;
  --z-tooltip: 70;
  
  /* Overlays (101-900) */
  --z-overlay: 100;
  --z-modal-backdrop: 200;
  --z-modal: 300; --primary-color: #058b7c;
  /* Teal primary color */
  --primary-color-light: #06a594;
  --primary-color-dark: #03726a;
  --secondary-color: #d41559;
  /* Magenta secondary color */
  --secondary-color-light: #e01a63;
  --secondary-color-dark: #b01246;
  --z-popover: 400;
  --z-notification: 500;
  
  /* Highest priority (901+) */
  --z-loader: 1000;
  --z-alert: 1100;
  --z-debug: 9000;
}

/* Background elements */
.bg-element {
  z-index: var(--z-background);
}

/* Default content */
.content, 
.card, 
.btn, 
a, 
input, 
select, 
textarea {
  z-index: var(--z-content);
  position: relative;
}

/* UI components */
.card {
  z-index: var(--z-card);
}

.dropdown-menu {
  z-index: var(--z-dropdown);
}

.sticky-top,
.sticky-header {
  z-index: var(--z-sticky);
}

.navbar,
.header {
  z-index: var(--z-navbar) !important;
}

.sidebar {
  z-index: var(--z-sidebar);
}

.tooltip {
  z-index: var(--z-tooltip);
}

/* Overlays */
.overlay {
  z-index: var(--z-overlay);
}

.modal-backdrop {
  z-index: var(--z-modal-backdrop) !important;
}

.modal {
  z-index: var(--z-modal) !important;
}

.modal-dialog {
  z-index: calc(var(--z-modal) + 1) !important;
}

.modal-content {
  z-index: calc(var(--z-modal) + 2) !important;
}

.popover {
  z-index: var(--z-popover);
}

.notification,
#alertsContainer {
  z-index: var(--z-notification);
}

/* Highest priority */
.page-loader {
  z-index: var(--z-loader) !important;
}

.page-loader.hidden {
  z-index: -1 !important;
  pointer-events: none !important;
}

.alert-global {
  z-index: var(--z-alert);
}

/* Debug elements */
.debug-element {
  z-index: var(--z-debug);
}

/* Fix for buttons and links to ensure they're clickable */
.btn,
a,
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.nav-link,
.dropdown-item,
.clickable {
  position: relative;
  z-index: var(--z-content);
}

/* Fix for modals to ensure they're above other content */
.modal-open .modal {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Fix for the guest appointment modal */
#guestAppointmentModal.fade:not(.show) {
  display: none !important;
  visibility: hidden !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

/* Ensure modal backdrop is properly hidden when not in use */
.modal-backdrop.fade:not(.show) {
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
} 