/* ===========================
   VISTA ARENAL COMPONENT LIBRARY
   Phase 2: Complete Visual Design System
   Costa Rica Adventure Tourism Components
   =========================== */

/* ===========================
   COMPONENT VARIABLES
   =========================== */

:root {
  /* Component-specific colors */
  --component-primary: var(--primary-green);
  --component-secondary: var(--secondary-green);
  --component-accent: var(--accent-blue);
  --component-warning: var(--sunset-orange);
  --component-earth: var(--earth-brown);
  --component-sand: var(--warm-sand);
  --component-white: var(--cloud-white);
  
  /* Component shadows with Costa Rica colors */
  --shadow-primary: 0 8px 25px rgba(0, 168, 89, 0.15);
  --shadow-secondary: 0 6px 20px rgba(124, 179, 66, 0.12);
  --shadow-accent: 0 8px 25px rgba(2, 119, 189, 0.15);
  --shadow-warning: 0 8px 25px rgba(255, 111, 0, 0.2);
  --shadow-earth: 0 6px 20px rgba(93, 64, 55, 0.15);
  
  /* Organic border radius patterns */
  --radius-organic-1: 42% 58% 70% 30% / 45% 55% 35% 65%;
  --radius-organic-2: 58% 42% 30% 70% / 55% 45% 65% 35%;
  --radius-organic-3: 75% 25% 43% 57% / 68% 32% 76% 24%;
  --radius-organic-4: 25% 75% 57% 43% / 32% 68% 24% 76%;
}

/* ===========================
   ADVENTURE CARDS LIBRARY
   =========================== */

/* Primary Adventure Card */
.adventure-card-primary {
  background: linear-gradient(
    145deg,
    var(--component-white) 0%,
    rgba(245, 230, 211, 0.3) 100%
  );
  border-radius: var(--radius-organic-1);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md), var(--shadow-primary);
  border: 2px solid transparent;
}

.adventure-card-primary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(0, 168, 89, 0.03),
    transparent,
    rgba(124, 179, 66, 0.02),
    transparent
  );
  animation: adventureGlow 15s linear infinite;
  pointer-events: none;
}

.adventure-card-primary:hover {
  transform: translateY(-8px) rotate(1deg);
  border-radius: var(--radius-organic-2);
  box-shadow: var(--shadow-xl), var(--shadow-primary);
  border-color: var(--component-primary);
}

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

/* Adventure Card with Image */
.adventure-card-image {
  background: var(--component-white);
  border-radius: 20px 60px 20px 20px;
  overflow: hidden;
  position: relative;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.adventure-card-image .card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.adventure-card-image:hover .card-image {
  transform: scale(1.05);
}

.adventure-card-image .card-content {
  padding: var(--space-lg);
  position: relative;
  z-index: 2;
}

.adventure-card-image:hover {
  transform: translateY(-12px);
  border-radius: 60px 20px 20px 20px;
  box-shadow: var(--shadow-xl), var(--shadow-secondary);
}

/* Compact Adventure Card */
.adventure-card-compact {
  background: linear-gradient(
    135deg,
    var(--component-sand) 0%,
    var(--component-white) 100%
  );
  border-radius: 15px 45px 15px 15px;
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 89, 0.1);
}

.adventure-card-compact::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  background: var(--component-primary);
  border-radius: 50%;
  opacity: 0.1;
  transition: all var(--transition-base);
}

.adventure-card-compact:hover {
  transform: translateX(5px);
  border-radius: 45px 15px 15px 15px;
  border-color: var(--component-primary);
  box-shadow: var(--shadow-md);
}

.adventure-card-compact:hover::after {
  transform: scale(1.5);
  opacity: 0.2;
}

/* ===========================
   ENHANCED BUTTON LIBRARY
   =========================== */

/* Adventure Action Button */
.btn-adventure {
  background: linear-gradient(
    135deg,
    var(--component-primary) 0%,
    var(--component-secondary) 100%
  );
  background-size: 200% 200%;
  color: var(--component-white);
  border: none;
  border-radius: 25px 8px 25px 8px;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--heading-font);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md), var(--shadow-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 48px;
}

.btn-adventure::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  transition: left var(--transition-base);
  opacity: 0;
}

