/**
 * CHWEB Eyecatcher Styles
 * Optimierte CSS-Datei für bessere Performance
 */

/* Basis Eyecatcher Styles */
.eyecatcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--eyecatcher-bg-color, #0066cc);
  color: inherit;
  z-index: 1;
  will-change: transform;
  margin: 2rem 0;
}

/* Fullwidth Eyecatcher - 100% Bildschirmbreite */
.eyecatcher.eyecatcher-fullwidth {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: none;
  border-radius: 0;
}

/* Fallback für Container-Einschränkungen */
.container .eyecatcher.eyecatcher-fullwidth,
.max-w-4xl .eyecatcher.eyecatcher-fullwidth,
.prose .eyecatcher.eyecatcher-fullwidth {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: none;
}

/* Image Overlay Eyecatcher */
.eyecatcher.eyecatcher-with-image {
  background: transparent;
}

/* Höhen-Varianten */
.eyecatcher-small { min-height: 200px; }
.eyecatcher-medium { min-height: 300px; }
.eyecatcher-large { min-height: 400px; }
.eyecatcher-fullscreen { 
  min-height: 100vh; 
  height: 100vh;
  margin: 0;
}

/* Fullscreen + Fullwidth Kombination */
.eyecatcher.eyecatcher-fullscreen.eyecatcher-fullwidth {
  margin: 0;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Hintergrund-Container */
.eyecatcher-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  will-change: transform;
}

/* Hintergrundbild */
.eyecatcher .eyecatcher-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--eyecatcher-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Fallback für direkte Inline-Styles */
.eyecatcher .eyecatcher-image[style*="background-image"] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay für bessere Lesbarkeit */
.eyecatcher .eyecatcher-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--eyecatcher-overlay);
  z-index: 2;
}

/* Animationsebene */
.eyecatcher .eyecatcher-animation-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  opacity: 0.7;
}

/* Animation Container - oberhalb des Hintergrundbildes */
.eyecatcher .eyecatcher-animation-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  pointer-events: none; /* Klicks durchlassen */
  opacity: 0.6;
}

/* Spezifische Animationsstile */
.eyecatcher-animation-particles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.7), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: particleFloat 20s linear infinite;
}

.eyecatcher-animation-gradient {
  background: linear-gradient(45deg, 
    rgba(255,255,255,0.1) 0%, 
    rgba(255,255,255,0.3) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.3) 75%, 
    rgba(255,255,255,0.1) 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

.eyecatcher-animation-pulse {
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  animation: pulseEffect 3s ease-in-out infinite;
}

.eyecatcher-animation-wave::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.3) 50%, 
    transparent 100%);
  animation: waveMove 4s ease-in-out infinite;
}

/* Performance-optimierte Animationen */
.gradient-animation,
.pulse-animation,
.wave-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  will-change: transform, opacity;
}

/* Gradient Animation */
.eyecatcher-gradient .gradient-animation {
  background: linear-gradient(
    45deg,
    var(--eyecatcher-bg-color),
    color-mix(in srgb, var(--eyecatcher-bg-color) 80%, white),
    var(--eyecatcher-bg-color),
    color-mix(in srgb, var(--eyecatcher-bg-color) 60%, black)
  );
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pulse Animation */
.eyecatcher-pulse .pulse-animation {
  background: var(--eyecatcher-bg-color);
  animation: pulseEffect 3s ease-in-out infinite;
}

@keyframes pulseEffect {
  0%, 100% { 
    opacity: 1; 
    transform: scale3d(1, 1, 1); 
  }
  50% { 
    opacity: 0.8; 
    transform: scale3d(1.02, 1.02, 1); 
  }
}

/* Wave Animation */
.eyecatcher-wave .wave-animation {
  background: var(--eyecatcher-bg-color);
}

.wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--eyecatcher-bg-color) 70%, white),
    transparent
  );
  animation: waveMove 4s linear infinite;
  will-change: transform;
}

.wave2 { animation-delay: -1.3s; }
.wave3 { animation-delay: -2.6s; }

@keyframes waveMove {
  0% { transform: translate3d(-100%, 0, 0); }
  100% { transform: translate3d(100%, 0, 0); }
}

/* Neue Keyframe-Animationen für Animation-Container */
@keyframes particleFloat {
  0% { transform: translateY(0px) translateX(0px); }
  25% { transform: translateY(-10px) translateX(5px); }
  50% { transform: translateY(-20px) translateX(-5px); }
  75% { transform: translateY(-10px) translateX(3px); }
  100% { transform: translateY(0px) translateX(0px); }
}

@keyframes pulseEffect {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0.6; }
}

/* Content Styling */
.eyecatcher-content {
  position: relative;
  z-index: 10;
  width: 100%;
  text-align: center;
  padding: 2rem 1rem;
}

/* Fullwidth Content Container */
.eyecatcher.eyecatcher-fullwidth .eyecatcher-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.eyecatcher-inner {
  max-width: 800px;
  margin: 0 auto;
}

.eyecatcher-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 
    0 2px 4px rgba(0,0,0,0.8),
    0 4px 8px rgba(0,0,0,0.6),
    0 8px 16px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease-out;
}

.eyecatcher-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 400;
  margin-bottom: 1.5rem;
  opacity: 0.95;
  text-shadow: 
    0 1px 3px rgba(0,0,0,0.7),
    0 2px 6px rgba(0,0,0,0.5);
  animation: fadeInUp 1s ease-out 0.2s both;
}

