/* =========================
   astraxe Modal (Step 3: CSS)
   ========================= */

/* Body scroll lock (JS se toggle hoga) */
body.modal-open {
  overflow: hidden;
}

/* Base wrapper (hidden by default) */
.astraxe-modal {
  position: fixed;
  inset: 0;
  z-index: 1090; /* above headers/menus */
  display: grid;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  /* hidden state */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, visibility 200ms ease;
}

/* Show state (JS se class lagegi) */
.astraxe-modal.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Transparent dark overlay — use #0f0f0f with alpha */
.astraxe-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.6); /* #0f0f0f @ 60% */
  backdrop-filter: saturate(100%) blur(2px);
}

/* Modal container (white box, centered) */
.astraxe-modal__container {
  position: relative;
  z-index: 1;
  background: #ffffff;
  color: #0f0f0f;
  width: min(92vw, 860px);
  max-height: 88vh;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 15, 15, 0.25);
  overflow: hidden;

  /* Entry animation */
  transform: translateY(12px) scale(0.98);
  transition: transform 240ms ease, box-shadow 240ms ease, opacity 240ms ease;
  opacity: 0;
}

/* Visible state animation */
.astraxe-modal.is-visible .astraxe-modal__container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.astraxe-modal__header {
  padding: clamp(16px, 3vw, 28px) clamp(16px, 3vw, 28px) 0;
}


/* Body (scrolls independently) */
.astraxe-modal__body {
  padding: 16px clamp(16px, 3vw, 28px) clamp(20px, 3vw, 28px);
  max-height: calc(88vh - 96px); /* header + paddings approx */
  overflow: auto;
}

/* Close button (top-right) */
.astraxe-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #0f0f0f;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background 160ms ease, transform 120ms ease;
}

.astraxe-modal__close:hover {
  background: rgba(15, 15, 15, 0.06);
}

.astraxe-modal__close:active {
  transform: scale(0.98);
}

.astraxe-modal__close:focus-visible {
  outline: 2px solid #0f0f0f;
  outline-offset: 2px;
}

/* Form controls alignment (inherit your existing styles) */
.astraxe-modal .form-control {
  width: 100%;
  display: block;
}

/* Button alignment tweak inside modal form */
.astraxe-modal .astraxe-link-btn.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Small screens: edge-to-edge feel with safe gaps */
@media (max-width: 575.98px) {
  .astraxe-modal__container {
    width: 94vw;
    border-radius: 12px;
  }
  .astraxe-modal__close {
    top: 6px;
    right: 6px;
    font-size: 26px;
  }
}

/* Medium screens */
@media (min-width: 576px) and (max-width: 991.98px) {
  .astraxe-modal__container {
    width: min(92vw, 760px);
  }
}

/* Large screens */
@media (min-width: 992px) {
  .astraxe-modal__container {
    width: min(88vw, 820px);
  }
}

/* Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
  .astraxe-modal,
  .astraxe-modal__container {
    transition: none !important;
  }
}
