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

body {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  overflow-x: hidden;
  overflow-y: scroll;
  background: #1d0331;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

/* === NAVBAR === */
.custom-navbar {
  width: 100%;
  background: rgba(6, 5, 5, 0.35);
  opacity: 70%;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(47, 32, 72, 0.1);
  padding: 12px 25px;
  transition: background 0.3s ease;
  position: fixed;
  z-index: 1100;
}

.custom-navbar.scrolled {
  background: rgba(0, 0, 0, 0.75);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo img {
  height: 50px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* Chatbot icon */
.chatbot img {
  width: 35px;
  height: 35px;
  cursor: pointer;
}

/* Hamburger */
.hamburger {
  cursor: pointer;
  width: 30px;
  height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hamburger span {
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* side menu */
.side-menu {
  position: fixed;
  top: 0;
  right: -300px;
  height: 100vh;
  width: 300px;
  background: linear-gradient(
    180deg,
    rgba(18, 18, 30, 0.98) 0%,
    rgba(10, 10, 18, 0.95) 100%
  );
  backdrop-filter: blur(8px);
  padding: 80px 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease;
  opacity: 0;
  z-index: 1000;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.6);
  font-family: "Baloo 2", sans-serif;
}

.side-menu.active {
  right: 0;
  opacity: 1;
}

/* Link Style */
.side-menu a {
  position: relative;
  color: #ddd;
  text-decoration: none;
  letter-spacing: 0.5px;
  padding: 8px 0;
  transition: color 0.3s ease;
  font-size: 1.2rem;
  font-weight: 600;
}

.side-menu .menu-icon,
.side-menu .menu-icon2,
.side-menu .menu-icon3 {
  margin-right: 0.8rem;
  margin-bottom: -3px;
}

.side-menu .menu-icon {
  width: 1.5rem;
}
.side-menu .menu-icon2 {
  width: 1.3rem;
}
.side-menu .menu-icon3 {
  width: 1.4rem;
}

/* Hover animasi underline glowing */
.side-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #a78bfa, #8b5cf6, #4c1d95);
  box-shadow: 0 0 6px #8b5cf6;
  transition: width 0.3s ease;
}

.side-menu a:hover {
  color: #c4b5fd;
}

.side-menu a:hover::after {
  width: 100%;
}

/* Entrance animation */
.side-menu.active a {
  animation: slideFadeIn 0.4s ease forwards;
}
.side-menu.active a:nth-child(1) {
  animation-delay: 0.1s;
}
.side-menu.active a:nth-child(2) {
  animation-delay: 0.2s;
}
.side-menu.active a:nth-child(3) {
  animation-delay: 0.3s;
}
.side-menu.active a:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes slideFadeIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* section */

#starsCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
}

body {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  background: linear-gradient(
    to bottom,
    rgb(7, 0, 11) 0%,
    rgba(29, 3, 49, 1) 100%
  );
  color: #fff;
}

.container {
  display: flex;
  align-items: stretch;
  padding-top: 1.5rem;
}

/* Materi utama (kiri) */
.materi-box {
  flex: 3;
  padding: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  margin-right: 20px;
  display: flex;
  flex-direction: column;
  height: 720px;
  transition: all 0.2s ease;
  margin-top: 4rem;
  max-height: 80vh;
  overflow: hidden;
}

#materi-content-container {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
  padding-right: 8px;
}

.materi-box:hover {
  transform: translateY(-3px);
  border-color: rgb(255, 255, 255);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.materi-content {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
  padding-right: 8px;
}

.materi-box .Bab {
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  font-size: 2.5rem;
  padding-bottom: 1rem;
}

.materi-box h2 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  padding-bottom: 1rem;
}

.materi-box #materi-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0 2.5rem 0 0;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  object-fit: contain;
  max-height: 520px;
}

.materi-box p {
  font-family: "Baloo 2", sans-serif;
  font-weight: 400;
  font-size: 1.5rem;
  padding-bottom: 1rem;
  padding-top: 1rem;
}

/* Responsif untuk tablet dan HP */
@media (max-width: 1024px) {
  .materi-box #materi-img {
    width: 100%;
    max-width: 380px;
    height: auto;
    display: block;
    margin: 0 2.5rem 0 0;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    max-height: 520px;
  }
}

/* Sidebar (kanan) */
.sidebar {
  flex: 1;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  margin-top: 4rem;
  height: 720px;
}

.sidebar h2 {
  padding-bottom: 1rem;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
}

.materi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  margin-bottom: 15px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.materi-card p {
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  color: white;
}

.materi-card:hover {
  transform: scale(1.05);
  border: 4px solid white;
}

.materi-card .icon {
  width: 4rem;
  border-radius: 8px;
}

/* Navigasi bawah */
.nav-btns {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  margin-top: auto;
}

.nav-btns button {
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 3;
  text-decoration: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: white;
  padding: 0.5rem;
  width: 10rem;
  margin: 1rem;
}

