/* 
  Bootstrap Carousel Custom Styles
*/

.intro {
  padding-top: 0; /* Will be adjusted for mobile */
}

#main-slider .item {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  height: 55vh; /* Further reduced from 65vh */
  min-height: 350px; /* Further reduced from 400px */
  width: 100%;
  /* Fix for iOS Safari viewport issues */
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
}

#main-slider .carousel-caption {
  top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  bottom: auto;
  text-align: center;
  max-width: 90%;
  margin: 0 auto;
  left: 0;
  right: 0;
  /* Prevent text selection issues on mobile */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#main-slider .carousel-caption h1 {
  font-size: 2.5em;
  font-weight: bold;
  /* Improve text rendering on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#main-slider .carousel-caption p {
  font-size: 1.3em;
  margin-bottom: 22px;
  /* Improve text rendering on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#main-slider .slider-btn {
  display: inline-block;
  background: #313b90;
  color: #fff;
  padding: 12px 32px;
  border-radius: 8px;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  font-size: 1.1em;
  text-decoration: none;
  transition: background 0.2s;
  -webkit-transition: background 0.2s;
  -moz-transition: background 0.2s;
  -o-transition: background 0.2s;
  /* Improve touch targets for mobile */
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-touch-callout: none;
  cursor: pointer;
}

#main-slider .slider-btn:hover,
#main-slider .slider-btn:focus,
#main-slider .slider-btn:active {
  background: #e53935;
  color: #fff;
  outline: none;
}

#main-slider .carousel-control {
  width: 48px;
  height: 48px;
  top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  opacity: 1;
  text-shadow: none;
  /* Improve touch targets */
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-touch-callout: none;
}
#main-slider .carousel-control.left { left: 24px; }
#main-slider .carousel-control.right { right: 24px; }

#main-slider .carousel-control .fa {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    font-size: 24px;
    color: #313b90;
}

#main-slider .carousel-indicators {
  bottom: 20px;
}

#main-slider .carousel-indicators li {
  background-color: #313b90;
  width: 12px;
  height: 12px;
  margin: 0 4px;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border: none;
  /* Improve touch targets */
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

#main-slider .carousel-indicators .active {
  background-color: #e53935;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .intro {
    padding-top: 100px; /* Increased padding to account for larger navbar at this breakpoint */
  }
  
  #main-slider .item { 
    min-height: 320px; 
    height: 50vh; 
  }
}

/* Specific fix for 1200px width where navbar height increases */
@media (max-width: 1199px) and (min-width: 1001px) {
  .intro {
    padding-top: 120px; /* Further increased padding at this specific breakpoint */
  }
}

/* Adjust for new hamburger menu breakpoint */
@media (max-width: 1000px) {
  .intro {
    padding-top: 90px; /* Adjusted padding for hamburger menu */
  }
  
  #main-slider .item { 
    min-height: 280px; 
    height: 45vh; 
  }
  
  #main-slider .carousel-caption h1 { 
    font-size: 2em; 
  }
  
  #main-slider .carousel-caption p { 
    font-size: 1.1em; 
  }
}

/* Specific fix for 770px width */
@media (max-width: 770px) {
  .intro {
    padding-top: 110px; /* Increased padding for this specific breakpoint */
  }
}

@media (max-width: 767px) {
  .intro {
    padding-top: 80px; /* Adjust padding for smaller screens */
  }
  
  #main-slider .item { 
    height: 50vh;
    /* Fix for mobile Safari viewport height issues */
    min-height: 400px;
  }
  
  #main-slider .slider-btn {
    padding: 8px 20px;
    font-size: 0.9em;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    /* Improve touch targets */
    min-height: 44px;
    line-height: 1.4;
  }
  
  #main-slider .carousel-caption {
    width: 90%;
    max-width: 400px;
    padding: 15px;
    left: 5%;
    right: 5%;
  }
}

@media (max-width: 600px) {
  .intro {
    padding-top: 680px; /* Adjust padding for mobile */
  }
  
  #main-slider .item { 
    height: 80vh;
    /* Fallback for older mobile browsers */
    min-height: 480px;
  }
  
  #main-slider .carousel-caption h1 { 
    font-size: 1.5em;
    line-height: 1.2;
    margin-bottom: 15px;
  }
  
  #main-slider .carousel-caption p { 
    font-size: 1em;
    line-height: 1.4;
  }
  
  #main-slider .carousel-control { 
    width: 36px; 
    height: 36px;
    /* Ensure minimum touch target size */
    min-width: 44px;
    min-height: 44px;
  }
  
  #main-slider .carousel-control.left { 
    left: 10px; 
  }
  
  #main-slider .carousel-control.right { 
    right: 10px; 
  }
}

@media (max-width: 300px) {
  .intro {
    padding-top: 680px; /* Adjust padding for mobile */
  }
  
  #main-slider .item { 
    height: 80vh;
    min-height: 320px;
  }
  
  #main-slider .carousel-caption h1 { 
    font-size: 1.5em; 
  }
  
  #main-slider .carousel-caption p { 
    font-size: 1em; 
  }
  
  #main-slider .carousel-control { 
    width: 36px; 
    height: 36px;
    min-width: 44px;
    min-height: 44px;
  }
  
  #main-slider .carousel-control.left { 
    left: 10px; 
  }
  
  #main-slider .carousel-control.right { 
    right: 10px; 
  }
}

@media (max-width: 480px) {
  #main-slider .slider-btn {
    padding: 6px 16px;
    font-size: 0.8em;
    min-height: 44px;
    line-height: 1.5;
  }
}

/* מסך סופר-רחב */
@media (min-width: 1400px) {
  #main-slider .slide-content {
    max-width: 700px;
    padding: 48px 40px;
  }
  #main-slider .slide-item {
    min-height: 440px;
  }
}

/* Make the slider take full width and height */
#intro,
.slider-bg {
  width: 100vw;
  min-height: 480px;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
  /* Fix for mobile Safari */
  -webkit-overflow-scrolling: touch;
}

/* Add these styles to improve responsiveness */
#main-slider {
  width: 100%;
  position: relative;
  /* Prevent scrolling issues on mobile */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
}

/* Fix for iOS Safari viewport units */
@supports (-webkit-touch-callout: none) {
  #main-slider .item {
    height: 55vh;
    /* Fallback for iOS Safari */
    min-height: calc(100vh * 0.55);
  }
  
  @media (max-width: 767px) {
    #main-slider .item {
      height: 50vh;
      min-height: calc(100vh * 0.50);
    }
  }
  
  @media (max-width: 600px) {
    #main-slider .item {
      height: 70vh;
      min-height: calc(100vh * 0.70);
    }
  }
}

/* Additional mobile browser compatibility */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
  #main-slider .carousel-control .fa {
    /* Improve icon rendering on retina displays */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
