/**
 * ElevenLabs Stelos Widget — Modal Overlay Styles
 *
 * z-index: 1000 (below the ElevenLabs widget which renders above).
 */

/* ── Overlay ───────────────────────────────────────────────── */
.elsw-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.elsw-modal--open {
  opacity: 1;
  visibility: visible;
}

/* ── Box ───────────────────────────────────────────────────── */
.elsw-modal__box {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────── */
.elsw-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #2f2f2f;
  background: #1f1f1f;
  flex-shrink: 0;
}

.elsw-modal__title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 48px);
}

.elsw-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 22px;
  color: #777;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.elsw-modal__close:hover {
  background: #2d2d2d;
  color: #f2f2f2;
}

/* ── Content area ──────────────────────────────────────────── */
.elsw-modal__content {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Image ─────────────────────────────────────────────────── */
.elsw-modal__image {
  max-width: 100%;
  max-height: 75vh;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

/* ── PDF ───────────────────────────────────────────────────── */
.elsw-modal--pdf .elsw-modal__content {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: #1f1f1f;
}

.elsw-modal__pdf {
  display: block;
  width: 100%;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  border: none;
  border-radius: 0;
  background: #2a2a2a;
}

/* ── Video ─────────────────────────────────────────────────── */
.elsw-modal__video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 6px;
}

.elsw-modal__video {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 6px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .elsw-modal__header {
    min-height: 52px;
    padding: 0 14px;
  }

  .elsw-modal__content {
    padding: 12px;
  }

  .elsw-modal--pdf .elsw-modal__pdf {
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
  }
}

/* ── Dark mode ─────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .elsw-modal {
    background: rgba(0, 0, 0, 0.75);
  }

  .elsw-modal__box {
    background: #1e1e1e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }

  .elsw-modal__header {
    border-bottom-color: #333;
  }
}
