/**
 * Greater Zion Interactive Video Header - Complete Styles with Dividers
 */

/* Container elements - properly scoped to avoid conflicts */
.gz-video-header-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.gz-video-header {
  position: relative;
  width: 100%;
  height: 90vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Video Container */
.gz-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Video Element */
.gz-header-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Fix for Safari */
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
}

/* 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;
}

.gz-text-overlay.active {
  opacity: 1;
  animation: gz-fade-in 0.6s ease-out;
}

@keyframes gz-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Faroe Islands style: Enhanced text readability */
.gz-overlay-content {
  padding: 0;
  color: #fff;
  transition: all 0.3s ease;
}

.gz-overlay-title {
  margin: 0 0 8px 0;
  font-size: var(--title-size, 22px);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); /* Enhanced shadow */
  display: inline-block;
}

.gz-overlay-text {
  font-size: var(--text-size, 16px);
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* Hover instructions */
.gz-overlay-content::after {
  content: 'Hover for more';
  display: block;
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.8;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease;
}

.gz-text-overlay:hover .gz-overlay-content::after {
  opacity: 0;
}

/* Expanded content (shown on hover) */
.gz-overlay-expanded {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%); /* Center horizontally */
  background-color: #fff;
  color: #364b54; /* Dark Blue */
  padding: 30px;
  width: 60%; /* Use percentage of screen width */
  min-width: 700px; /* Minimum width */
  max-width: 900px; /* Maximum width */
  max-height: 70vh; /* Don't let it get too tall - leave room for nav */
  overflow-y: auto; /* Allow scrolling for tall content */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 5; /* Higher z-index to ensure it's above everything */
  border-radius: 8px;
}

/* Custom scrollbar for expanded content */
.gz-overlay-expanded::-webkit-scrollbar {
  width: 8px;
}

.gz-overlay-expanded::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.gz-overlay-expanded::-webkit-scrollbar-thumb {
  background: #A0BABF; /* Light Blue */
  border-radius: 4px;
}

.gz-overlay-expanded::-webkit-scrollbar-thumb:hover {
  background: #7B7C7F; /* Medium Gray */
}

/* Hover effect */
.gz-text-overlay:hover .gz-overlay-content {
  opacity: 0;
  visibility: hidden;
}

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

.gz-expanded-title {
  margin: 0 0 15px 0;
  color: #364b54; /* Dark Blue */
  font-size: var(--title-size, 22px);
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gz-expanded-text {
  margin-bottom: 20px;
  color: #333;
  line-height: 1.6;
  font-size: var(--text-size, 16px);
}

.gz-expanded-cta {
  display: inline-block;
  background-color: #EB6B40; /* Orange accent color */
  color: white !important; /* Force white text */
  padding: 12px 24px;
  text-decoration: none !important; /* Prevent underline */
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  border: none !important; /* Prevent border */
  box-shadow: 0 2px 8px rgba(235, 107, 64, 0.3);
}

.gz-expanded-cta:hover, 
.gz-expanded-cta:focus, 
.gz-expanded-cta:active {
  background-color: #d15b35;
  color: white !important;
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(235, 107, 64, 0.4);
}

/* Navigation Icons */
.gz-video-nav-icons {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  z-index: 4;
  text-align: center;
}

.gz-video-nav-icons ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap; /* Prevent wrapping */
  overflow-x: auto; /* Allow horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: none; /* Hide scrollbar in Firefox */
  -ms-overflow-style: none; /* Hide scrollbar in IE/Edge */
  padding-bottom: 10px; /* Space for invisible scrollbar */
}

/* Hide scrollbar in WebKit browsers */
.gz-video-nav-icons ul::-webkit-scrollbar {
  display: none;
}

.gz-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 15px 10px;
  padding: 5px;
  flex: 0 0 auto; /* Prevent items from shrinking */
  min-width: 80px; /* Minimum width to prevent squeezing */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  position: relative; /* For divider positioning */
  opacity: 0.7;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Visual divider between nav items */
