/**
 * File: popup/assets/css/popup.css
 * Purpose: Styling for the popup overlay + card. Matches the site's dark theme
 *          (gold CTA) and works from 320px phones to desktop. Isolated from the
 *          site stylesheet so the module stays self-contained.
 * Module: Popup / Frontend
 */

.popup-no-scroll,
.popup-no-scroll body {
  overflow: hidden;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 8, 16, .68);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.popup-overlay.popup-show {
  opacity: 1;
  pointer-events: auto;
}

.popup-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #141b2d;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  color: #e9ecf5;
  font-family: 'Inter', system-ui, sans-serif;
  transform: translateY(14px) scale(.96);
  transition: transform .25s cubic-bezier(.2, .8, .25, 1);
}

.popup-overlay.popup-show .popup-card {
  transform: none;
}

.popup-overlay:not(.popup-show) .popup-card {
  transition: transform .18s ease;
}

/* Media (image popups) */
.popup-media {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 16 / 8;
  max-height: 44vh;
  overflow: hidden;
  background: #0b0f1a;
}

.popup-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-media--fallback {
  background:
    radial-gradient(120% 180% at 18% 0%, #2b2140 0%, #161a29 55%, #0b0f1a 100%);
}

.popup-media--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd54a'%3E%3Cpath d='M12 2l2.6 6.6L21 9.2l-5 4.7 1.3 6.6L12 17l-5.3 3.5 1.3-6.6-5-4.7 6.4-.6z'/%3E%3C/svg%3E")
    center / 68px 68px no-repeat;
  opacity: .55;
  animation: popup-pulse 2.4s ease-in-out infinite;
}

@keyframes popup-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Body */
.popup-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 24px;
}

.popup-title {
  margin: 0 0 10px;
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.popup-text {
  margin: 0;
  color: #bfc7d9;
  font-size: .95rem;
  line-height: 1.6;
  white-space: pre-line;
}

.popup-btn {
  display: block;
  margin-top: 18px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd54a 0%, #ff8f00 100%);
  color: #171203 !important;
  font-weight: 700;
  font-size: .98rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(255, 143, 0, .35);
  transition: transform .15s ease, filter .15s ease;
}

.popup-btn:hover,
.popup-btn:focus {
  color: #171203 !important;
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Close button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(7, 10, 18, .72);
  color: #e9ecf5;
  font-size: 1.3rem;
  line-height: .9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .15s ease, background .15s ease;
}

.popup-close:hover {
  transform: rotate(90deg);
  background: rgba(7, 10, 18, .92);
}

/* Small screens */
@media (max-width: 480px) {
  .popup-overlay {
    padding: 12px;
  }

  .popup-card {
    max-width: 100%;
    max-height: 86vh;
    border-radius: 16px;
  }

  .popup-media {
    aspect-ratio: 16 / 9;
  }

  .popup-title {
    font-size: 1.08rem;
  }

  .popup-body {
    padding: 16px 18px 20px;
  }

  .popup-btn {
    padding: 13px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .popup-overlay,
  .popup-card {
    transition: none;
  }

  .popup-media--fallback::after {
    animation: none;
  }
}