.btn-adventure:hover {
  background-position: 100% 100%;
  transform: translateY(-3px) scale(1.02);
  border-radius: 8px 25px 8px 25px;
  box-shadow: var(--shadow-xl), var(--shadow-primary);
  /* padding-left: calc(var(--space-xl) + 25px); */
  color: white;
  text-decoration: none;
}

.btn-adventure:hover::before {
  left: 15px;
  opacity: 1;
}

/* Pura Vida Button */
.btn-pura-vida {
  background: linear-gradient(
    45deg,
    var(--component-warning) 0%,
    #ff8f00 50%,
    var(--component-warning) 100%
  );
  background-size: 300% 300%;
  color: var(--component-white);
  border: 2px solid var(--component-warning);
  border-radius: 50px;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--accent-font);
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: puraVidaPulse 3s ease-in-out infinite;
  min-height: 44px;
}

.btn-pura-vida:hover {
  background-position: 100% 100%;
  transform: scale(1.05);
  animation: none;
  box-shadow: 
    0 8px 25px rgba(255, 111, 0, 0.4),
    0 0 30px rgba(255, 111, 0, 0.3);
}

@keyframes puraVidaPulse {
  0%, 100% { 
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.3);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 8px 25px rgba(255, 111, 0, 0.5);
    transform: scale(1.02);
  }
}

/* Nature Button */
.btn-nature {
  background: rgba(93, 64, 55, 0.1);
  color: var(--component-earth);
  border: 2px solid var(--component-earth);
  border-radius: var(--radius-organic-1);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--heading-font);
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
  min-height: 44px;
}

.btn-nature::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    var(--component-earth) 0%,
    transparent 70%
  );
  transition: all var(--transition-base);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0.1;
}

.btn-nature:hover {
  background: var(--component-earth);
  color: var(--component-white);
  border-radius: var(--radius-organic-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-earth);
}

.btn-nature:hover::after {
  width: 200px;
  height: 200px;
  opacity: 0.2;
}

/* ===========================
   COSTA RICA ICON LIBRARY
   =========================== */

.costa-rica-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    var(--component-primary) 0%,
    var(--component-secondary) 100%
  );
  border-radius: var(--radius-organic-1);
  color: var(--component-white);
  font-size: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.costa-rica-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: iconGlow 4s linear infinite;
  pointer-events: none;
}

.costa-rica-icon:hover {
  transform: scale(1.1) rotate(5deg);
  border-radius: var(--radius-organic-2);
  box-shadow: var(--shadow-xl), var(--shadow-primary);
}

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

.costa-rica-icon.zipline::after {
  content: '🌲';
}

.costa-rica-icon.rappelling::after {
  content: '🏔️';
}

.costa-rica-icon.swing::after {
  content: '🐒';
}

.costa-rica-icon.volcano::after {
  content: '🌋';
}

/* ===========================
   TESTIMONIAL COMPONENTS
   =========================== */

.testimonial-card-costa-rica {
  background: linear-gradient(
    145deg,
    var(--component-white) 0%,
    rgba(245, 230, 211, 0.5) 100%
  );
  border-radius: 30px 30px 60px 10px;
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid transparent;
  transition: all var(--transition-base);
}

.testimonial-card-costa-rica::before {
  content: '"';
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 4rem;
  color: var(--component-primary);
  opacity: 0.2;
  font-family: var(--accent-font);
  line-height: 1;
}

.testimonial-card-costa-rica .testimonial-text {
  font-family: var(--accent-font);
  font-size: 1.1rem;
  color: var(--component-earth);
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 2;
  font-style: italic;
}

.testimonial-card-costa-rica .testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 2;
}

.testimonial-card-costa-rica .author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--component-primary) 0%,
    var(--component-secondary) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--component-white);
  font-weight: bold;
  font-size: 1.2rem;
}

.testimonial-card-costa-rica:hover {
  transform: translateY(-5px) rotate(1deg);
  border-radius: 60px 30px 30px 10px;
  border-color: var(--component-primary);
  box-shadow: var(--shadow-xl), var(--shadow-primary);
}

/* ===========================
   NAVIGATION COMPONENTS
   =========================== */

