/**
 * Hero Slider Widget CSS  
 * Widget-specific styles only - common styles are in bugloos-design-system.css
 * 
 * Dependencies: bugloos-design-system.css must be loaded first
 */

/* ===== HERO SLIDER SECTION ===== */
.bugloos-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HEIGHT VARIATIONS ===== */
/* 2/3 screen height option */
.bugloos-hero--height-2-3 {
  height: 66.67vh;
  min-height: 500px;
}

/* 3/5 screen height option */
.bugloos-hero--height-3-5 {
  height: 60vh;
  min-height: 450px;
}

/* ===== SLIDER CONTAINER ===== */
.bugloos-hero__slider {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ===== SLIDE WRAPPER ===== */
.bugloos-hero__slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ===== INDIVIDUAL SLIDE ===== */
.bugloos-hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bugloos-hero__slide.active {
  opacity: 1;
  z-index: 2;
}

/* ===== SLIDE BACKGROUND ===== */
.bugloos-hero__slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Image background */
.bugloos-hero__slide-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Video background */
.bugloos-hero__slide-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Background overlay */
.bugloos-hero__slide-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* ===== SLIDE CONTENT CONTAINER ===== */
.bugloos-hero__slide-content {
  position: relative;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  text-align: center;
  z-index: 10;
  width: 100%;
}

.bugloos-hero__inner {
  max-width: var(--max-width-prose);
  margin: 0 auto;
}

/* ===== HEADLINE STYLES ===== */
.bugloos-hero__headline {
  font-family: var(--font-family-primary);
  font-size: var(--text-4xl); /* Start at text-4xl like React component */
  font-weight: var(--font-weight-bold);
  color: var(--bugloos-text-white);
  margin: 0 0 var(--spacing-6) 0;
  line-height: var(--leading-tight);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

/* Responsive headline sizing: text-4xl md:text-5xl lg:text-6xl */
@media (min-width: 768px) {
  .bugloos-hero__headline {
    font-size: var(--text-5xl);
  }
}

@media (min-width: 1024px) {
  .bugloos-hero__headline {
    font-size: var(--text-6xl);
  }
}

/* ===== DESCRIPTION STYLES ===== */
.bugloos-hero__description {
  font-family: var(--font-family-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-normal);
  color: var(--bugloos-text-gray);
  margin: 0 0 var(--spacing-8) 0;
  line-height: var(--leading-relaxed);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-8);
}

/* ===== STATS SECTION ===== */
.bugloos-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-8);
  margin: 0 0 var(--spacing-8) 0;
}

.bugloos-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
}

.bugloos-hero__stat-number {
  font-family: var(--font-family-primary);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--bugloos-primary); /* #63C3D1 from CaseStudyHero */
  margin-bottom: var(--spacing-2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.bugloos-hero__stat:nth-child(2) .bugloos-hero__stat-number {
  color: var(--bugloos-secondary); /* #7C6EB0 for middle stat like CaseStudyHero */
}

.bugloos-hero__stat:nth-child(3) .bugloos-hero__stat-number {
  color: var(--bugloos-primary); /* Back to primary for third stat */
}

.bugloos-hero__stat-label {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-normal);
  color: rgba(255, 255, 255, 0.75); /* text-gray-300 equivalent from CaseStudyHero */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 1.4;
}

/* ===== CTA BUTTON GROUP ===== */
.bugloos-hero__cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-4);
  justify-content: center;
}

@media (min-width: 640px) {
  .bugloos-hero__cta-group {
    flex-direction: row;
  }
}

/* ===== CTA BUTTON BASE STYLES ===== */
.bugloos-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-4) var(--spacing-8);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-primary);
  text-decoration: none;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  position: relative;
  cursor: pointer;
  min-width: 180px;
  justify-content: center;
  border: 2px solid transparent;
}

