/* ================= WRAPPER ================= */
#comp .wrapper-compe {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* ================= CONTAINER UTAMA ================= */
#comp .container-pulau-kategori {
    width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
/* ================= PULAU ================= */
#comp .container-pulau {
    width: 400px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-120px);
    position: relative;
    z-index: 1;
}
#comp .container-pulau .pulau {
    width: 120px;
    margin: 0 50px;
    cursor: pointer;
    transition: transform 0.4s ease, filter 0.3s ease;
}
#comp .container-pulau .pulau:hover {
    transform: scale(1.1);
    cursor: none;
}
#comp .container-pulau .pulau.active {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
}
#comp .container-pulau .pulau.inactive {
    opacity: 0.5;
    filter: grayscale(0.5);
}
/* ================= KATEGORI ================= */
#comp .container-kategorilomba {
    display: flex;
}
#comp .kategorilomba {
    width: 200px;
    height: 100px;
    margin: 0 20px;
    position: relative;
    top: -70px;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#comp .kategorilomba.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
.category-label {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-15px, 85px);
    font-size: 20px;
    font-weight: bold;
    color: #574430;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
    white-space: nowrap;
    z-index: 3;
    width: 180px;
    text-align: center;
    padding-top: 95px;
    pointer-events: none;
    transition: transform 0.4s ease;
}

/* ================= IMAGE DEFAULT ================= */
#comp .kategorilomba img {
    position: absolute;
    margin-top: 20px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
/* ================= DETAIL IMAGE ================= */
#comp img[alt="bingkaipiala"] {
    width: 150px;
    z-index: 1;
}
#comp img[alt="piala"] {
    width: 160px;
    transform: translate(0px, 5px);
    z-index: 1;
}
#comp img[alt="juknis"],
#comp img[alt="regis"] {
    width: 10px;
    transform: translate(30px, 80px);
    z-index: 0;
}
#comp img[alt="stikersma"]{
    width: 80px;
    transform: translate(7px, 10px) rotate(-20deg);
    z-index: 0;
}
#comp img[alt="stikersmp"] {
    width: 80px;
    transform: translate(60px, 10px) rotate(25deg);
    z-index: 0;
}
#comp .regis {
    cursor: pointer;
    pointer-events: none;
}
/* ================= HOVER EFFECT ================= */
#comp .kategorilomba:hover img[alt="bingkaipiala"] {
    width: 150px;
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    -o-transform: rotate(180deg);
}
#comp .kategorilomba:hover img[alt="stikersmp"] {
    width: 60px;
    transform: translate(100px, -15px) rotate(15deg);
}
#comp .kategorilomba:hover img[alt="stikersma"] {
    width: 60px;
    transform: translate(-10px, -15px) rotate(-15deg);
}
#comp .kategorilomba:hover img[alt="juknis"] {
    transform: translate(80px, 190px);
    width: 70px;
    z-index: 2;
}
#comp .kategorilomba:hover img[alt="regis"] {
    transform: translate(10px, 190px);
    width: 70px;
    z-index: 2;
    cursor: none;
}
#comp .kategorilomba:hover .regis {
    pointer-events: auto;
}

/* ================= SLIDING ANIMATIONS ================= */
@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-100px) scale(0.8);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
}
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
#comp .kategorilomba.slide-out-left {
    animation: slideOutLeft 0.4s ease forwards;
}

#comp .kategorilomba.slide-out-right {
    animation: slideOutRight 0.4s ease forwards;
}

#comp .kategorilomba.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

#comp .kategorilomba.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

/* Update the hidden state to work with animations */
#comp .kategorilomba.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* Ensure smooth container behavior */
#comp .container-kategorilomba {
    display: flex;
    position: relative;
    min-height: 250px;
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {

  /* Pulau container */
  #comp .container-pulau-kategori {
    width: 100%;
  }

  #comp .container-pulau {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    transform: translateY(-60px);
    gap: 12px;
}

  #comp .container-pulau .pulau {
    width: 75px;
    margin: 0 10px;
  }

  /* Categories stack vertically */
  #comp .container-kategorilomba {
    flex-wrap: wrap;
    justify-content: center;
    min-height: auto;
    gap: 24px;
  }

  #comp .kategorilomba {
    width: 140px;
    height: 160px;
    margin: 0;
    top: 0;
    transform: scale(0.9);
  }

  .category-label {
    transform: translate(-20px, 70px);
}

  #comp .kategorilomba:hover img[alt="bingkaipiala"],
  #comp .kategorilomba:hover img[alt="stikersmp"],
  #comp .kategorilomba:hover img[alt="stikersma"],
  #comp .kategorilomba:hover .regis {
    transform: none !important;
    width: initial !important;
}

  #comp .kategorilomba img[alt="juknis"],
  #comp .kategorilomba img[alt="regis"] {
    visibility: hidden;
}
}

/* ================= SL Track ================= */
.sl-track {
  display: flex;
  width: max-content;
  animation: scroll 25s linear infinite;
}
.sl-track img {
  height: 160px;
  width: auto;
  flex-shrink: 0;
}
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ================= DESKTOP HOVER PAUSE ================= */
@media (hover: hover) {
  .sl-track:hover {
    animation-play-state: paused;
  }
}

/* ================= RESPONSIVE ================= */
@media (min-width: 768px) {
  .sl-track img {
    height: 200px;
  }
}

@media (min-width: 1024px) {
  .sl-track img {
    height: 240px;
  }
}
