/* 
 * Material Design 3 Override for Legacy Bootstrap Conflicts
 * This file ensures Angular Material components take precedence over Bootstrap styles
 */

/* Global fallback styles to replace basic Bootstrap utility classes */
.w-100 {
  width: 100% !important;
}

.text-center {
  text-align: center !important;
}

.flex-row {
  display: flex !important;
  flex-direction: row !important;
}

.flex-column {
  display: flex !important;
  flex-direction: column !important;
}

.justify-center {
  justify-content: center !important;
}

.align-center {
  align-items: center !important;
}

/* Basic layout utilities */
.d-flex {
  display: flex !important;
}

.d-block {
  display: block !important;
}

.d-inline-block {
  display: inline-block !important;
}

/* Basic spacing utilities */
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }

/* Prevent Bootstrap from interfering with Material buttons */
.mat-mdc-button,
.mat-mdc-raised-button,
.mat-mdc-outlined-button,
.mat-mdc-fab,
.mat-mdc-mini-fab {
  font-family: var(--mat-sys-typescale-label-large-font-family-name, var(--mat-sys-typescale-label-large-font-family-style, var(--mat-sys-ref-typeface-plain))) !important;
  font-size: var(--mat-sys-typescale-label-large-font-size) !important;
  line-height: var(--mat-sys-typescale-label-large-line-height) !important;
  box-sizing: border-box !important;
}

/* Prevent Bootstrap form styles from affecting Material form fields */
.mat-mdc-form-field input,
.mat-mdc-form-field textarea,
.mat-mdc-form-field select {
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Ensure Material table styles override Bootstrap */
.mat-mdc-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.mat-mdc-table .mat-mdc-header-cell,
.mat-mdc-table .mat-mdc-cell {
  border-bottom: 1px solid var(--mat-sys-color-outline-variant) !important;
  padding: 6px 12px !important;
}

/* Prevent Bootstrap typography from affecting Material typography */
.mat-h1, .mat-h2, .mat-h3, .mat-h4, .mat-h5, .mat-h6,
.mat-headline-1, .mat-headline-2, .mat-headline-3, .mat-headline-4, .mat-headline-5, .mat-headline-6,
.mat-title, .mat-subheading-1, .mat-subheading-2, .mat-body-1, .mat-body-2, .mat-caption {
  margin: 0 !important;
  padding: 0 !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}

/* Ensure Material icons display correctly */
.material-icons {
  font-family: 'Material Icons' !important;
  font-weight: normal !important;
  font-style: normal !important;
  display: inline-block !important;
  line-height: 1 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  word-wrap: normal !important;
  white-space: nowrap !important;
  direction: ltr !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility !important;
}

/* Prevent Bootstrap grid from affecting Material layouts */
.mat-mdc-dialog-container,
.mat-mdc-snack-bar-container,
.mat-mdc-menu-panel {
  box-sizing: border-box !important;
}

/* Ensure proper z-index layering for Material components */
.mat-mdc-dialog-container { z-index: 1000 !important; }
.mat-mdc-snack-bar-container { z-index: 1001 !important; }
.mat-mdc-menu-panel { z-index: 1002 !important; }
.mat-mdc-tooltip { z-index: 1003 !important; }

/* Prevent Bootstrap responsive utilities from affecting Material components */
.mat-mdc-form-field,
.mat-mdc-button,
.mat-mdc-card {
  display: block !important;
}

.mat-mdc-button {
  display: inline-flex !important;
}

/* Bootstrap legacy scope placeholder - implement when needed */
.bootstrap-legacy {
  /* Future: Scope Bootstrap styles to prevent global conflicts */
  isolation: isolate;
}