/* Wraps the animation wrapper, slider, and buttons */
#interactiveSliderBox,
#interactiveSliderBox2 {
  border: 1.5px solid #e0e0e0; /* Thin gray border */
  border-radius: 10px; /* Rounded corners */
}

/* Wraps the animation, overlay layers, and associated buttons */
#animationWrapper,
#animationWrapper2 {
  position: relative;
  width: auto;
  height: auto;
  margin: auto;
  z-index: 2;
  overflow: hidden;
}

/* Contains the animation only */
#animationContainer,
#animationContainer2 {
  width: 100%;
  height: auto;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
  z-index: 3;
}

/* Container for the slider */
.sliderContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 8px 0px;
}

/* Slider */
.slider {
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 10px;
  background: #e7e7e7; /* Revert to simple background */
  outline: none;
  transition: opacity 0.2s;
  /* REMOVE any background-image, background-size properties if present from previous attempts */
}

/* Slider thumb */
.slider::-webkit-slider-thumb {
  appearance: none;
  width: 25px; /* Keep this value consistent with JS thumbWidth1 */
  height: 25px;
  border-radius: 50%;
  background: #6e6eff;
  cursor: pointer;
  z-index: 2; /* Ensure thumb is above the track */
  position: relative; /* Needed for z-index on pseudo-elements/track */
}

.slider::-moz-range-thumb {
  width: 25px; /* Keep this value consistent with JS thumbWidth1 */
  height: 25px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  z-index: 2;
  position: relative;
}

/* Slider container */
.slider-wrapper {
  position: relative; /* CRITICAL: This is the parent for absolutely positioned #tickmarks */
  width: 90%;
  margin: 0 auto;
  /* No padding-bottom here, #tickmarks will position itself outside */
}

/* Tick marks container */
#tickmarks,
#tickmarks2 {
  position: absolute; /* Positioned relative to .slider-wrapper */
  width: 100%; /* Span the width of the .slider-wrapper */
  pointer-events: none; /* Do not block clicks on slider */
  /* Positioning outside the slider: */
  top: calc(100% -5px); /* Place 5px below the bottom of the slider element */
  left: 0; /* Align with the left edge of the slider-wrapper */
  height: 10px; /* Give it a height to contain the tick marks */
  /* REMOVE display: flex; justify-content: space-between; here */
}

/* Individual Tick marks */
.tick {
  position: absolute; /* Each tick is positioned absolutely within #tickmarks */
  top: 0; /* Align to the top of the #tickmarks container */
  width: 2px; /* Thickness of the tick mark */
  height: 15px; /* Height of the tick mark */
  background: #a3a3a3; /* Color of the tick mark */
  transform: translateX(
    -50%
  ); /* CRITICAL: Centers the 2px tick on its calculated 'left' position */
}

/* ... (rest of your existing CSS) ... */

/* Slider container */
.slider-wrapper {
  position: relative;
  width: 90%; /* Make the slider 90% of the container width */
  margin: 0 auto; /* Center the slider */
}

/* Media queries for responsiveness on smaller screens */
@media (max-width: 768px) {
  #animationContainer,
  #animationContainer2 {
    max-width: 90%; /* Increase width for smaller screens */
    max-height: 300px; /* Reduce height on smaller screens */
  }

  .slider-wrapper {
    width: 90%; /* Make the slider more flexible on small screens */
  }
}

@media (max-width: 480px) {
  #animationContainer,
  #animationContainer2 {
    max-width: 95%; /* Make it almost full width on small mobile screens */
    max-height: 250px; /* Further reduce height */
  }

  .slider-wrapper {
    width: 95%; /* Make slider wider on mobile */
  }
}

#skinOverlay,
#skinOverlay2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* Start hidden */
  pointer-events: none;
  z-index: 1;
  opacity: 0.1; /* 👈 lower value = more transparent */
}

#boneBehind,
#boneBehind2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Under animation but above skin */
  opacity: 1;
}

#boneFront,
#boneFront2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4; /* Top overlay */
  opacity: 0.5;
}

#toggleSkinOverlayBtn,
#toggleBoneOverlayBtn,
#toggleSkinOverlayBtn2,
#toggleBoneOverlayBtn2 {
  position: absolute;
  right: 24px;
  z-index: 5;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #e0e0e0;
  padding: 8px 12px;
  cursor: pointer;
  font-family: Geist, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  border-radius: 10px;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease; /* Smooth transition for hover effect */
}

