/**
 * Video Popup Animations & Styling
 * Beautiful video modal with smooth transitions and effects
 */

/* ============================================================================
   KEYFRAME ANIMATIONS
   ============================================================================ */

@keyframes popupFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropBlur {
  from {
    backdrop-filter: blur(0px);
  }
  to {
    backdrop-filter: blur(8px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes cornerSlideIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes buttonGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
  }
}

@keyframes statsStaggerIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
}

@keyframes fadeOutBackdrop {
  from {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

/* ============================================================================
   OVERLAY & BACKDROP
   ============================================================================ */

.video-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.video-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-popup-overlay.hide {
  animation: fadeOutBackdrop 0.5s ease forwards;
}

.video-popup-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0px);
}

.video-popup-overlay.active .video-popup-backdrop {
  animation: backdropBlur 0.6s ease forwards;
}

/* ============================================================================
   POPUP CONTAINER
   ============================================================================ */

.video-popup {
  position: relative;
  z-index: 10000;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(52, 152, 219, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popupSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.1s;
}

.video-popup-overlay.hide .video-popup {
  animation: fadeOut 0.5s ease forwards;
}

/* ============================================================================
   CLOSE BUTTON
   ============================================================================ */

.video-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10010;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: popupSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.close-icon {
  font-size: 24px;
  color: #2c3e50;
  font-weight: 300;
  transition: all 0.3s ease;
}

.video-popup-close:hover {
  background: #e74c3c;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.video-popup-close:hover .close-icon {
  color: white;
  transform: scale(1.2);
}

/* ============================================================================
   VIDEO HEADER & CONTAINER
   ============================================================================ */

.video-popup-header {
  position: relative;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  flex-shrink: 0;
  animation: popupSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.video-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(52, 152, 219, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.video-player {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border-radius: 12px;
}

/* ============================================================================
   FULLSCREEN BUTTON
   ============================================================================ */

.video-controls-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10005;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container:hover .video-controls-overlay {
  opacity: 1;
}

.video-fullscreen-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
  animation: popupSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.video-fullscreen-btn:hover {
  transform: scale(1.15) rotate(-10deg);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.6);
  animation: buttonGlow 1.5s ease infinite;
}

.video-fullscreen-btn:active {
  transform: scale(0.95);
}

/* ============================================================================
   CORNER DECORATIONS
   ============================================================================ */

.video-corner-decoration {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(52, 152, 219, 0.3);
  opacity: 0;
  animation: cornerSlideIn 0.6s ease forwards;
}

.video-corner-decoration.top-left {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
  border-radius: 10px 0 0 0;
  animation-delay: 0.3s;
}

.video-corner-decoration.top-right {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 10px 0 0;
  animation-delay: 0.35s;
}

.video-corner-decoration.bottom-left {
  bottom: 10px;
  left: 10px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 10px;
  animation-delay: 0.4s;
}

.video-corner-decoration.bottom-right {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 10px 0;
  animation-delay: 0.45s;
}

/* ============================================================================
   POPUP BODY & CONTENT
   ============================================================================ */

.video-popup-body {
  flex: 1;
  padding: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  overflow-y: auto;
  animation: popupSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.video-popup-body::-webkit-scrollbar {
  width: 6px;
}

.video-popup-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.video-popup-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3498db, #2980b9);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.video-popup-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2980b9, #1f5a7a);
}

/* ============================================================================
   TITLE & DESCRIPTION
   ============================================================================ */

.video-popup-title {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.4;
  animation: popupSlideUp 0.6s ease 0.3s both;
}

.video-popup-description {
  margin: 0 0 25px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  animation: popupSlideUp 0.6s ease 0.35s both;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.video-popup-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  animation: popupSlideUp 0.6s ease 0.4s both;
}

.video-btn-primary,
.video-btn-secondary {
  flex: 1;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.video-btn-primary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.video-btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.video-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

.video-btn-primary:hover::before {
  left: 100%;
}

.video-btn-secondary {
  background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
  color: #2c3e50;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-btn-secondary:hover {
  background: linear-gradient(135deg, #d5dbdb 0%, #bdc3c7 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-btn-secondary:hover {
  color: #1a252f;
}

.video-popup-actions i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.video-btn-primary:hover i,
.video-btn-secondary:hover i {
  transform: translateX(3px);
}

/* ============================================================================
   STATS SECTION
   ============================================================================ */

.video-popup-stats {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.08) 0%,
    rgba(46, 204, 113, 0.08) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(52, 152, 219, 0.1);
  animation: popupSlideUp 0.6s ease 0.45s both;
}

.video-stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  animation: statsStaggerIn 0.5s ease both;
}

.video-stat-item:nth-child(1) {
  animation-delay: 0.5s;
}

.video-stat-item:nth-child(2) {
  animation-delay: 0.55s;
}

.video-stat-item:nth-child(3) {
  animation-delay: 0.6s;
}

.video-stat-icon {
  font-size: 28px;
  transition: all 0.3s ease;
  display: inline-block;
}

.video-stat-item:hover .video-stat-icon {
  transform: scale(1.2) rotateY(360deg);
  animation-duration: 0.6s;
}

.video-stat-text {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .video-popup {
    max-width: 100%;
    width: 95%;
    max-height: 95vh;
    border-radius: 16px;
  }

  .video-popup-body {
    padding: 20px;
  }

  .video-popup-title {
    font-size: 20px;
  }

  .video-popup-description {
    font-size: 13px;
  }

  .video-popup-actions {
    flex-direction: column;
  }

  .video-btn-primary,
  .video-btn-secondary {
    width: 100%;
  }

  .video-popup-header {
    padding: 15px;
  }

  .video-popup-close {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
  }

  .close-icon {
    font-size: 20px;
  }

  .video-controls-overlay {
    bottom: 15px;
    right: 15px;
  }

  .video-fullscreen-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .video-popup-stats {
    flex-wrap: wrap;
  }

  .video-stat-item {
    flex: 0 1 calc(33.333% - 10px);
  }
}

@media (max-width: 480px) {
  .video-popup {
    border-radius: 12px;
  }

  .video-popup-body {
    padding: 15px;
  }

  .video-popup-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .video-popup-description {
    font-size: 12px;
    margin-bottom: 15px;
  }

  .video-popup-actions {
    gap: 10px;
    margin-bottom: 15px;
  }

  .video-btn-primary,
  .video-btn-secondary {
    padding: 12px 15px;
    font-size: 13px;
  }

  .video-popup-stats {
    padding: 15px;
    gap: 10px;
  }

  .video-stat-text {
    font-size: 12px;
  }

  .video-stat-icon {
    font-size: 24px;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .video-popup-overlay {
    display: none !important;
  }
}
