/* ================================================
   Framio Motion — Custom Video Popup Player
   Cinematic YouTube Embed with Premium UI
   ================================================ */

/* ── Overlay ── */
.video-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Player Container ── */
.video-popup-container {
  position: relative;
  width: 90vw;
  max-width: 1100px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Video Wrapper (16:9) ── */
.video-popup-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.video-popup-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Project Info Bar ── */
.video-popup-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.2s;
}

.video-popup-overlay.active .video-popup-info {
  opacity: 1;
  transform: translateY(0);
}

.video-popup-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-popup-category {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(184, 201, 168, 0.7);
}

.video-popup-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  color: #F7F4EE;
}

.video-popup-location {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Close Button ── */
.video-popup-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.video-popup-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: rotate(90deg);
}

/* ── Play Button on Cards ── */
.video-play-btn-yt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.4s ease;
  z-index: 2;
}

.video-play-btn-yt:hover {
  background: rgba(0, 0, 0, 0.15);
}

.project-media-wrap:has(iframe) .video-play-btn-yt {
  opacity: 0.35;
}

.project-media-wrap:has(iframe):hover .video-play-btn-yt {
  opacity: 1;
}

.video-play-btn-yt .play-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(122, 140, 110, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.video-play-btn-yt:hover .play-circle {
  transform: scale(1.12);
  background: rgba(122, 140, 110, 1);
  box-shadow: 0 12px 40px rgba(122, 140, 110, 0.4);
}

.video-play-btn-yt .play-circle i {
  color: #fff;
  font-size: 20px;
  margin-left: 3px;
}

/* ── Loading State ── */
.video-popup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 5;
}

.video-popup-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(122, 140, 110, 0.2);
  border-top-color: #B8C9A8;
  border-radius: 50%;
  animation: vpSpin 0.8s linear infinite;
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .video-popup-container {
    width: 95vw;
  }

  .video-popup-close {
    top: -44px;
    right: 4px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .video-popup-title {
    font-size: 20px;
  }

  .video-popup-info {
    padding: 16px 4px;
  }

  .video-play-btn-yt .play-circle {
    width: 52px;
    height: 52px;
  }

  .video-play-btn-yt .play-circle i {
    font-size: 16px;
  }
}
