/**
 * Greater Zion Interactive Video Header - Complete Styles
 * Enhanced with accessibility, mobile responsiveness, and performance optimizations
 */

/* Container elements - properly scoped to avoid conflicts */
.gz-video-header-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  position: relative;
  /* Ensure navigation has space */
  padding-bottom: 80px;
}

.gz-video-header {
  position: relative;
  width: 100%;
  height: 90vh;
  overflow: visible;
  margin: 0;
  padding: 0;
  background-color: #000; /* Fallback background */
}

/* Video Container */
.gz-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Ensure it doesn't clip navigation */
  overflow: hidden;
}

/* Video Element */
.gz-header-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Performance optimizations */
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  transition: opacity 0.3s ease;
}

/* Poster fallback for when video fails */
.gz-poster-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  z-index: 1;
  display: none;
}

/* Dark Overlay */
.gz-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.4; /* Default 40% dark overlay */
  z-index: 2;
  pointer-events: none; /* Allow clicks to pass through */
}

/* Text Overlays */
.gz-text-overlays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none; /* Allow clicks to pass through to video */
}

.gz-text-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 300px;
  pointer-events: auto; /* Re-enable pointer events on overlays */
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0; /* Start hidden - will be shown by JS */
  z-index: 1;
  /* Performance optimization */
  will-change: opacity, transform;
}

.gz-text-overlay.active {
  opacity: 1;
}