/* ===== PRIMARY CTA STYLES ===== */
.bugloos-hero__cta--primary {
  background: var(--bugloos-secondary);
  color: var(--bugloos-text-white);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.bugloos-hero__cta--primary:hover,
.bugloos-hero__cta--primary:focus {
  background: var(--bugloos-primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.bugloos-hero__cta--primary:active {
  transform: translateY(0) scale(1.02);
}

/* ===== SECONDARY CTA STYLES ===== */
.bugloos-hero__cta--secondary {
  background: transparent;
  color: var(--bugloos-text-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  /* Comprehensive anti-jitter properties */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  will-change: transform;
  transform-origin: center center;
  transform: translateZ(0);
  /* Contain layout shifts */
  contain: layout style paint;
}

.bugloos-hero__cta--secondary span {
  /* Stabilize text rendering */
  will-change: auto;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bugloos-hero__cta--secondary:hover,
.bugloos-hero__cta--secondary:focus {
  border-color: var(--bugloos-primary);
  background: rgba(99, 195, 209, 0.1);
  color: var(--bugloos-text-white);
  transform: translateY(-2px) scale(1.05) translateZ(0);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.bugloos-hero__cta--secondary:active {
  transform: translateY(0);
}

/* ===== ICON STYLES ===== */
.bugloos-hero__icon {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.bugloos-hero__cta--primary:hover .bugloos-hero__icon,
.bugloos-hero__cta--primary:focus .bugloos-hero__icon {
  transform: rotate(15deg) scale(1.1);
}

.bugloos-hero__cta--secondary:hover .bugloos-hero__icon,
.bugloos-hero__cta--secondary:focus .bugloos-hero__icon {
  transform: translateX(4px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .bugloos-hero__description {
    font-size: var(--text-lg);
  }
  
  .bugloos-hero__cta {
    padding: var(--spacing-5) var(--spacing-10);
    font-size: var(--text-lg);
  }
}

@media (max-width: 767px) {
  .bugloos-hero {
    height: 80vh;
    min-height: 500px;
  }
  
  /* Mobile responsive heights for height variations */
  .bugloos-hero--height-2-3 {
    height: 55vh;
    min-height: 400px;
  }
  
  .bugloos-hero--height-3-5 {
    height: 50vh;
    min-height: 380px;
  }
  
  .bugloos-hero__slide-content {
    padding: 0 var(--spacing-4);
  }
  
  .bugloos-hero__headline {
    font-size: var(--text-4xl) !important; /* Ensure responsive sizing works on mobile */
    margin-bottom: var(--spacing-4);
  }
  
  .bugloos-hero__description {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-6);
  }
  
  .bugloos-hero__stats {
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-6);
  }
  
  .bugloos-hero__stat {
    min-width: 100px;
  }
  
  .bugloos-hero__stat-number {
    font-size: var(--text-xl);
  }
  
  .bugloos-hero__stat-label {
    font-size: var(--text-xs);
  }
  
  .bugloos-hero__cta-group {
    gap: var(--spacing-3);
  }
  
  .bugloos-hero__cta {
    padding: var(--spacing-3) var(--spacing-6);
    font-size: var(--text-base);
    gap: var(--spacing-2);
    min-width: 140px;
  }
  
  .bugloos-hero__icon {
    width: 1rem;
    height: 1rem;
  }
}

@media (max-width: 480px) {
  .bugloos-hero__headline {
    font-size: var(--text-3xl) !important; /* Smaller headline for very small screens */
  }
  
  .bugloos-hero__description {
    font-size: var(--text-sm);
  }
  
  .bugloos-hero__stats {
    flex-direction: column;
    gap: var(--spacing-3);
  }
  
  .bugloos-hero__stat {
    min-width: 80px;
  }
  
  .bugloos-hero__stat-number {
    font-size: var(--text-lg);
  }
  
  .bugloos-hero__cta {
    padding: var(--spacing-3) var(--spacing-4);
    font-size: var(--text-sm);
    min-width: 120px;
  }
}

/* ===== SLIDER NAVIGATION ===== */
.bugloos-hero__navigation {
  position: absolute;
  bottom: var(--spacing-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-4);
  z-index: 15;
  align-items: flex-end;
}

/* ===== NAVIGATION ITEM ===== */
.bugloos-hero__nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2);
  cursor: pointer;
  transition: all var(--transition-normal);
}

/* ===== PROGRESS BAR ===== */
.bugloos-hero__progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.bugloos-hero__progress-fill {
  height: 100%;
  background: var(--bugloos-primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width linear;
}

.bugloos-hero__nav-item.active .bugloos-hero__progress-bar {
  background: rgba(255, 255, 255, 0.5);
}

/* ===== NAVIGATION TITLE ===== */
.bugloos-hero__nav-title {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--bugloos-text-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
}

.bugloos-hero__nav-item:hover .bugloos-hero__nav-title,
.bugloos-hero__nav-item.active .bugloos-hero__nav-title {
  opacity: 1;
}

/* ===== ACCESSIBILITY ===== */
/* Focus States for Hero CTA - Using box-shadow instead of outline as requested */
.bugloos-hero__cta--primary:focus {
  box-shadow: 0 0 0 3px rgba(99, 195, 209, 0.4), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  outline: none;
}

.bugloos-hero__cta--secondary:focus {
  box-shadow: 0 0 0 3px rgba(99, 195, 209, 0.4);
  outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .bugloos-hero__headline {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
  
  .bugloos-hero__description {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }
  
  .bugloos-hero__stat-number {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
  
  .bugloos-hero__stat-label {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }
  
  .bugloos-hero__cta--primary {
    border: 3px solid var(--bugloos-text-white);
  }
  
  .bugloos-hero__cta--secondary {
    border: 3px solid var(--bugloos-text-white);
  }
}

/* Reduced Motion - Hero Slider overrides */
@media (prefers-reduced-motion: reduce) {
  .bugloos-hero__slide {
    transition: none;
  }
  
  .bugloos-hero__progress-fill {
    transition: none;
  }
  
  .bugloos-hero__cta,
  .bugloos-hero__icon {
    transition: none;
  }
  
  .bugloos-hero__cta--primary:hover,
  .bugloos-hero__cta--primary:focus,
  .bugloos-hero__cta--secondary:hover,
  .bugloos-hero__cta--secondary:focus {
    transform: none;
  }
  
  .bugloos-hero__cta--primary:hover .bugloos-hero__icon,
  .bugloos-hero__cta--primary:focus .bugloos-hero__icon,
  .bugloos-hero__cta--secondary:hover .bugloos-hero__icon,
  .bugloos-hero__cta--secondary:focus .bugloos-hero__icon {
    transform: none;
  }
}

/* ===== SLIDER CONTROLS (Only for demo pages) ===== */
.slider-controls {
  position: absolute;
  top: var(--spacing-4);
  right: var(--spacing-4);
  z-index: 20;
  display: flex;
  gap: var(--spacing-2);
}

.slider-control-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2);
  color: var(--bugloos-text-white);
  cursor: pointer;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  font-size: var(--text-sm);
}

.slider-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--bugloos-primary);
}

.slider-control-btn.active {
  background: var(--bugloos-primary);
  border-color: var(--bugloos-primary);
}

/* ===== PRINT STYLES ===== */
@media print {
  .bugloos-hero {
    background: var(--bugloos-white) !important;
    color: var(--bugloos-gray-900) !important;
    height: auto !important;
    min-height: auto !important;
  }
  
  .bugloos-hero__slide-bg {
    display: none !important;
  }
  
  .bugloos-hero__navigation {
    display: none !important;
  }
  
  .bugloos-hero__headline,
  .bugloos-hero__description {
    color: var(--bugloos-gray-900) !important;
    text-shadow: none !important;
  }
  
  .bugloos-hero__cta {
    background: var(--bugloos-gray-300) !important;
    color: var(--bugloos-gray-900) !important;
    text-decoration: underline !important;
    box-shadow: none !important;
  }
}

/* ===== DEMO CONTENT STYLES (Only for demo pages) ===== */
.demo-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  color: var(--bugloos-text-white);
  padding: var(--spacing-12) var(--spacing-4);
  min-height: 100vh;
}

.demo-content__inner {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

.demo-content h2 {
  font-family: var(--font-family-primary);
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  color: var(--bugloos-primary);
  margin-bottom: var(--spacing-8);
  text-align: center;
}

.demo-content h3 {
  font-family: var(--font-family-primary);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--bugloos-secondary);
  margin: var(--spacing-8) 0 var(--spacing-6) 0;
}

.demo-content p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--spacing-8);
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== DEMO CONTROLS (Only for demo pages) ===== */
.demo-controls {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: var(--spacing-8);
  margin-top: var(--spacing-12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
  margin-bottom: var(--spacing-6);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.control-group label {
  font-weight: var(--font-weight-semibold);
  color: var(--bugloos-primary);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-group input,
.control-group textarea,
.control-group select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-3);
  color: var(--bugloos-text-white);
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  transition: all var(--transition-normal);
}

.control-group input:focus,
.control-group textarea:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--bugloos-primary);
  box-shadow: 0 0 0 3px rgba(99, 195, 209, 0.2);
}

