/* ========================================
   MYSTERY TEASER CAROUSEL - PREMIUM DESIGN
   10/10 Design mit rotem Overlay & Bildoptimierung
   ======================================== */

/* ======================================== 
   SECTION STYLING
   ======================================== */
.mystery-teaser {
  background: linear-gradient(180deg, #FCFCFC 0%, #F8F8F8 100%);
  padding: var(--space-7xl) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle pattern overlay */
.mystery-teaser::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(97, 0, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(97, 0, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

/* ======================================== 
   CAROUSEL CONTAINER
   ======================================== */
.mystery-carousel {
  position: relative;
  max-width: 1400px;
  margin: var(--space-5xl) auto 0;
  padding: 0 var(--space-xl);
}

/* Carousel viewport */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  margin: 0 var(--space-3xl);
}

/* Track for cards */
.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ======================================== 
   CAROUSEL CARDS - PREMIUM DESIGN
   ======================================== */
.carousel-card {
  flex: 0 0 100%;
  position: relative;
  height: 500px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--color-gray-900);
  cursor: grab;
  user-select: none;
}

.carousel-card:active {
  cursor: grabbing;
}

/* Card Background Image Container */
.card-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.card-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s var(--ease-out);
  will-change: transform;
}

/* Spezifische Bild-Ausrichtung: "Genuss oder Grenzerfahrung?" nach links fokussieren */
.carousel-card[data-mystery="tasting"] .card-background img {
  object-position: left center;
}

/* Premium Red Overlay with Gradient */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(97, 0, 0, 0.85) 0%, 
    rgba(97, 0, 0, 0.4) 50%,
    rgba(26, 0, 0, 0.9) 100%);
  opacity: 0.9;
  transition: opacity 0.4s var(--ease-out);
  mix-blend-mode: multiply;
  z-index: 0;
}

/* Active card effects */
.carousel-card.active .card-background img {
  transform: scale(1.05);
}

.carousel-card.active .card-overlay {
  opacity: 0.8;
}

/* Card Content */
.card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-4xl);
  text-align: center;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease-out);
}

.carousel-card.active .card-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

/* Mystery Category Badge */
.mystery-category {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-xl);
  backdrop-filter: blur(10px);
}

/* Card Title */
.card-content h3 {
  font-size: var(--text-5xl);
  font-weight: var(--font-black);
  color: var(--color-secondary);
  margin-bottom: var(--space-lg);
  line-height: var(--leading-tight);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
}

/* Mystery Tagline */
.mystery-tagline {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-light);
  margin-bottom: var(--space-3xl);
  letter-spacing: 0.02em;
}

/* Mystery CTA Button */
.mystery-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-2xl);
  background: var(--color-accent);
  color: var(--color-primary-darker);
  border-radius: var(--radius-full);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.mystery-cta:hover {
  background: var(--color-accent);
  color: var(--color-primary-darker);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
  gap: var(--space-lg);
}

.mystery-cta svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-out);
}

.mystery-cta:hover svg {
  transform: translateX(4px);
}

/* ======================================== 
   CAROUSEL NAVIGATION
   ======================================== */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25);
}

.carousel-nav:hover {
  background: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

.carousel-nav-prev {
  left: 0;
}

.carousel-nav-next {
  right: 0;
}

.carousel-nav svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary-darker);
}

/* ======================================== 
   CAROUSEL INDICATORS
   ======================================== */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-3xl);
}

.indicator {
  width: 48px;
  height: 4px;
  background: rgba(97, 0, 0, 0.2);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.indicator.active {
  background: var(--color-primary);
}

.indicator::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 5s linear;
}

.indicator.active.animating::after {
  width: 100%;
}


/* ======================================== 
   TABLET STYLES (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
  .mystery-carousel {
    padding: 0 var(--space-lg);
  }
  
  .carousel-container {
    margin: 0 var(--space-xl);
  }
  
  .carousel-card {
    height: 450px;
  }
  
  .card-content h3 {
    font-size: var(--text-4xl);
  }
  
  .carousel-nav {
    width: 48px;
    height: 48px;
  }
}

/* ======================================== 
   MOBILE STYLES - OPTIMIZED
   ======================================== */
