/**
 * REFINED_MOVEMENT - Popup/Modal Component
 * Reusable popup for newsletter, offers, and future trainin.nl integration
 * v1.0.0 - December 2025
 */

/* ========================================
   POPUP OVERLAY
   ======================================== */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 29, 35, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   POPUP CONTAINER
   ======================================== */

.popup-container {
  background-color: var(--bg-primary, #F5F3ED);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.popup-overlay.active .popup-container {
  transform: translateY(0) scale(1);
}

/* ========================================
   POPUP CLOSE BUTTON
   ======================================== */

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--color-charcoal, #1A1D23);
  transition: transform 0.2s ease, color 0.2s ease;
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.popup-close:hover {
  transform: rotate(90deg);
  color: var(--accent-primary, #B4975A);
}

.popup-close:focus {
  outline: 2px solid var(--accent-primary, #B4975A);
  outline-offset: 2px;
}

/* ========================================
   POPUP HEADER
   ======================================== */

.popup-header {
  padding: 48px 32px 24px;
  text-align: center;
}

.popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.popup-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-charcoal, #1A1D23);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  line-height: 1.2;
}

.popup-subtitle {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: var(--text-secondary, #6B6B6B);
  line-height: 1.5;
  margin: 0;
}

/* ========================================
   POPUP BODY
   ======================================== */

.popup-body {
  padding: 0 32px 32px;
}

/* Newsletter Form Style */
.popup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popup-form input[type="email"] {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
  border: 1px solid rgba(26, 29, 35, 0.2);
  background-color: #fff;
  color: var(--color-charcoal, #1A1D23);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
}

.popup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-primary, #B4975A);
  box-shadow: 0 0 0 3px rgba(180, 151, 90, 0.15);
}

.popup-form input[type="email"]::placeholder {
  color: rgba(26, 29, 35, 0.4);
}

.popup-form .btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  min-height: 52px;
}

.popup-disclaimer {
  font-size: 12px;
  color: var(--text-secondary, #6B6B6B);
  text-align: center;
  line-height: 1.5;
  margin-top: 8px;
}

/* ========================================
   POPUP FOOTER (Optional)
   ======================================== */

.popup-footer {
  padding: 20px 32px;
  background-color: rgba(26, 29, 35, 0.03);
  text-align: center;
}

.popup-footer-text {
  font-size: 13px;
  color: var(--text-secondary, #6B6B6B);
  margin: 0;
}

.popup-footer-link {
  color: var(--accent-primary, #B4975A);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.popup-footer-link:hover {
  color: var(--color-charcoal, #1A1D23);
}

/* ========================================
   POPUP VARIANTS
   ======================================== */

/* Dark variant */
.popup-container.popup-dark {
  background-color: var(--color-charcoal, #1A1D23);
}

.popup-dark .popup-title {
  color: #F5F3ED;
}

.popup-dark .popup-subtitle {
  color: rgba(245, 243, 237, 0.7);
}

.popup-dark .popup-close {
  color: #F5F3ED;
}

.popup-dark .popup-form input[type="email"] {
  background-color: rgba(245, 243, 237, 0.05);
  border-color: rgba(245, 243, 237, 0.2);
  color: #F5F3ED;
}

.popup-dark .popup-form input[type="email"]::placeholder {
  color: rgba(245, 243, 237, 0.4);
}

.popup-dark .popup-disclaimer {
  color: rgba(245, 243, 237, 0.6);
}

/* Success state */
.popup-success .popup-icon {
  color: #4CAF50;
}

.popup-success .popup-body {
  text-align: center;
  padding-top: 16px;
}

/* ========================================
   POPUP IMAGE VARIANT
   ======================================== */

.popup-with-image {
  max-width: 540px;
}

.popup-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.popup-with-image .popup-header {
  padding-top: 32px;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 599px) {
  .popup-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .popup-container {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }

  .popup-overlay.active .popup-container {
    transform: translateY(0);
  }

  .popup-header {
    padding: 40px 24px 20px;
  }

  .popup-title {
    font-size: 24px;
  }

  .popup-subtitle {
    font-size: 15px;
  }

  .popup-body {
    padding: 0 24px 28px;
  }

  .popup-close {
    top: 12px;
    right: 12px;
  }

  .popup-image {
    height: 140px;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes popupShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.popup-container.shake {
  animation: popupShake 0.4s ease;
}

/* Prevent body scroll when popup is open */
body.popup-open {
  overflow: hidden;
}
