/* Hero Banner Animations and Styles */

/* Animation Definitions */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-right {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoom-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoom-out {
  from {
    opacity: 0;
    transform: scale(1.05);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Hero Wrapper Base Styles */
.hero-wrapper {
  position: relative;
}

.hero-background {
  z-index: 0;
}

.hero-overlay {
  background: linear-gradient(to bottom, rgba(30, 63, 32, 0.4) 0%, rgba(26, 26, 26, 0.6) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Animated Card Styles */
.hero-card {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Card Style Classes */
.card-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.card-glass:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.card-solid {
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.card-solid:hover {
  background: rgba(26, 26, 26, 0.95);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.card-gradient {
  background: linear-gradient(135deg, rgba(137, 32, 32, 0.8) 0%, rgba(26, 26, 26, 0.9) 100%);
  border: 1px solid rgba(217, 119, 6, 0.3);
  box-shadow: 0 20px 60px rgba(137, 32, 32, 0.3);
}

.card-gradient:hover {
  background: linear-gradient(135deg, rgba(137, 32, 32, 0.95) 0%, rgba(26, 26, 26, 1) 100%);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 25px 70px rgba(137, 32, 32, 0.4);
}

.card-border-only {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.card-border-only:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.card-shadow {
  background: rgba(26, 26, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 20px rgba(217, 119, 6, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-shadow:hover {
  background: rgba(26, 26, 26, 0.8);
  box-shadow: 
    0 0 30px rgba(217, 119, 6, 0.3),
    0 25px 70px rgba(0, 0, 0, 0.5);
}

/* Text Elements Animation Support */
.hero-badge,
.hero-title,
.hero-subtitle,
.hero-description,
.hero-card-text,
.hero-stats,
.hero-ctas,
.hero-review-card {
  /* Fallback for browsers without animation support */
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ensure animations respect their durations */
.hero-card {
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-wrapper {
    min-height: 500px;
  }
  
  .hero-card {
    padding: 2rem !important;
  }
  
  .hero-title {
    font-size: 1.875rem !important;
  }
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hero-card,
  .hero-badge,
  .hero-title,
  .hero-subtitle,
  .hero-description,
  .hero-card-text,
  .hero-stats,
  .hero-ctas,
  .hero-review-card {
    animation: none !important;
    transition: none !important;
  }
}

/* Additional hover effects for buttons */
.hero-ctas a {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-ctas a:hover {
  transform: translateY(-2px);
}

/* Review card special styling */
.hero-review-card {
  transition: all 0.3s ease;
}

.hero-review-card:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ===== CAROUSEL STYLES ===== */

/* Hero Carousel Container */
#hero-carousel {
  position: relative;
  background: #000;
}

/* Hero Slide (Carousel Item) */
.hero-slide {
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
  pointer-events: none;
  z-index: 0;
}

.hero-slide.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* Hero Background - Ensure images load and render */
.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Ensure background loads even when parent is visibility: hidden */
  will-change: auto;
}

.hero-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: subtle-zoom 20s ease infinite;
}

/* Carousel Controls */
#hero-carousel button {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Navigation Dots */
.carousel-dot {
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot:hover {
  transform: scale(1.2);
}

.carousel-dot.active {
  background-color: white;
}

/* Carousel Buttons - Accessible focus states */
#hero-carousel button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* Responsive carousel buttons */
@media (max-width: 768px) {
  #carousel-prev,
  #carousel-next {
    width: 40px;
    height: 40px;
    padding: 6px;
  }

  #carousel-prev svg,
  #carousel-next svg {
    width: 24px;
    height: 24px;
  }
}

/* Background video styling */
.hero-background video {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Smooth background image transitions */
@keyframes subtle-zoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Disable subtle zoom on reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hero-background img {
    animation: none;
  }
}
