#develop {
  height: 100vh;
  background-color: #121516;
  color: #e7e5e4;
}

/* Override the default develop styles for our slide implementation */
#develop.develop-container {
  position: relative;
  height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #121516; /* Fallback background color */
  font-family: "Space Mono", monospace;
  overflow: hidden; /* Contain all content */
}

#develop .slide {
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  z-index: 1;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#develop .slide__outer,
#develop .slide__inner {
  width: 100%;
  height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
}

.slide__content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* Changed from absolute to relative */
  height: 100%;
  width: 100%;
}

.slide__container {
  position: relative;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  height: 90vh;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  padding: 0 1rem;
}

.slide__heading {
  --width: 200;
  display: block;
  text-align: left;
  font-family: "Space Mono", monospace;

  font-size: 5rem;
  font-weight: 900;
  font-variation-settings: "wdth" var(--width);
  margin: 0;
  padding: 0;
  color: #e7e5e4;
  z-index: 999;
  mix-blend-mode: difference;
  grid-area: 2 / 2 / 3 / 10;
  align-self: end;
}

.slide__img-cont {
  margin-top: 4rem;
  grid-area: 2 / 1 / 7 / 8;
}

.slide__img-cont img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

/* Slide colors */
.slide:nth-of-type(1) {
  visibility: visible !important; /* Force visibility */
  opacity: 1 !important; /* Ensure opacity is set */
}
.slide:nth-of-type(1) .slide__content {
  background-color: #121516;
  opacity: 1 !important; /* Ensure opacity is set */
}

.slide:nth-of-type(2) .slide__content {
  background-color: #e7e5e4;
}

.slide:nth-of-type(3) .slide__content {
  background-color: #121516;
}

.slide:nth-of-type(4) .slide__content {
  background-color: #e7e5e4;
}

.slide:nth-of-type(5) .slide__content {
  background-color: #121516;
}
.slide:nth-of-type(6) .slide__content {
  background-color: #e7e5e4;
}

/* Overlay styles */
#develop .overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 11;
  /* Make sure overlay only captures events inside the develop container */
  pointer-events: auto;
}

.overlay__content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  height: 90vh;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}

.overlay__img-cont {
  position: relative;
  overflow: hidden;
  margin: 0;
  grid-area: 4 / 3 / 9 / 11;
}

.overlay__img-cont img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.overlay__text-cont {
  position: relative;
  overflow: hidden;
  margin: 0;
  grid-area: 4 / 3 / 9 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100vh;
  height: auto;
}

.overlay__text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1.8;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease,
    background-color 0.5s ease, color 0.5s ease;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 800px;
  margin: auto;
  border-radius: 4px;
}

/* Dark background slides (odd numbered) */
.overlay__text[data-index="0"],
.overlay__text[data-index="2"],
.overlay__text[data-index="4"] {
  color: #e7e5e4; /* Light text */
  background-color: rgba(
    18,
    21,
    22,
    0.7
  ); /* Dark semi-transparent background */
}

/* Light background slides (even numbered) */
.overlay__text[data-index="1"],
.overlay__text[data-index="3"],
.overlay__text[data-index="5"] {
  color: #121516; /* Dark text */
  background-color: rgba(
    231,
    229,
    228,
    0.7
  ); /* Light semi-transparent background */
  backdrop-filter: blur(4px);
}

.overlay__text[data-index="0"] {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.overlay__count {
  grid-area: 3 / 10 / 4 / 10;
  font-size: clamp(3rem, 4vw, 15rem);
  margin: 0;
  padding: 0;
  text-align: right;
  /* border-bottom: 7px white solid; */
  transition: color 0.5s ease;
}

/* Dynamic counter color based on slide index */
body[data-slide="1"] .overlay__count,
body[data-slide="3"] .overlay__count,
body[data-slide="5"] .overlay__count {
  color: #e7e5e4; /* Light text for dark backgrounds */
}

body[data-slide="2"] .overlay__count,
body[data-slide="4"] .overlay__count,
body[data-slide="6"] .overlay__count {
  color: #121516; /* Dark text for light backgrounds */
}

/* Navigation buttons */
.slide-navigation {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
  z-index: 15;
}

.nav-button {
  width: 50px;
  height: 50px;
  border: 2px solid #e7e5e4;
  background: rgba(18, 21, 22, 0.8);
  color: #e7e5e4;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.nav-button:hover:not(:disabled) {
  background: rgba(231, 229, 228, 0.9);
  color: #121516;
  border-color: #121516;
  transform: scale(1.1);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dynamic button colors based on slide background */
body[data-slide="2"] .nav-button,
body[data-slide="4"] .nav-button,
body[data-slide="6"] .nav-button {
  border-color: #121516;
  background: rgba(231, 229, 228, 0.8);
  color: #121516;
}

body[data-slide="2"] .nav-button:hover:not(:disabled),
body[data-slide="4"] .nav-button:hover:not(:disabled),
body[data-slide="6"] .nav-button:hover:not(:disabled) {
  background: rgba(18, 21, 22, 0.9);
  color: #e7e5e4;
  border-color: #e7e5e4;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
  .slide__container {
    position: relative;
    max-width: 1400px;
    width: 100%;
    margin: 0 0;
    height: 90vh;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    padding: 0 0;
    align-items: center;
    justify-content: center;
  }

  .slide__content {
    padding: 0;
    margin: 0;
    width: 100vw;
    align-items: center;
    justify-content: center;
  }

  .slide__img-cont {
    grid-area: 3 / 0 / 6 / 11;
    margin-top: 1rem;
    position: relative;
  }

  .slide__heading {
    font-size: 2.5rem;
    grid-area: 2 / 0 / 2 / 11;
    align-self: center;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .overlay__count {
    grid-area: 2 / 9 / 3 / 10;
    font-size: 2.5rem;
  }

  .overlay__text-cont {
    margin: 0;
    grid-area: 6 / 1 / 11 / 11; /* Changed to span full width (column 1 to 11) */
    display: flex;
    align-items: center;
    justify-content: center; /* Changed from right to center */
    max-width: 90%; /* Changed from 80vw to 100% */
    height: auto;
  } /* Removed the errant 's' character that was here */

  .overlay__text {
    text-align: right; /* Changed from right to center */
    max-width: 90%; /* Limit width but keep content visible */
    padding: 1.5rem;
  }
}

/* Mobile styles for develop section */
@media (max-width: 768px) {
  .mobile-device #develop {
    /* Ensure the develop container takes the full height on mobile */
    height: 100vh !important;
    width: 100%;
    position: relative;
    overflow: hidden;
  }

  .mobile-device .slide {
    /* Make slides work properly on touch devices */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .slide__heading {
    font-size: 2rem !important;
  }

  .slide__content {
    padding: 20px !important;
  }

  .slide__outer,
  .slide__inner {
    width: 100% !important;
  }
  .slide__img-cont {
    margin-top: 2rem !important;
  }

  /* Mobile navigation buttons */
  .slide-navigation {
    bottom: 2rem;
    gap: 1.5rem;
  }

  .nav-button {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}

/* Responsive adjustments - for larger screens */
@media screen and (min-width: 768px) {
  .slide__container {
    padding: 0 2rem;
  }

  .slide__heading {
    font-size: 4rem;
  }

  .overlay__text {
    font-size: 1.6rem;
    padding: 3rem;
  }
}
