/* ==========================================================================
   Wasmer WordPress Web Stories Lightbox Modal (Google AMP Story Player)
   ========================================================================== */

/* Full-Screen Frosted Glass Backdrop Overlay */
.bp-story-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-sizing: border-box;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.bp-story-modal.is-active {
  display: flex !important;
  opacity: 1;
}

/* Close Button (Top-Right Circular Button) */
.bp-close-story-btn {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 100000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 28px;
  font-family: Arial, sans-serif;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 0;
  user-select: none;
}

.bp-close-story-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.08);
}

.bp-close-story-btn:active {
  transform: scale(0.95);
}

/* AMP Story Player Element Container */
#bpStoryPlayer {
  width: 100%;
  height: 100%;
  max-width: 410px;
  max-height: 730px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  background: #000000;
  display: block;
  position: relative;
}

/* Story Loading Spinner */
.bp-story-loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #ffffff;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bp-story-loading-indicator.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.bp-story-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #facc15;
  border-radius: 50%;
  animation: bpStorySpin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes bpStorySpin {
  to { transform: rotate(360deg); }
}

.bp-story-loading-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

/* Mobile Responsive Optimization (max-width: 600px) */
@media (max-width: 600px) {
  .bp-story-modal {
    padding: 0;
  }

  .bp-close-story-btn {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  #bpStoryPlayer {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}
