/**
 * ETHOS Institute - Video Modal & Components Styling
 * Styles for video modal, hero previews, and mega menu video cards
 */

/* ========================================================================
   Video Modal Overlay
   ======================================================================== */

.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 30, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.video-modal-overlay.active {
  opacity: 1;
}

/* Video Modal Container */
.video-modal-container {
  background: white;
  border-radius: 16px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close Button */
.video-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.video-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: rotate(90deg);
}

/* Video Modal Content */
.video-modal-content {
  display: flex;
  flex-direction: column;
}

/* Video Player Container */
.video-modal-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
}

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

/* Video Info Section */
.video-modal-info {
  padding: 30px;
  background: white;
}

.video-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 15px;
  line-height: 1.3;
}

.video-modal-description {
  font-size: 15px;
  color: #6B7280;
  line-height: 1.6;
  margin: 0 0 20px;
}

.video-modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 2px solid #F3F4F6;
}

.video-duration {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6B7280;
  font-weight: 500;
}

.video-duration i {
  color: #3B82F6;
}

.video-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3B82F6;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.video-view-all:hover {
  color: #2563EB;
  gap: 12px;
}

.video-view-all i {
  transition: transform 0.2s;
}

.video-view-all:hover i {
  transform: translateX(3px);
}

/* ========================================================================
   Hero Video Preview (Homepage)
   ======================================================================== */

.hero-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.hero-video-preview {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.hero-video-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.hero-video-info h3 {
  color: white;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 5px;
}

.hero-video-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin: 0;
}

.hero-video-cta {
  background: white;
  color: #1F2937;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.hero-video-cta:hover {
  background: #F3F4F6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   Mega Menu Video Cards
   ======================================================================== */

.mega-menu-video-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.mega-menu-video-card:hover {
  border-color: #3B82F6;
  background: #F8FAFF;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* Video Thumbnail */
.mega-menu-video-thumbnail {
  position: relative;
  width: 110px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.mega-menu-video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.mega-menu-video-card:hover .mega-menu-video-thumbnail img {
  transform: scale(1.05);
}

/* Play Button Overlay */
.mega-menu-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3B82F6;
  font-size: 14px;
  transition: all 0.3s;
}

.mega-menu-video-card:hover .mega-menu-video-play {
  background: #3B82F6;
  color: white;
  transform: translate(-50%, -50%) scale(1.1);
}

.mega-menu-video-play i {
  margin-left: 2px; /* Optical centering for play icon */
}

/* Duration Badge */
.mega-menu-video-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

/* Video Info */
.mega-menu-video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mega-menu-video-title {
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 8px;
  line-height: 1.4;
}

.mega-menu-video-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3B82F6;
  font-weight: 600;
}

.mega-menu-video-card:hover .mega-menu-video-cta {
  color: #2563EB;
}

.mega-menu-video-cta i {
  font-size: 14px;
}

/* ========================================================================
   Video Section in Mega Menu
   ======================================================================== */

.mega-menu-video-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #E5E7EB;
}

.mega-menu-video-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 15px;
}

/* ========================================================================
   Responsive Design
   ======================================================================== */

@media (max-width: 768px) {
  .video-modal-container {
    max-height: 95vh;
    border-radius: 12px;
  }

  .video-modal-info {
    padding: 20px;
  }

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

  .video-modal-description {
    font-size: 14px;
  }

  .video-modal-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  /* Mega menu video cards stack on mobile */
  .mega-menu-video-card {
    flex-direction: column;
  }

  .mega-menu-video-thumbnail {
    width: 100%;
    height: 150px;
  }
}

/* ========================================================================
   Video Button Styles (for CTAs)
   ======================================================================== */

.btn-watch-video {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-watch-video:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

.btn-watch-video i {
  font-size: 18px;
}

.btn-watch-video-secondary {
  background: white;
  color: #3B82F6;
  border: 2px solid #3B82F6;
}

.btn-watch-video-secondary:hover {
  background: #F0F7FF;
  border-color: #2563EB;
  color: #2563EB;
}

/* ========================================================================
   Loading State
   ======================================================================== */

.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========================================================================
   Accessibility
   ======================================================================== */

.video-modal-overlay:focus-within {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

.video-modal-close:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.mega-menu-video-card:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