.nav-costa-rica {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(0, 168, 89, 0.1);
  transition: all var(--transition-base);
}

.nav-costa-rica.scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: var(--component-primary);
  box-shadow: var(--shadow-lg);
}

.nav-link-costa-rica {
  font-family: var(--heading-font);
  font-weight: 500;
  color: var(--component-earth);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.nav-link-costa-rica::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--component-primary) 0%,
    var(--component-secondary) 100%
  );
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link-costa-rica:hover,
.nav-link-costa-rica.active {
  color: var(--component-primary);
  background: rgba(0, 168, 89, 0.05);
  transform: translateY(-2px);
}

.nav-link-costa-rica:hover::before,
.nav-link-costa-rica.active::before {
  width: 80%;
}

/* ===========================
   GALLERY COMPONENTS
   =========================== */

.gallery-item-costa-rica {
  position: relative;
  border-radius: var(--radius-organic-1);
  overflow: hidden;
  transition: all var(--transition-base);
  aspect-ratio: 4/3;
  background: var(--component-sand);
}

.gallery-item-costa-rica img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.gallery-item-costa-rica .gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(0, 168, 89, 0.8) 0%,
    rgba(124, 179, 66, 0.6) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-base);
  backdrop-filter: blur(5px);
}

.gallery-item-costa-rica .gallery-overlay .overlay-text {
  color: var(--component-white);
  font-family: var(--heading-font);
  font-weight: 600;
  text-align: center;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.gallery-item-costa-rica:hover {
  transform: scale(1.05) rotate(2deg);
  border-radius: var(--radius-organic-2);
  box-shadow: var(--shadow-xl), var(--shadow-primary);
}

.gallery-item-costa-rica:hover img {
  transform: scale(1.1);
}

.gallery-item-costa-rica:hover .gallery-overlay {
  opacity: 1;
}

.gallery-item-costa-rica:hover .gallery-overlay .overlay-text {
  transform: translateY(0);
}

/* ===========================
   RESPONSIVE COMPONENT LIBRARY
   =========================== */

/* Mobile Optimizations */
@media (max-width: 767px) {
  .adventure-card-primary,
  .adventure-card-image,
  .testimonial-card-costa-rica {
    border-radius: var(--radius-lg);
  }
  
  .adventure-card-primary:hover,
  .adventure-card-image:hover,
  .testimonial-card-costa-rica:hover {
    border-radius: var(--radius-xl);
    transform: translateY(-4px);
  }
  
  .btn-adventure,
  .btn-pura-vida,
  .btn-nature {
    border-radius: var(--radius-full);
    min-height: 48px;
  }
  
  .costa-rica-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
  .adventure-card-compact {
    flex-direction: column;
    text-align: center;
  }
  
  .gallery-item-costa-rica:hover {
    transform: scale(1.03) rotate(1deg);
  }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
  .adventure-card-primary:hover,
  .adventure-card-image:hover {
    transform: translateY(-12px) rotate(2deg);
  }
  
  .btn-adventure:hover,
  .btn-pura-vida:hover,
  .btn-nature:hover {
    transform: translateY(-4px) scale(1.05);
  }
  
  .costa-rica-icon:hover {
    transform: scale(1.15) rotate(8deg);
  }
}

/* ===========================
   ACCESSIBILITY ENHANCEMENTS
   =========================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .adventure-card-primary,
  .adventure-card-image,
  .testimonial-card-costa-rica {
    border: 3px solid var(--component-earth);
  }
  
  .btn-adventure,
  .btn-pura-vida,
  .btn-nature {
    border-width: 3px;
    font-weight: 700;
  }
  
  .nav-link-costa-rica::before {
    height: 4px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .adventure-card-primary::before,
  .costa-rica-icon::before,
  .btn-pura-vida {
    animation: none;
  }
  
  .adventure-card-primary:hover,
  .adventure-card-image:hover,
  .testimonial-card-costa-rica:hover,
  .gallery-item-costa-rica:hover {
    transform: none;
  }
  
  .btn-adventure:hover,
  .btn-pura-vida:hover,
  .btn-nature:hover,
  .costa-rica-icon:hover {
    transform: none;
  }
}