/**
 * Comhit Modern Hero Slider CSS
 * Advanced infinite vertical slider with rotation and gradient overlay (v1.0.0)
 */

/* CSS Variables for dynamic customization */
.comhit-hero-slider {
  --hero-height: 100vh;
  --slider-speed: 20s;
  --slider-rotation: 20deg;
  --primary-text: #ffffff;
  --secondary-text: #e2e8f0;
  --button-bg: #4f46e5;
  --button-hover: #3730a3;
  --button-text: #ffffff;
  --gradient-start: rgba(0, 0, 77, 0.8);
  --gradient-end: rgba(0, 0, 77, 0.3);
}

/* Main hero container */
.comhit-hero-slider {
  position: relative;
  height: var(--hero-height);
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: #00004d;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  z-index: 2;
}

/* Hero content (left side) */
.hero-content {
  position: relative;
  z-index: 10;
  width: 60%;
  padding: 0 3% 0 5%;
  display: flex;
  align-items: center;
  min-height: 100%;
  overflow: visible;
}

.hero-content-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-text);
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
  color: var(--secondary-text);
  margin: 0 0 2.5rem 0;
  font-weight: 400;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 15;
}

.hero-subtitle-container {
  max-width: 100%;
  margin: 0 0 2.5rem 0;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 2rem;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.hero-button:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
  color: var(--button-text);
  text-decoration: none;
}

.hero-button::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.hero-button:hover::after {
  transform: translateX(4px);
}

/* Hero slider container (right side and background) */
.hero-slider-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

/* Slider track with JavaScript-driven infinite scrolling */
.hero-slider-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 16px;
  padding: 16px 0;
  position: absolute;
  top: -30%;
  right: 15%;
  transform-origin: right center;
  /* Ensure smooth infinite loop */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Prevent any potential jump */
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  /* Set initial rotation to prevent flash */
  transform: rotate(20deg) translate3d(0, 0, 0);
  will-change: transform;
}

/* Individual slide */
.hero-slide {
  flex: 0 0 auto;
  width: 500px;
  height: 281px; /* 16:9 aspect ratio (500 * 0.5625) */
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.hero-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
  will-change: transform;
  border-radius: 8px;
  display: block;
}

/* Gradient overlay for text readability */
.hero-gradient-overlay {
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: linear-gradient(
    to left,
    transparent 0%,
    rgba(0, 0, 77, 0.1) 15%,
    rgba(0, 0, 77, 0.3) 30%,
    rgba(0, 0, 77, 0.6) 50%,
    rgba(0, 0, 77, 0.85) 70%,
    rgba(0, 0, 77, 0.98) 85%,
    #00004d 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* Ensure subtitle is always visible */
.hero-subtitle {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Error notice styling */
.comhit-hero-slider-notice {
  padding: 2rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  text-align: center;
  font-size: 1.1rem;
}

/* Responsive Design */

/* Extra large screens (1600px and above) */
@media (min-width: 1600px) {
  .hero-title {
    font-size: clamp(3rem, 3.5vw, 4.5rem);
  }
  
  .hero-slider-track {
    top: -30%;
    right: 5%;
  }
  
  .hero-content {
    width: 55%;
  }
  
  .hero-subtitle-container {
    max-width: 65%;
  }
}

/* Large screens (1200px - 1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .hero-content {
    width: 60%;
    padding: 0 3% 0 4%;
  }
  
  .hero-slider-track {
    top: -30%;
    right: 30%;
  }
  
  .hero-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.3rem);
  }
  
  .hero-subtitle-container {
    max-width: 85%;
  }
}

/* Medium screens (969px - 1199px) */
@media (min-width: 969px) and (max-width: 1199px) {
  .hero-content {
    width: 80%;
    padding: 0 3% 0 4%;
  }
  
  .hero-slider-track {
    top: -30%;
    left: -80%;
  }
  
  .hero-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.3rem);
  }
  
  .hero-subtitle-container {
    max-width: 90%;
  }
}

/* Tablets */
@media (min-width: 641px) and (max-width: 968px) {
  .comhit-hero-slider {
    flex-direction: column;
    --hero-height: auto;
    min-height: 50vh;
    position: relative;
  }
  
  .hero-content {
    width: 100%;
    height: 100%;
    order: 2;
    padding: 3rem 6%;
    min-height: auto;
    text-align: center;
    position: relative;
    z-index: 20;
  }
  
  .hero-content-inner {
    max-width: 100%;
  }
  
  .hero-title {
    white-space: normal;
    text-overflow: unset;
  }
  
  .hero-slider-container {
    position: absolute;
    order: 1;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
  }
  
  .hero-slider-track {
    top: 0;
    left: -25%;
    right: auto;
    transform: rotate(10deg) translate3d(0, 0, 0);
    transform-origin: right center;
    origin: center center;
  }
  
  .hero-slide {
    width: 400px;
    height: 225px;
  }
  
  /* Enhanced gradient overlay for mobile */
  .hero-gradient-overlay {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 77, 0.8) 0%,
      rgba(0, 0, 77, 0.6) 30%,
      rgba(0, 0, 77, 0.4) 50%,
      rgba(0, 0, 77, 0.6) 70%,
      rgba(0, 0, 77, 0.8) 100%
    );
  }
}

/* Mobile devices */
@media (max-width: 640px) {
  .hero-content {
    padding: 15% 3% 10% 3%;
    z-index: 20;
    width: 100%;
    text-align: center;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
    margin-bottom: 1rem;
    white-space: normal;
    text-overflow: unset;
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    margin-bottom: 2rem;
  }
  
  .hero-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .hero-slide {
    width: 300px;
    height: 169px;
  }
  
  /* Even stronger gradient overlay for mobile */
  .hero-gradient-overlay {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 77, 0.9) 0%,
      rgba(0, 0, 77, 0.7) 25%,
      rgba(0, 0, 77, 0.5) 50%,
      rgba(0, 0, 77, 0.7) 75%,
      rgba(0, 0, 77, 0.9) 100%
    );
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .hero-content {
    padding: 13% 3% 5% 3%;
  }

        .comhit-hero-slider {
          flex-direction: column;
          max-height: 85vh!important;
          position: relative;
        }

  .hero-slider-track {
    top: 0;
    left: -45%;
    right: auto;
    transform: rotate(10deg) translate3d(0, 0, 0);
    transform-origin: right center;
    origin: center center;
  }
  .hero-title {
    font-size: clamp(1.3rem, 6vw, 2rem);
  }
  
  .hero-subtitle {
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  }
}

/* Performance optimizations */
.hero-slide img {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .hero-slider-track {
    animation-duration: 60s; /* Slower animation for users who prefer reduced motion */
        top: 0;
          left: -25%;
          right: auto;
          transform: rotate(10deg) translate3d(0, 0, 0);
          transform-origin: right center;
          origin: center center;
  }
  
  .hero-button {
    transition: none;
  }
  
  .hero-slide img {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-title {
    color: #000000;
    text-shadow: none;
  }
  
  .hero-subtitle {
    color: #333333;
  }
  
  .hero-button {
    border: 2px solid currentColor;
  }
}

/* Print styles */
@media print {
  .comhit-hero-slider {
    height: auto;
    min-height: 300px;
  }
  
  .hero-slider-container {
    display: none;
  }
  
  .hero-content {
    width: 100%;
    position: static;
  }
}