/**
 * Phase 5 Plugin Customizations — MyNamCycling Landing Page
 * Swiper carousel, PhotoSwipe lightbox, and Leaflet map styling
 */

/* === Swiper Carousel Customizations === */
.testimonials-swiper {
  padding-bottom: var(--space-12);
  position: relative;
}

.testimonials-swiper .swiper-slide {
  height: auto;
  display: flex;
}

.testimonials-swiper .testimonial-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Navigation buttons */
.testimonials-swiper .swiper-button-prev,
.testimonials-swiper .swiper-button-next {
  color: var(--brand-600);
  background: var(--surface-0);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-fast);
}

.testimonials-swiper .swiper-button-prev:hover,
.testimonials-swiper .swiper-button-next:hover {
  background: var(--brand-600);
  color: var(--surface-0);
  box-shadow: var(--shadow-hover);
  transform: scale(1.1);
}

.testimonials-swiper .swiper-button-prev::after,
.testimonials-swiper .swiper-button-next::after {
  font-size: 20px;
  font-weight: bold;
}

/* Pagination dots */
.testimonials-swiper .swiper-pagination {
  bottom: 0;
}

.testimonials-swiper .swiper-pagination-bullet {
  background: var(--ink-300);
  opacity: 1;
  width: 10px;
  height: 10px;
  transition: all var(--transition-fast);
}

.testimonials-swiper .swiper-pagination-bullet-active {
  background: var(--brand-600);
  width: 24px;
  border-radius: 5px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .testimonials-swiper .swiper-button-prev,
  .testimonials-swiper .swiper-button-next {
    width: 40px;
    height: 40px;
  }
  
  .testimonials-swiper .swiper-button-prev::after,
  .testimonials-swiper .swiper-button-next::after {
    font-size: 16px;
  }
  
  .testimonials-swiper .swiper-button-prev {
    left: 0;
  }
  
  .testimonials-swiper .swiper-button-next {
    right: 0;
  }
}

/* === PhotoSwipe Customizations === */
.event-image-link,
.news-image-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  cursor: zoom-in;
  transition: transform var(--transition-base);
}

.event-image-link:hover,
.news-image-link:hover {
  transform: scale(1.02);
}

.event-image-link::after,
.news-image-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.event-image-link:hover::after,
.news-image-link:hover::after {
  opacity: 1;
}

.event-image-link::before,
.news-image-link::before {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 48px;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-base);
  pointer-events: none;
}

.event-image-link:hover::before,
.news-image-link:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

.card-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-base);
}

/* PhotoSwipe UI customization */
.pswp {
  --pswp-bg: rgba(0, 0, 0, 0.9);
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: rgba(255, 255, 255, 0.7);
}

.pswp__button {
  background-color: rgba(0, 122, 94, 0.8) !important;
  transition: all 0.2s ease;
}

.pswp__button:hover {
  background-color: rgba(0, 122, 94, 1) !important;
}

/* === Leaflet Map Customizations === */
.contact-map-container {
  position: relative;
}

.contact-map {
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--surface-100);
}

/* Custom map controls */
.leaflet-control-zoom a {
  background-color: var(--brand-600) !important;
  color: var(--surface-0) !important;
  border: none !important;
  transition: all var(--transition-fast);
}

.leaflet-control-zoom a:hover {
  background-color: var(--brand-700) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}

.leaflet-popup-tip {
  background: var(--surface-0);
}

/* Map loading state */
.contact-map::before {
  content: 'Loading map...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink-500);
  font-size: var(--text-lg);
  z-index: 400;
  pointer-events: none;
}

.leaflet-container::before {
  display: none;
}

/* === Mobile Responsive Adjustments === */
@media (max-width: 768px) {
  .contact-map {
    height: 300px !important;
  }
  
  .event-image-link::before,
  .news-image-link::before {
    font-size: 32px;
  }
}

/* === Accessibility Improvements === */
@media (prefers-reduced-motion: reduce) {
  .testimonials-swiper,
  .event-image-link,
  .news-image-link,
  .card-image {
    transition: none !important;
  }
  
  .testimonials-swiper .swiper-button-prev:hover,
  .testimonials-swiper .swiper-button-next:hover {
    transform: none;
  }
}

/* Focus states for keyboard navigation */
.event-image-link:focus-visible,
.news-image-link:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
}

.swiper-button-prev:focus-visible,
.swiper-button-next:focus-visible,
.swiper-pagination-bullet:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
}
