/**
 * File: /css/hero-carousel.css
 * Purpose: Hero-Karussell-System für alle Seiten
 * 
 * Features:
 * - Bootstrap Carousel Integration
 * - Fade & Slide Transitions
 * - Custom Overlays per Slide
 * - Responsive Text & Buttons
 * - Auto-Height basierend auf JSON
 * 
 * Dependencies: Bootstrap 5
 * Created: 2025
 * Author: TC Hugsweier
 * Version: 1.0
 */

:root {
  --hero-transition-speed: 1s;
  --hero-overlay-opacity: 0.6;
}

/* Hero Carousel Container */
.hero-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.hero-carousel .carousel {
  margin-bottom: 0;
}

/* Carousel Items */
.hero-carousel .carousel-item {
  position: relative;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay per Slide (aus JSON) */
.hero-carousel .carousel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--slide-overlay, rgba(0, 0, 0, 0.5));
  z-index: 1;
}

/* Pattern Overlay */
.hero-carousel .carousel-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
  opacity: 0.3;
  z-index: 2;
}

/* Carousel Content */
.hero-carousel .carousel-caption {
  position: relative;
  z-index: 3;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  padding: 3rem 1rem;
}

/* Titles */
.hero-carousel .hero-title {
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

.hero-carousel .hero-subtitle {
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Buttons Container */
.hero-carousel .hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-carousel .hero-btn {
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-carousel .hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hero-carousel .hero-btn i {
  font-size: 1.1rem;
}

/* Button Styles */
.hero-carousel .hero-btn.btn-primary {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border-color: #007bff;
}

.hero-carousel .hero-btn.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border-color: #28a745;
}

.hero-carousel .hero-btn.btn-warning {
  background: linear-gradient(135deg, #ffc107, #ffca2c);
  color: #212529;
  border-color: #ffc107;
}

.hero-carousel .hero-btn.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border-color: #dc3545;
}

.hero-carousel .hero-btn.btn-outline-light {
  background: transparent;
  color: white;
  border-color: white;
}

.hero-carousel .hero-btn.btn-outline-light:hover {
  background: white;
  color: #212529;
}

/* Carousel Controls */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  width: 60px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
  opacity: 1;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 10px;
  backdrop-filter: blur(10px);
}

/* Carousel Indicators */
.hero-carousel .carousel-indicators {
  margin-bottom: 1.5rem;
  z-index: 4;
}

.hero-carousel .carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.hero-carousel .carousel-indicators .active {
  background-color: white;
  opacity: 1;
  transform: scale(1.2);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade Transition */
.hero-carousel .carousel.carousel-fade .carousel-item {
  opacity: 0;
  transition: opacity var(--hero-transition-speed) ease-in-out;
}

.hero-carousel .carousel.carousel-fade .carousel-item.active {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 992px) {
  .hero-carousel .carousel-item {
    min-height: 350px;
  }
  
  .hero-carousel .carousel-caption {
    padding: 2rem 1rem;
  }
  
  .hero-carousel .hero-title {
    font-size: 2.5rem !important;
  }
  
  .hero-carousel .hero-subtitle {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 768px) {
  .hero-carousel .carousel-item {
    min-height: 300px;
  }
  
  .hero-carousel .carousel-caption {
    padding: 1.5rem 1rem;
    width: 95%;
  }
  
  .hero-carousel .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-carousel .hero-subtitle {
    font-size: 1.1rem !important;
    margin-bottom: 1.5rem;
  }
  
  .hero-carousel .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero-carousel .hero-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1.5rem;
  }
  
  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next {
    width: 50px;
  }
  
  .hero-carousel .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next-icon {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .hero-carousel .carousel-item {
    min-height: 250px;
  }
  
  .hero-carousel .hero-title {
    font-size: 1.75rem !important;
  }
  
  .hero-carousel .hero-subtitle {
    font-size: 1rem !important;
  }
  
  .hero-carousel .hero-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Loading State */
.hero-carousel.loading .carousel-item {
  background-color: #f8f9fa;
  background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Accessibility */
.hero-carousel .carousel-control-prev:focus,
.hero-carousel .carousel-control-next:focus {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.hero-carousel .hero-btn:focus {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* Print */
@media print {
  .hero-carousel {
    display: none;
  }
}