#toggleBoneOverlayBtn,
#toggleBoneOverlayBtn2 {
  bottom: 65px;
}

#toggleSkinOverlayBtn,
#toggleSkinOverlayBtn2 {
  bottom: 10px;
}

/* Hover state */
#toggleSkinOverlayBtn:hover,
#toggleBoneOverlayBtn:hover,
#toggleSkinOverlayBtn.active:hover,
#toggleBoneOverlayBtn.active:hover,
#toggleSkinOverlayBtn2:hover,
#toggleBoneOverlayBtn2:hover,
#toggleSkinOverlayBtn2.active:hover,
#toggleBoneOverlayBtn2.active:hover {
  background-color: #fffdec; /* Change to a green background */
  color: #404040; /* Change text color to white */
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Active state for buttons */
#toggleSkinOverlayBtn.active,
#toggleBoneOverlayBtn.active,
#toggleSkinOverlayBtn2.active,
#toggleBoneOverlayBtn2.active {
  background-color: #fffbd3; /* Green for active state */
  color: #404040;
  font-weight: normal; /* Ensure text is not bold in active state */
}

/* Inactive state (default) */
#toggleSkinOverlayBtn,
#toggleBoneOverlayBtn,
#toggleSkinOverlayBtn2,
#toggleBoneOverlayBtn2 {
  background-color: #ffffff; /* White background */
  color: rgb(124, 124, 124);
  font-weight: normal; /* Ensure text is not bold in active state */
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Optional: Subtle shadow for a modern look */
  transition: 0.3s ease;
}

/* Detail Text and Download Button Section */
.interactive-slider-description-box {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Pushes text to left, button to right */
  margin-top: 20px; /* Space above this section */
  padding: 20px;
  border: none;
  border-radius: 10px; /* Rounded corners */
  background-color: #f9f9f9; /* Slightly off-white background */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 20px; /* Gap between text and button on wrap */
}

.interactive-slider-description-box p {
  flex: 1; /* Allows paragraph to take available space */
  font-size: 0.9em; /* Adjust as needed */
  color: #404040;
  margin: 0; /* Remove default paragraph margin */
  margin-bottom: 10px; /* Add margin to paragraphs within this box */
}
.interactive-slider-description-box p:last-of-type {
  margin-bottom: 0; /* No bottom margin on the last paragraph */
}

.interactive-slider-download-button {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  border: 1px solid #6e6eff; /* Purple border */
  border-radius: 30px; /* Rounded corners */
  background-color: #ffffff; /* White background */
  color: #6e6eff; /* Purple text */
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
  white-space: nowrap; /* Prevent button text from wrapping */
}

.interactive-slider-download-button:hover {
  background-color: #edf0ff; /* Purple background on hover */
  color: #6e6eff; /* White text on hover */
  border-color: #5a5aff; /* Keep purple border on hover */
}

/* Responsive adjustments for interactive animation section */
@media (max-width: 768px) {
  .interactive-slider-description-box {
    flex-direction: column; /* Stack text and button vertically */
    align-items: flex-start; /* Align items to the left */
  }
  .interactive-slider-description-box p {
    margin-bottom: 15px; /* Add space below text when stacked */
  }
  .interactive-slider-download-button {
    width: 100%; /* Make button full width when stacked */
    justify-content: center; /* Center button content */
  }
}

/* Custom CSS for the animation and specific slider styling */
@keyframes slideAndFade {
  0% {
    transform: translate(-70%, -50%); /* Start at the left end */
    opacity: 0.8; /* Initial opacity set to 50% */
  }

  50% {
    transform: translate(30%, -50%); /* Move to the right end */
    opacity: 0.8; /* Maintain opacity */
  }
  100% {
    transform: translate(-70%, -50%); /* Start at the left end */
    opacity: 0.8; /* Initial opacity set to 50% */
  }
}

/* Apply animation to the indicator */
.slider-handle-indicator {
  animation: slideAndFade 3s infinite ease-in-out;
  transition: opacity 0.3s ease-out;
  z-index: 3; /* Changed to 3 to be above the slider thumb */
}

.slider-handle-indicator.hidden {
  opacity: 0;
}

/* Adjustments for responsiveness */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
    gap: 1rem;
  }
  #animationContainer,
  #animationContainer2 {
    height: 200px;
  }
  #slider-container {
    height: 3rem;
  }
  .svg-text-tooltip {
    font-size: 60px; /* Adjusted for mobile, still large in SVG units */
  }
}
