/* ========================================
   CDN VIDEO GALLERY WITH FANCYBOX
   SULAX PROJECT - UPDATED
   ======================================== */

/* ========================================
   VIDEO CARD STYLES
   ======================================== */

.tp-portfolio-inner-thumb a {
  position: relative;
  display: block;
  overflow: hidden;
}

/* Play Overlay */
.tp-portfolio-inner-thumb a .cdn-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(200, 11, 15, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.tp-portfolio-inner-thumb a:hover .cdn-play-overlay {
  opacity: 1;
}

.tp-portfolio-inner-thumb a .cdn-play-overlay i {
  color: #fff;
  font-size: 28px;
  margin-left: 4px;
}

/* Thumbnail hover zoom */
.tp-portfolio-inner-thumb a img {
  transition: transform 0.3s ease;
}

.tp-portfolio-inner-thumb a:hover img {
  transform: scale(1.05);
}

/* ========================================
   FANCYBOX MODAL STYLES
   ======================================== */

.fancybox__content {
  width: 1200px !important;
  height: 675px !important;
  max-width: 1200px !important;
  max-height: 675px !important;
  padding: 0 !important;
  background: #000 !important;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* HTML5 Video */
.fancybox__content video {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
  background: #000;
}

/* Backdrop */
.fancybox__backdrop {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(4px);
}

/* Toolbar */
.fancybox__toolbar {
  background: rgba(0, 0, 0, 0.3) !important;
  padding: 10px 20px;
}

/* Close Button */
.fancybox__button--close {
  color: #fff !important;
  background: rgba(200, 11, 15, 0.8) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.fancybox__button--close:hover {
  background: rgba(200, 11, 15, 1) !important;
  transform: scale(1.1);
}

/* Infobar */
.fancybox__infobar {
  color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 991px) {
  .fancybox__content {
    width: 90vw !important;
    height: 50.625vw !important;
    max-width: 90vw !important;
    max-height: 50.625vw !important;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay {
    width: 70px;
    height: 70px;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay i {
    font-size: 24px;
  }
}

@media (max-width: 767px) {
  .fancybox__content {
    width: 95vw !important;
    height: 53.4375vw !important;
    max-width: 95vw !important;
    max-height: 53.4375vw !important;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay {
    width: 60px;
    height: 60px;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay i {
    font-size: 20px;
  }

  .fancybox__button--close {
    width: 35px !important;
    height: 35px !important;
  }
}

@media (max-width: 575px) {
  .fancybox__content {
    width: 100vw !important;
    height: 56.25vw !important;
    max-width: 100vw !important;
    max-height: 56.25vw !important;
    border-radius: 0;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay {
    width: 50px;
    height: 50px;
  }

  .tp-portfolio-inner-thumb a .cdn-play-overlay i {
    font-size: 18px;
  }

  .fancybox__button--close {
    width: 30px !important;
    height: 30px !important;
    top: 10px !important;
    right: 10px !important;
  }

  .fancybox__infobar {
    font-size: 12px;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */

.fancybox__content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(200, 11, 15, 0.3);
  border-top-color: #c80b0f;
  border-radius: 50%;
  animation: cdn-video-spin 1s linear infinite;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fancybox__content.loading::before {
  opacity: 1;
}

@keyframes cdn-video-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.fancybox__button:focus {
  outline: 2px solid #c80b0f;
  outline-offset: 2px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

.fancybox__container {
  animation: cdn-video-fadeIn 0.3s ease;
}

@keyframes cdn-video-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tp-portfolio-inner-item:hover
.tp-portfolio-inner-thumb a .cdn-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
}