.eyecatcher-description {
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
  text-shadow: 
    0 1px 2px rgba(0,0,0,0.6),
    0 2px 4px rgba(0,0,0,0.4);
  animation: fadeInUp 1s ease-out 0.4s both;
}

.eyecatcher-cta {
  animation: fadeInUp 1s ease-out 0.6s both;
}

/* Alternative: Text mit Hintergrund für bessere Lesbarkeit */
.eyecatcher-content.with-background {
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  border-radius: 15px;
  padding: 3rem 2rem;
  margin: 2rem;
}

.eyecatcher-content.with-background .eyecatcher-title,
.eyecatcher-content.with-background .eyecatcher-subtitle,
.eyecatcher-content.with-background .eyecatcher-description {
  text-shadow: 
    0 1px 2px rgba(0,0,0,0.5);
}

/* Textfarb-Klassen */
.eyecatcher.text-color-white .eyecatcher-title,
.eyecatcher.text-color-white .eyecatcher-subtitle,
.eyecatcher.text-color-white .eyecatcher-description {
  color: #ffffff !important;
}

.eyecatcher.text-color-black .eyecatcher-title,
.eyecatcher.text-color-black .eyecatcher-subtitle,
.eyecatcher.text-color-black .eyecatcher-description {
  color: #000000 !important;
}

.eyecatcher.text-color-auto .eyecatcher-title,
.eyecatcher.text-color-auto .eyecatcher-subtitle,
.eyecatcher.text-color-auto .eyecatcher-description {
  color: #ffffff !important;
}

/* Verstärkter Schatten für sehr helle Hintergründe */
.eyecatcher.bright-background .eyecatcher-title {
  text-shadow: 
    0 2px 4px rgba(0,0,0,0.9),
    0 4px 8px rgba(0,0,0,0.7),
    0 8px 16px rgba(0,0,0,0.5),
    0 0 20px rgba(0,0,0,0.8);
}

.eyecatcher.bright-background .eyecatcher-subtitle {
  text-shadow: 
    0 1px 3px rgba(0,0,0,0.8),
    0 2px 6px rgba(0,0,0,0.6),
    0 0 15px rgba(0,0,0,0.7);
}

.eyecatcher.bright-background .eyecatcher-description {
  text-shadow: 
    0 1px 2px rgba(0,0,0,0.7),
    0 2px 4px rgba(0,0,0,0.5),
    0 0 10px rgba(0,0,0,0.6);
}

/* CTA Button */
.eyecatcher-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.eyecatcher-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.eyecatcher-button:hover::before {
  left: 100%;
}

.eyecatcher-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.eyecatcher-button:active {
  transform: translateY(0) scale(1);
}

.button-icon {
  transition: transform 0.3s ease;
}

.eyecatcher-button:hover .button-icon {
  transform: translateX(5px);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  cursor: pointer;
  z-index: 3;
}

.scroll-arrow {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.scroll-indicator:hover .scroll-arrow {
  opacity: 1;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { 
    transform: translateX(-50%) translateY(0); 
  }
  40% { 
    transform: translateX(-50%) translateY(-10px); 
  }
  60% { 
    transform: translateX(-50%) translateY(-5px); 
  }
}

/* Fade In Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Textfarben */
.text-white { color: white; }
.text-black { color: #333; }
.text-auto { 
  color: color-mix(in srgb, var(--eyecatcher-bg-color) 20%, white);
}

/* Responsive Design */
@media (max-width: 768px) {
  .eyecatcher-content {
    padding: 1.5rem 1rem;
  }
  
  .eyecatcher-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .eyecatcher-fullscreen {
    min-height: 70vh;
    height: 70vh;
  }
  
  /* Fullwidth Mobile Anpassungen */
  .eyecatcher.eyecatcher-fullwidth .eyecatcher-content {
    padding: 2rem 1rem;
  }

  .eyecatcher.eyecatcher-fullwidth .eyecatcher-title {
    font-size: 1.6rem;
  }
  
  .scroll-indicator {
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .eyecatcher-content {
    padding: 1rem 0.5rem;
  }
  
  .eyecatcher-inner {
    max-width: 100%;
    padding: 0 1rem;
  }
}

/* Dark Mode Anpassungen */
@media (prefers-color-scheme: dark) {
  .text-auto {
    color: color-mix(in srgb, var(--eyecatcher-bg-color) 30%, white);
  }
  
  .eyecatcher-button {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
  }
  
  .eyecatcher-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .eyecatcher-button {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border-color: #fff;
  }
  
  .eyecatcher-title,
  .eyecatcher-subtitle,
  .eyecatcher-description {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .eyecatcher *,
  .eyecatcher *::before,
  .eyecatcher *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-indicator {
    animation: none;
  }
}

/* Parallax-Effekt für Hintergrundbilder */
@media (prefers-reduced-motion: no-preference) {
  .eyecatcher.eyecatcher-with-image .eyecatcher-image {
    background-attachment: fixed;
  }
}

/* Fallback für mobile Geräte ohne Parallax-Support */
@media (max-width: 768px) {
  .eyecatcher.eyecatcher-with-image .eyecatcher-image {
    background-attachment: scroll;
  }
}

/* Print Styles */
@media print {
  .eyecatcher {
    background: white !important;
    color: black !important;
    min-height: auto !important;
    height: auto !important;
    page-break-inside: avoid;
  }
  
  .eyecatcher-background,
  .scroll-indicator {
    display: none !important;
  }
  
  .eyecatcher-button {
    background: transparent !important;
    border: 2px solid black !important;
    color: black !important;
  }
}