/**
 * VISTA ARENAL ADVENTURE PARK
 * Feedback Round 6 - Critical Fixes
 *
 * Addressing:
 * 1. About section image loading issues (mobile + desktop loading text)
 * 2. "Out of Our Adventure" video section restoration
 * 3. Color consistency between mobile and desktop
 * 4. Footer mobile alignment issues
 * 5. Enhanced adventure activities styling
 */

/* ==========================================================================
   1. About Section Image Loading Fixes
   ========================================================================== */

.about-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.about-image picture {
  display: block;
  width: 100%;
  height: auto;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

/* Image loading states */
.about-image img[loading="lazy"] {
  opacity: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.about-image img.loaded,
.about-image img:not([loading="lazy"]) {
  opacity: 1;
  background: none;
  animation: none;
}

/* Remove persistent loading text */
.about-image::after {
  display: none !important;
}

.about-image .loading-text,
.about-image [class*="loading"],
.about-section .loading-text,
.about-section [class*="loading"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Hide any text nodes containing "Loading" */
.about-image::before {
  content: none !important;
}

/* Additional safety - hide any white text overlays */
.about-image .img-optimized::after,
.about-image .img-adventure::after {
  display: none !important;
}

/* Loading state shimmer animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Mobile image loading fix - ensure proper aspect ratio */
@media (max-width: 767px) {
  .about-image {
    aspect-ratio: 4/3;
    background: var(--warm-sand);
  }
  
  .about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ==========================================================================
   2. "Out of Our Adventure" Video Section
   ========================================================================== */

.video-showcase {
  padding: var(--space-2xl) 0;
  background: linear-gradient(135deg, 
    rgba(245, 230, 211, 0.7) 0%, 
    rgba(255, 255, 255, 0.9) 50%, 
    rgba(0, 168, 89, 0.1) 100%);
  position: relative;
  overflow: hidden;
}

.video-showcase::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="leaves" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10,2 Q15,10 10,18 Q5,10 10,2" fill="rgba(0,168,89,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23leaves)"/></svg>') repeat;
  opacity: 0.3;
  z-index: 1;
}

.video-showcase .container {
  position: relative;
  z-index: 2;
}

.video-container {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--cloud-white);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.video-container:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(45deg, var(--primary-green), var(--secondary-green));
  overflow: hidden;
  cursor: pointer;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

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

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--cloud-white);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.play-button .play-icon {
  color: var(--primary-green);
  transition: color var(--transition-fast);
}

.play-button:hover .play-icon {
  color: var(--accent-blue);
}

.video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: var(--space-lg) var(--space-md) var(--space-md);
  color: var(--cloud-white);
}

.video-duration {
  background: rgba(0, 0, 0, 0.7);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
}

.video-info {
  padding: var(--space-lg);
  text-align: center;
}

.video-title {
  margin-bottom: var(--space-sm);
  color: var(--earth-brown);
  font-size: 1.5rem;
}

.video-description {
  color: var(--volcano-gray);
  margin-bottom: 0;
  line-height: 1.6;
}

/* Video loaded state - replace thumbnail with iframe */
.video-container.loaded .video-thumbnail {
  padding: 0;
}

.video-container.loaded .video-thumbnail iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-container.loaded .play-button,
.video-container.loaded .video-overlay {
  display: none;
}

/* Mobile video adjustments */
@media (max-width: 767px) {
  .play-button {
    width: 60px;
    height: 60px;
  }
  
  .play-button .play-icon svg {
    width: 32px;
    height: 32px;
  }
  
  .video-info {
    padding: var(--space-md);
  }
  
  .video-title {
    font-size: 1.25rem;
  }
}


/* ==========================================================================
   4. Footer Mobile Alignment Fixes
   ========================================================================== */

.footer-brand {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-lg);
  text-align: center;
  justify-content: center;
}

.footer-brand picture {
  flex-shrink: 0;
}

.footer-brand-text {
  margin-left: var(--space-md);
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--earth-brown);
}

/* Mobile footer fixes */
@media (max-width: 767px) {
  .footer-brand {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: var(--space-sm);
  }
  
  .footer-brand picture {
    margin-bottom: var(--space-xs);
  }
  
  .footer-brand-text {
    margin-left: 0;
    text-align: center;
  }
  
  /* Fix "Adventures" text alignment specifically */
  .footer-brand::after {
    content: "Adventures";
    display: block;
    margin-top: var(--space-xs);
    font-family: var(--heading-font);
    font-weight: 600;
    color: var(--earth-brown);
    font-size: 1rem;
    text-align: center;
  }
  
  /* Hide any existing misaligned "Adventures" text */
  .footer-brand .adventures-text {
    display: none;
  }
}

/* ==========================================================================
   5. Enhanced Adventure Activities Grid
   ========================================================================== */

.adventures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.activity-card {
  background: var(--cloud-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  position: relative;
  border: 2px solid transparent;
}

.activity-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-green);
}

.activity-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.activity-card:hover img {
  transform: scale(1.05);
}

.activity-content {
  padding: var(--space-lg);
}

.activity-content h3 {
  color: var(--earth-brown);
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.activity-content p {
  color: var(--volcano-gray);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) 0;
  border-top: 1px solid rgba(93, 64, 55, 0.1);
  border-bottom: 1px solid rgba(93, 64, 55, 0.1);
}

.activity-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 500;
  color: var(--earth-brown);
}

.activity-cta {
  display: block;
  width: 100%;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  color: var(--cloud-white);
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
}

.activity-cta:hover {
  background: linear-gradient(135deg, var(--secondary-green), var(--accent-blue));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 168, 89, 0.3);
}

/* Adventure grid mobile adjustments */
@media (max-width: 767px) {
  .adventures-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .activity-card {
    max-width: 100%;
  }
  
  .activity-content {
    padding: var(--space-md);
  }
  
  .activity-meta {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }
}

/* ==========================================================================
   6. Enhanced Visual Effects & Interactions
   ========================================================================== */

/* Add subtle animations to enhance user experience */
.costa-rica-icon {
  display: inline-block;
  font-size: 2rem;
  animation: gentle-bounce 3s ease-in-out infinite;
}

@keyframes gentle-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Floating elements animation */
.floating-element {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Section transitions */
.section-visible {
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button ripple effects */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn-ripple:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  20% {
    transform: scale(25, 25);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* ==========================================================================
   7. Accessibility Improvements
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .activity-card {
    border: 2px solid var(--earth-brown);
  }
  
  .activity-cta {
    border: 2px solid var(--cloud-white);
  }
  
  .play-button {
    border: 3px solid var(--primary-green);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .floating-element,
  .costa-rica-icon {
    animation: none;
  }
  
  .activity-card,
  .video-container,
  .play-button {
    transition: none;
  }
  
  .activity-card:hover,
  .video-container:hover {
    transform: none;
  }
}

/* Focus styles for better accessibility */
.play-button:focus,
.activity-cta:focus {
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}