.control-group textarea {
  resize: vertical;
  min-height: 80px;
}

.control-group input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 4px;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.demo-controls button {
  background: var(--bugloos-secondary);
  color: var(--bugloos-text-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-3) var(--spacing-6);
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-right: var(--spacing-4);
  margin-bottom: var(--spacing-4);
}

.demo-controls button:hover {
  background: var(--bugloos-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.demo-controls button:active {
  transform: translateY(0);
}

/* ===== RESPONSIVE NAVIGATION ===== */
@media (max-width: 768px) {
  .bugloos-hero__navigation {
    bottom: var(--spacing-6);
    gap: var(--spacing-3);
  }
  
  .bugloos-hero__progress-bar {
    width: 50px;
    height: 3px;
  }
  
  .bugloos-hero__nav-title {
    font-size: var(--text-xs);
  }
  
  .slider-controls {
    top: var(--spacing-2);
    right: var(--spacing-2);
  }
  
  .slider-control-btn {
    padding: var(--spacing-1);
    font-size: var(--text-xs);
  }
}

@media (max-width: 480px) {
  .bugloos-hero__navigation {
    bottom: var(--spacing-4);
    gap: var(--spacing-2);
  }
  
  .bugloos-hero__progress-bar {
    width: 40px;
  }
}

/* Responsive Demo Controls */
@media (max-width: 768px) {
  .demo-controls {
    padding: var(--spacing-6);
  }
  
  .control-group {
    margin-bottom: var(--spacing-4);
  }
  
  .demo-controls button {
    width: 100%;
    margin-right: 0;
  }
}
}