/* Enhanced text readability with better contrast */
.gz-overlay-content {
  padding: 0;
  position: relative;
  background: var(--overlay-bg, rgba(0, 0, 0, 0.8));
  border-radius: 8px;
  padding: 15px;
  color: var(--overlay-text, #fff);
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.gz-overlay-title {
  margin: 0 0 8px 0;
  font-size: var(--title-size, 22px);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gz-overlay-text {
  margin: 0;
  font-size: var(--text-size, 16px);
  line-height: 1.4;
  color: #f0f0f0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hover effect indicator */
.gz-overlay-content::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4a90e2, #7b68ee);
  transition: width 0.3s ease;
  border-radius: 1px;
}

.gz-text-overlay:hover .gz-overlay-content::after {
  width: 60%;
}

/* Expanded overlay content */
.gz-overlay-expanded {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  max-width: 350px;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 10;
  margin-top: 10px;
}

.gz-text-overlay:hover .gz-overlay-content {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gz-text-overlay:hover .gz-overlay-expanded {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.gz-expanded-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.gz-expanded-text {
  margin: 0 0 15px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #e0e0e0;
}

.gz-expanded-cta {
  display: inline-block;
  background: linear-gradient(135deg, #4a90e2, #7b68ee);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-align: center;
}

.gz-expanded-cta:hover, 
.gz-expanded-cta:focus {
  background: linear-gradient(135deg, #357abd, #6a5acd);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  outline: none;
}

/* Navigation Icons */
.gz-video-nav-icons {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  --icon-size: 30px;
  --text-size: 14px;
  /* Ensure navigation doesn't get cut off */
  max-width: calc(100vw - 40px);
  padding: 0 20px;
  /* Prevent cutoff */
  box-sizing: border-box;
}

.gz-video-nav-icons ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 15px 20px;
  gap: 20px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  cursor: grab;
  transition: all 0.3s ease;
  /* Ensure proper spacing and prevent cutoff */
  padding-bottom: 20px;
  margin-bottom: 0;
}

.gz-video-nav-icons ul::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.gz-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
  min-width: 80px;
  text-align: center;
  color: var(--nav-text, #fff);
  text-decoration: none;
  border: 2px solid transparent;
  background: var(--nav-bg, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.gz-video-nav-icons ul li:last-child {
  margin-right: 0;
}

@media (max-width: 768px) {
  .gz-video-nav-icons ul li:last-child {
    margin-right: 15px;
  }
}

.gz-nav-item.active {
  background: var(--nav-active, rgba(74, 144, 226, 0.3));
  border-color: var(--nav-border, #4a90e2);
  transform: scale(1.05);
}

.gz-nav-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gz-nav-item i {
  font-size: var(--icon-size);
  color: var(--nav-text, #fff);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.gz-nav-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

.gz-icon-label {
  font-size: var(--text-size);
  font-weight: 500;
  color: var(--nav-text, #fff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transition: all 0.3s ease;
  line-height: 1.2;
}

/* Scroll hint for mobile */
.gz-scroll-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  animation: gz-scroll-hint 2s infinite;
  pointer-events: none;
}

@keyframes gz-scroll-hint {
  0%, 100% { opacity: 0.5; transform: translateY(-50%) translateX(0); }
  50% { opacity: 1; transform: translateY(-50%) translateX(-3px); }
}

/* Mobile navigation styles */
.gz-mobile-nav {
  bottom: 20px;
}

.gz-dragging {
  cursor: grabbing !important;
  user-select: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .gz-video-header {
    height: 70vh;
  }

  .gz-nav-item {
    min-width: 70px;
    padding: 8px;
    gap: 6px;
  }

  .gz-icon-label {
    font-size: 12px;
  }

  .gz-overlay-content::after {
    display: none;
  }

  .gz-video-nav-icons {
    bottom: 15px;
    max-width: calc(100vw - 20px);
    padding: 0 10px;
  }

  .gz-video-nav-icons ul {
    gap: 15px;
    padding: 12px 20px;
    padding-bottom: 25px;
    margin-bottom: 0;
  }

  .gz-text-overlay {
    max-width: 250px;
  }

  .gz-overlay-expanded {
    max-width: 280px;
    padding: 15px;
  }

  .gz-mobile-overlay {
    transform: translate(-50%, -50%) scale(0.9);
  }

  .gz-text-overlay.tap-active .gz-overlay-content {
    transform: translateY(-3px);
  }

  .gz-text-overlay.tap-active .gz-overlay-expanded {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: no-preference) {
  .gz-nav-item,
  .gz-text-overlay,
  .gz-overlay-content,
  .gz-overlay-expanded {
    transition: all 0.3s ease;
  }
}

/* Accessibility improvements */
.gz-text-overlay * {
  pointer-events: none;
}

.gz-overlay-expanded a {
  pointer-events: auto;
}

.gz-nav-item:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* Performance optimizations */
.gz-video-header-wrapper {
  contain: layout style paint;
}

.gz-header-video {
  contain: layout style paint;
}

/* Loading states */
.gz-video-header.loading {
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced mobile touch support */
.gz-preview-overlay {
  touch-action: none; /* Prevent default touch behaviors */
  user-select: none; /* Prevent text selection while dragging */
}

/* Drag & Drop visual feedback */
.gz-preview-overlay.dragging {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 1000;
}

/* Mobile touch feedback */
.gz-preview-overlay.touch-active {
  transform: translate(-50%, -50%) scale(1.05);
  transition: transform 0.1s ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gz-overlay-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #fff;
  }
  
  .gz-nav-item {
    border: 2px solid #fff;
  }
  
  .gz-nav-item.active {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.5);
  }
}

/* Print styles */
@media print {
  .gz-video-header {
    height: auto;
    min-height: 300px;
  }
  
  .gz-video-nav-icons,
  .gz-text-overlays {
    display: none;
  }
  
  .gz-header-video {
    display: none;
  }
  
  .gz-poster-fallback {
    display: block !important;
  }
}

/* Logo Animation Styles */
.gz-logo-animation,
.gz-logo-static {
  pointer-events: none;
  user-select: none;
}

.gz-logo-animation img,
.gz-logo-static img,
.gz-logo-animation video,
.gz-logo-static video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  /* Ensure large logos don't overflow */
  max-height: 80vh;
  object-fit: contain;
}

/* Logo animation keyframes */
@keyframes gz-logo-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes gz-logo-fade-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gz-logo-pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.6;
  }
}