.gz-nav-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -15px; /* Position in the middle of margin */
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.3) 80%,
    transparent
  );
  pointer-events: none;
}

/* Fix last item spacing */
.gz-video-nav-icons ul li:last-child {
  margin-right: 25px; /* Add extra margin to last item */
}

@media (max-width: 768px) {
  .gz-video-nav-icons ul li:last-child {
    margin-right: 30px; /* More margin on mobile */
  }
  
  /* Adjust divider for mobile */
  .gz-nav-item:not(:last-child)::after {
    right: -8px; /* Adjusted for smaller margin */
    height: 25px;
  }
}

.gz-nav-item.active {
  opacity: 1;
  transform: scale(1.05);
}

.gz-nav-item:hover {
  opacity: 1;
  transform: translateY(-5px);
}

/* Font Awesome Icon Styling */
.gz-nav-item i {
  font-size: var(--icon-size, 30px);
  color: white;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.gz-nav-item.active i,
.gz-nav-item:hover i {
  transform: scale(1.1);
}

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

.gz-nav-item.active .gz-nav-icon,
.gz-nav-item:hover .gz-nav-icon {
  transform: scale(1.1);
}

.gz-icon-label {
  color: white;
  font-size: var(--text-size, 14px);
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  max-width: 120px; /* Increased from 80px to prevent truncation */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis for long text */
  padding: 0 5px; /* Add some padding */
  transition: font-weight 0.3s ease;
}

.gz-nav-item.active .gz-icon-label {
  font-weight: 700;
}

/* Scroll hint animation */
.gz-scroll-hint {
  position: absolute;
  bottom: 90px;
  right: 20px;
  width: 50px;
  height: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: left center, right center;
  background-repeat: no-repeat;
  background-size: 24px;
  animation: gz-scroll-hint 2s infinite;
  opacity: 0.7;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

@keyframes gz-scroll-hint {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(0); }
  75% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

/* Mobile styling for nav */
.gz-mobile-nav {
  cursor: grab;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .gz-video-header {
    height: 70vh; /* Shorter on mobile */
  }
  
  .gz-nav-item {
    margin: 0 8px; /* Tighter spacing on mobile */
    min-width: 75px; /* Smaller width on mobile */
  }
  
  .gz-icon-label {
    font-size: 12px; /* Smaller text on mobile */
  }
  
  /* Change hover text for mobile */
  .gz-overlay-content::after {
    content: 'Tap for more';
  }
  
  /* Ensure nav items don't wrap on mobile */
  .gz-video-nav-icons ul {
    justify-content: flex-start; /* Left align for better scrolling */
    padding-left: 15px; /* Add some padding at start */
    padding-right: 15px; /* Add some padding at end */
  }
  
  .gz-text-overlay {
    max-width: 250px; /* Slightly narrower on mobile */
  }
  
  .gz-overlay-expanded {
    width: 90%;
    min-width: 300px;
    max-width: 500px;
    padding: 20px;
    top: 30px;
    max-height: 80vh; /* More height on mobile */
  }
  
  /* Mobile tap behavior */
  .gz-text-overlay.tap-active .gz-overlay-content {
    opacity: 0;
    visibility: hidden;
  }
  
  .gz-text-overlay.tap-active .gz-overlay-expanded {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
  }
}

/* High-performance animation optimizations */
@media (prefers-reduced-motion: no-preference) {
  .gz-nav-item,
  .gz-text-overlay,
  .gz-overlay-content,
  .gz-overlay-expanded {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* Prevent conflicts with WordPress themes */
.gz-text-overlay * {
  box-sizing: border-box;
}

.gz-overlay-expanded a {
  box-shadow: none !important;
}

.gz-nav-item:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Fix for z-index issues */
.gz-video-header-wrapper {
  z-index: 1; /* Ensure proper stacking in WordPress */
}

/* Fix for Safari video playback */
.gz-header-video {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Smooth transitions for video switching */
.gz-header-video {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.gz-header-video:not(.active) {
  opacity: 0;
}