@media (max-width: 768px) {
  .mystery-teaser {
    padding: var(--space-5xl) 0;
  }
  
  .mystery-carousel {
    padding: 0;
  }
  
  .carousel-container {
    margin: 0;
    border-radius: 0;
  }
  
  .carousel-card {
    height: 300px;
    border-radius: 0;
  }
  
  /* Mobile-optimized image handling */
  .card-background img {
    object-fit: cover;
    object-position: center;
    /* Ensure quality on mobile */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  /* Spezifisch auf Mobile ebenfalls nach links fokussieren */
  .carousel-card[data-mystery="tasting"] .card-background img {
    object-position: left center;
  }
  
  /* Adjust overlay for mobile visibility */
  .card-overlay {
    background: linear-gradient(180deg, 
      rgba(97, 0, 0, 0.7) 0%, 
      rgba(97, 0, 0, 0.5) 30%,
      rgba(26, 0, 0, 0.95) 100%);
  }
  /* Bildbereich endet oberhalb der roten Leiste */
  .card-background {
    bottom: 80px;
  }
  
  .card-content {
    padding: var(--space-2xl);
    justify-content: flex-end;
    /* Abstand zur roten Leiste (80px) + Luft */
    padding-bottom: 92px;
  }
  /* Rote, am Bild andockende CTA-Leiste */
  .carousel-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: var(--color-primary);
    box-shadow: 0 -6px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
    z-index: 1;
  }

  /* Headlines/Tagline wieder sichtbar auf Mobile */
  .mystery-category,
  .card-content h3,
  .mystery-tagline {
    display: initial;
  }

  /* Button in die rote Leiste setzen */
  .mystery-cta {
    position: absolute;
    left: 50%;
    bottom: 40px; /* Mitte der 80px hohen Leiste */
    transform: translate(-50%, 50%);
    z-index: 2;
    background: var(--color-accent);
    color: var(--color-primary-darker);
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  }
  .mystery-cta:hover,
  .mystery-cta:focus {
    transform: translate(-50%, 50%);
    gap: var(--space-md);
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  }
  .mystery-category {
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .card-content h3 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-md);
  }
  
  .mystery-tagline {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2xl);
  }
  
  .mystery-cta {
    padding: var(--space-sm) var(--space-xl);
    font-size: var(--text-base);
  }
  /* Größeres Pfeil-Icon auf Mobile */
  .mystery-cta svg {
    width: 22px;
    height: 22px;
  }
  
  /* Hide navigation arrows on mobile - use swipe */
  .carousel-nav {
    display: none;
  }
  
  /* Mobile indicators */
  .carousel-indicators {
    margin-top: var(--space-2xl);
  }
  
  .indicator {
    width: 32px;
    height: 3px;
  }
  
  /* Auto-play button position */
  .carousel-play-pause {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
  }
}

/* ======================================== 
   SMALL MOBILE OPTIMIZATION
   ======================================== */
@media (max-width: 480px) {
  .carousel-card {
    height: 280px;
  }
  /* Kompaktere CTA-Leiste auf sehr kleinen Geräten */
  .carousel-card::after {
    height: 72px;
  }
  /* Auf sehr kleinen Geräten an Leistenhöhe anpassen */
  .card-background {
    bottom: 72px;
  }
  .mystery-cta {
    bottom: 36px; /* Mitte der 72px hohen Leiste */
    padding: var(--space-sm) var(--space-lg);
  }
  /* Textblock etwas näher an die schmalere Leiste rücken (72px) */
  .card-content {
    padding-bottom: 84px;
  }
  
  .card-content h3 {
    font-size: var(--text-2xl);
  }
  
  .mystery-tagline {
    font-size: var(--text-base);
  }
  
  .mystery-cta {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
  }
  
  .mystery-cta svg {
    width: 22px;
    height: 22px;
  }
}

/* ======================================== 
   TOUCH & SWIPE STYLES
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  .carousel-track {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .carousel-card {
    scroll-snap-align: start;
  }
  
  /* Remove hover effects on touch devices */
  .carousel-card.active .card-background img {
    transform: scale(1);
  }
  
  .mystery-cta:active {
    background: var(--color-accent);
    color: var(--color-primary-darker);
  }
}

/* ======================================== 
   PERFORMANCE OPTIMIZATIONS
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .carousel-track,
  .card-background img,
  .card-overlay,
  .card-content,
  .carousel-nav,
  .indicator::after {
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card-overlay {
    opacity: 0.95;
  }
  
  .mystery-category {
    background: var(--color-accent);
    color: var(--color-primary-darker);
    border-color: var(--color-accent);
  }
}

/* ======================================== 
   LOADING STATES
   ======================================== */
.carousel-card[data-loading="true"] .card-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ======================================== 
   PRINT STYLES
   ======================================== */
@media print {
  .mystery-carousel {
    display: none;
  }
}