/* ==========================================================================
   Modal Component
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: none;
}

.modal-backdrop[data-modal-open="true"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-backdrop[data-modal-open="true"] .modal {
  animation: bam-scale 0.2s ease-out forwards;
}

.modal {
  background-color: var(--color-canvas);
  border: var(--border-thick);
  box-shadow: var(--shadow-large);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal__header {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-primary);
  border-bottom: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal__header h2 {
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  color: var(--color-danger);
}

.modal__body {
  padding: var(--space-lg);
}