.nav-btns button:hover {
  border: 1px solid rgb(255, 255, 255);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  transition: 0.2s;
}

/* footer */
.footer {
  background: #120a25;
  color: #eee;
  padding: 40px 20px;
  margin-top: 60px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
}

.footer-about,
.footer-links,
.footer-contact {
  flex: 1 1 250px;
  margin: 20px;
}

.footer h2,
.footer h3 {
  color: #0ff;
  margin-bottom: 15px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
}

.footer p,
.footer a {
  color: #ccc;
  font-size: 14px;
  text-decoration: none;
}

.footer a:hover {
  color: #0ff;
  text-decoration: underline;
}

.footer-links {
  padding-left: 9rem;
}

.footer-contact {
  padding-left: 9rem;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links ul li {
  margin-bottom: 8px;
}

.footer .copyright {
  text-align: center;
  margin-top: 30px;
  font-size: 13px;
  color: #888;
  border-top: 1px solid #333;
  padding-top: 15px;
}

/* === RESPONSIVE DESIGN === */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .materi-box {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .sidebar {
    width: 100%;
  }

  .footer-container {
    text-align: center;
  }
  .footer-links,
  .footer-contact {
    padding-left: 0;
    margin: 10px 0;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .navbar-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .logo img {
    height: 40px;
  }

  .chatbot img {
    width: 28px;
    height: 28px;
  }

  .hamburger {
    width: 25px;
    height: 18px;
  }

  .container {
    padding: 10px;
  }

  .materi-box {
    padding: 15px;
  }

  .materi-box .Bab {
    font-size: 2rem;
  }

  .materi-box h2 {
    font-size: 1.2rem;
  }

  .materi-box p {
    font-size: 0.95rem;
  }

  .sidebar {
    padding: 10px;
  }

  .materi-card {
    padding: 15px;
  }

  .materi-card .icon {
    width: 3rem;
  }

  .nav-btns button {
    padding: 8px 15px;
    font-size: 14px;
  }

  .footer-container {
    text-align: center;
  }
  .footer-links,
  .footer-contact {
    padding-left: 0;
    margin: 10px 0;
  }
}

/* HP kecil (max-width: 480px) */
@media (max-width: 480px) {
  .materi-box .Bab {
    font-size: 1.5rem;
  }

  .materi-box h2 {
    font-size: 1rem;
  }

  .materi-box p {
    font-size: 0.85rem;
  }

  .materi-card {
    flex-direction: column;
    gap: 5px;
  }

  .materi-card .icon {
    width: 2.5rem;
  }

  .nav-btns {
    flex-direction: column;
    gap: 10px;
    padding-right: 1rem;
  }

  .nav-btns button {
    width: 100%;
  }

  .footer-container {
    text-align: center;
  }
  .footer-links,
  .footer-contact {
    padding-left: 0;
    margin: 10px 0;
  }
}

.back-btn-inside {
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 3;
  text-decoration: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  color: white;
  padding: 0.5rem;
  margin-bottom: 1rem;
}
.back-btn-inside:hover {
  border: 4px solid rgb(255, 255, 255);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  transition: 0.2s;
}

.top-nav-btns {
  display: flex;
  width: 100%;
  margin-bottom: 1.2rem;
  gap: 0;
}

.next-btn-inside {
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 3;
  text-decoration: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  color: white;
  padding: 0.5rem 1.2rem;
  transition: 0.2s;
}

.next-btn-inside:hover {
  border: 4px solid rgb(255, 255, 255);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.back-btn-inside,
.next-btn-inside {
  flex: 1 1 0;
  width: 50%;
  border-radius: 0;
  border: 4px solid rgba(82, 33, 208, 0.34);
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  color: white;
  padding: 0.7rem 0;
  background: #1d0331;
  transition: 0.2s;
  margin: 0;
  box-shadow: none;
  border-right: none;
}

.back-btn-inside {
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.next-btn-inside {
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.back-btn-inside:hover,
.next-btn-inside:hover {
  border: 1px solid #fff;
  z-index: 2;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  transform: translateY(-2px);
}

.scratch-block {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 16px;
  color: #fff;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  margin: 6px 8px 6px 0;
  box-shadow: 0 2px 8px #0002;
  vertical-align: middle;
  letter-spacing: 0.5px;
  border-bottom: 4px solid rgba(0, 0, 0, 0.08);
}
.scratch-motion {
  background: #4c97ff;
}
.scratch-looks {
  background: #9966ff;
}
.scratch-sound {
  background: #d65cd6;
}
.scratch-events {
  background: #ffd500;
  color: #333;
}
.scratch-control {
  background: #ffab19;
  color: #333;
}
.scratch-sensing {
  background: #5cb1d6;
}
.scratch-operators {
  background: #59c059;
}
.scratch-variables {
  background: #ff8c1a;
}
.scratch-myblocks {
  background: #ff6680;
}
