/* ========================================
   VIDEO WRAPPER STYLES
   ======================================== */
/* 
   Використовується тільки на:
   - showreels.html
   
   Стилі для відео контейнерів з YouTube відео та їх обгорток
*/

/* Обгортка для відео контейнера */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: #fff;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 138, 138, 0.2);
}

/* Ефект при наведенні на відео */
.video-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 138, 138, 0.4);
}

/* Контейнер для YouTube iframe */
.video-container {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
}

/* Video Preview Styles */
.video-preview {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
}

.video-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: blur(3px);
}

.video-preview:hover img {
  transform: scale(1.05);
  filter: blur(0px);
}

/* Enhanced Vignette for Blur Effect */
.video-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 35%,
    rgba(0, 0, 0, 0.2) 65%,
    rgba(0, 0, 0, 0.4) 100%
  );
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
  border-radius: 8px;
}

.video-preview:hover::before {
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 45%,
    rgba(0, 0, 0, 0.1) 75%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

/* Play Button - Site Accent Color #FF8A8A (FIXED) */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #FF8A8A 0%, #ff6b6b 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 3px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  /* Site accent color shadow */
  box-shadow: 
    0 4px 20px rgba(255, 138, 138, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 3;
}

.play-button i {
  font-size: 24px;
  color: white;
  margin-left: 3px; /* Візуальне центрування іконки play */
  transition: transform 0.3s ease;
}

/* Hover Animation */
.video-preview:hover .play-button {
  transform: translate(-50%, -50%) scale(1.15);
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 
    0 6px 25px rgba(255, 138, 138, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.3);
}

.video-preview:hover .play-button i {
  transform: scale(1.1);
}

/* Click Animation */
.play-button:active {
  transform: translate(-50%, -50%) scale(0.95);
  transition: transform 0.1s ease;
}

/* Pulse Animation - Site Accent Color #FF8A8A (FIXED) */
@keyframes pulse {
  0% {
    box-shadow: 
      0 4px 20px rgba(255, 138, 138, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 6px 25px rgba(255, 138, 138, 0.6),
      0 0 0 1px rgba(255, 255, 255, 0.3),
      0 0 0 15px rgba(255, 138, 138, 0.1);
  }
  100% {
    box-shadow: 
      0 4px 20px rgba(255, 138, 138, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

.video-preview:hover .play-button {
  animation: pulse 2s infinite;
}

/* Video Overlay - Flat Design */
.video-overlay {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.video-preview:hover .video-overlay {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-2px);
}

/* YouTube iframe стилізація (коли відео завантажено) */
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: #000;
  display: none;
}

.video-container.playing iframe {
  display: block;
}

.video-container.playing .video-preview {
  display: none;
}

/* Loading Animation */
.video-container.loading {
  position: relative;
}

.video-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 138, 138, 0.3);
  border-top: 3px solid #FF8A8A;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Заголовок відео */
.video-title {
  color: #FF8A8A;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.4rem;
  text-align: center;
  padding: 20px 20px 0;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.video-wrapper:hover .video-title {
  color: #ff6b6b;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Великі планшети */
@media (max-width: 1024px) and (min-width: 769px) {
  .video-wrapper {
    margin: 0 auto 25px;
  }
  
  .video-container {
    height: 300px;
  }
  
  .play-button {
    width: 65px;
    height: 65px;
  }
  
  .play-button i {
    font-size: 22px;
  }
}

/* Планшети */
@media (max-width: 768px) {
  .video-wrapper {
    margin: 0 auto 20px;
    border-width: 1.5px;
  }
  
  .video-container {
    height: 280px;
  }
  
  .video-title {
    font-size: 1.2rem;
    padding: 15px 15px 0;
  }
  
  .play-button {
    width: 60px;
    height: 60px;
  }
  
  .play-button i {
    font-size: 20px;
  }
  
  .video-overlay {
    bottom: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Мобільні пристрої */
@media (max-width: 480px) {
  .video-wrapper {
    margin: 0 auto 15px;
    border-width: 1px;
    border-radius: 6px;
  }
  
  .video-container {
    height: 240px;
    border-radius: 6px;
  }
  
  .video-title {
    font-size: 1.1rem;
    padding: 12px 12px 0;
  }
  
  .play-button {
    width: 50px;
    height: 50px;
  }
  
  .play-button i {
    font-size: 18px;
  }
  
  .video-overlay {
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }
  
  /* Оптимізація для touch */
  .video-preview {
    -webkit-tap-highlight-color: transparent;
  }
  
  .play-button {
    -webkit-tap-highlight-color: transparent;
  }
}
