/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styles */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Main Container Wrapper */
.main-wrapper {
  width: 100%;
  max-width: 24rem; /* 384px - sm:max-w-md */
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* 24px - sm:gap-8 */
  align-items: center;
}

/* Container for Slider */
#container {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4; /* aspect-[3/4] */
  max-height: 70vh;
  overflow: visible;
}

/* SVG Styles */
#zigzag {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#path {
  stroke: url(#grad);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 10, 5;
}

#dot-start,
#dot-end {
  r: 6;
  opacity: 0.8;
}

#dot-start {
  fill: #6366f1;
}

#dot-end {
  fill: #ec4899;
}

/* Text Elements */
#start-text,
#end-text {
  position: absolute;
  width: 100%;
  text-align: center;
  color: #facc15; /* text-yellow-400 */
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  z-index: 10;
  font-size: 0.875rem; /* 14px - text-sm */
}

/* Slider Container */
#slider {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Button Container */
.button-container {
  display: flex;
  gap: 1rem; /* 16px - sm:gap-6 */
  z-index: 50;
}

/* Buttons Base Styles */
#toggle-zigzag,
#toggle-circle {
  position: relative;
  width: 3.5rem; /* 56px - 14*4 */
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
  transition: all 400ms;
}

#toggle-zigzag:hover,
#toggle-circle:hover {
  transform: scale(1.1);
}

#toggle-zigzag:active,
#toggle-circle:active {
  transform: scale(0.95);
}

/* Button Inner Divs */
#toggle-zigzag > div:first-of-type,
#toggle-circle > div:first-of-type {
  position: absolute;
  inset: 0;
  transition: opacity 400ms;
}

#toggle-zigzag > div:nth-of-type(2),
#toggle-circle > div:nth-of-type(2) {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, #ec4899, #f59e0b);
  opacity: 0;
  transition: opacity 400ms;
}

#toggle-zigzag:hover > div:nth-of-type(2),
#toggle-circle:hover > div:nth-of-type(2) {
  opacity: 1;
}

/* Button Text/Icons */
#toggle-zigzag > span,
#toggle-circle > span {
  position: relative;
  z-index: 10;
  color: #ffffff;
  font-size: 1.5rem; /* 24px - text-2xl */
  font-weight: 700;
}

/* Slide Elements */
.slide {
  position: absolute;
  text-align: center;
  transition: all 0.6s ease;
  z-index: 20;
  cursor: grab;
  user-select: none;
}

.slide img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.6s ease;
}

.slide.active img {
  transform: scale(1.3);
  border-color: #ec4899;
  border-width: 3px;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.6);
}

.description {
  color: #ffffff;
  margin-top: 0.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
}

/* Responsive Styles - Small Screens (640px and up) */
@media (min-width: 640px) {
  .main-wrapper {
    max-width: 28rem; /* 448px - sm:max-w-md */
    gap: 2rem; /* 32px - sm:gap-8 */
  }

  #container {
    aspect-ratio: 2/3; /* sm:aspect-[2/3] */
  }

  #start-text,
  #end-text {
    font-size: 1rem; /* 16px - sm:text-base */
  }

  .button-container {
    gap: 1.5rem; /* 24px - sm:gap-6 */
  }

  #toggle-zigzag,
  #toggle-circle {
    width: 4rem; /* 64px - sm:w-16 */
    height: 4rem;
  }

  #toggle-zigzag > span,
  #toggle-circle > span {
    font-size: 1.875rem; /* 30px - sm:text-3xl */
  }

  .slide img {
    width: 110px;
    height: 110px;
  }

  .description {
    font-size: 1rem;
    margin-top: 0.6rem;
  }
}

/* Responsive Styles - Medium Screens (768px and up) */
@media (min-width: 768px) {
  .main-wrapper {
    max-width: 32rem; /* 512px - md:max-w-lg */
  }

  #container {
    aspect-ratio: 3/5; /* md:aspect-[3/5] */
  }

  .button-container {
    gap: 2rem; /* 32px - md:gap-8 */
  }

  #toggle-zigzag,
  #toggle-circle {
    width: 5rem; /* 80px - md:w-20 */
    height: 5rem;
  }

  #toggle-zigzag > span,
  #toggle-circle > span {
    font-size: 2.25rem; /* 36px - md:text-4xl */
  }

  .slide img {
    width: 130px;
    height: 130px;
    border-width: 3px;
  }

  .slide.active img {
    border-width: 4px;
  }

  .description {
    font-size: 1.1rem;
    margin-top: 0.7rem;
  }
}

/* Additional Utility Classes */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-400 {
  transition-duration: 400ms;
}

.ease {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient Definitions (for SVG - must be in HTML/SVG) */
/* 
<defs>
  <linearGradient id="grad" x1="0%" y1="0%" x2="0%" y2="100%">
    <stop offset="0%" stop-color="#6366f1"/>
    <stop offset="100%" stop-color="#ec4899"/>
  </linearGradient>
</defs>
*/