/* Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background-color: rgba(50, 50, 90, 0.5);
  display: none;
  z-index: 1000;
}

/* Popup Box */
.popup-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, #6A79E8, #3f4bc2);
  width: 420px;
  padding: 70px;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4),
              inset 0 0 25px #2a2f6966;
  text-align: center;
  display: none;
  z-index: 1001;
  opacity: 0;
  transition: all 0.3s ease;
  color: #fff;
  font-family: "Segoe UI", sans-serif;
}

.popup-box h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #fff;
}

.popup-box p {
  font-size: 1rem;
  color: #dcdcff;
  margin-bottom: 20px;
}

.popup-btn {
  background: linear-gradient(45deg, #3f4bc2, #6A79E8);
  color: #fff;
  border: none;
  padding: 12px 50px;
  letter-spacing: 1.3px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 5px 20px rgba(60, 60, 120, 0.5);
  transition: all 0.3s ease;
  margin: 10px 0;
}

.popup-btn:hover {
  background: linear-gradient(45deg, #6A79E8, #3f4bc2);
  transform: translateY(-2px);
}

/* Close Button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

.popup-close:hover {
  background: transparent !important;
}

/* Show popup */
.popup-overlay.active {
  display: block;
}

.popup-box.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Make popup box larger */
.popup-box.large {
  width: 90%;
  max-width: 700px;
  padding: 50px 40px;
}

/* Video wrapper and frame */
.popup-video-wrapper {
  width: 100%;
  margin-bottom: 30px;
  /* display: none; */
  display: flex;
  justify-content: center;
}

.popup-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(110, 120, 230, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
  transition: transform 0.3s ease;
}

.popup-video-frame:hover {
  transform: scale(1.015);
}

.popup-video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Glowing border animation */
@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(110, 120, 230, 0.4),
                0 0 40px rgba(63, 75, 194, 0.4);
  }
  to {
    box-shadow: 0 0 30px rgba(110, 120, 230, 0.6),
                0 0 60px rgba(63, 75, 194, 0.6);
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .popup-box.large {
    width: 95%;
    padding: 40px 30px;
  }
}

@media (max-width: 480px) {
  .popup-box.large {
    padding: 30px 20px;
  }
}

/* Tablets and small laptops (768px and below) */
@media (max-width: 768px) {
  .popup-box {
    width: 80%;
    padding: 50px 40px;
  }

  .popup-box h2 {
    font-size: 1.4rem;
  }

  .popup-box p {
    font-size: 0.9rem;
  }

  .popup-btn {
    padding: 10px 40px;
    font-size: 0.9rem;
  }
}

/* Large phones (576px and below) */
@media (max-width: 576px) {
  .popup-box {
    width: 90%;
    padding: 40px 30px;
    border-radius: 12px;
  }

  .popup-box h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .popup-box p {
    font-size: 0.85rem;
    margin-bottom: 15px;
  }

  .popup-btn {
    padding: 8px 30px;
    font-size: 0.85rem;
  }

  .popup-close {
    font-size: 20px;
    top: 8px;
    right: 12px;
  }
}

/* Small phones (400px and below) */
@media (max-width: 400px) {
  .popup-box {
    padding: 30px 20px;
    border-radius: 10px;
  }

  .popup-box h2 {
    font-size: 1.1rem;
  }

  .popup-box p {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .popup-btn {
    padding: 8px 25px;
    letter-spacing: 1px;
  }

  .popup-overlay {
    backdrop-filter: blur(5px);
  }
}

/* Very small phones (orientation changes) */
@media (max-width: 350px) and (orientation: portrait) {
  .popup-box {
    width: 95%;
    padding: 25px 15px;
  }

  .popup-btn {
    width: 100%;
    padding: 8px 0;
  }
}
