/* Default Theme Variables */
:root {
  --primary: #9caf88; /* default sage green */
  --secondary: #e07a5f; /* default clay terracotta */
  --accent: #f2cc8f; /* default muted yellow */
}

body {
  font-family: "Inter", sans-serif;
  transition: background-color 0.8s ease, color 0.8s ease;
}

/* Hamburger */
.hamburger div {
  width: 28px;
  height: 3px;
  background: currentColor;
  margin: 6px 0;
  border-radius: 2px;
  transition: all 0.4s ease;
}
.hamburger.active .line1 {
  transform: rotate(45deg) translate(6px, 6px);
}
.hamburger.active .line2 {
  opacity: 0;
}
.hamburger.active .line3 {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile menu overlay */
#mobileMenu {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}
#mobileMenu.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Overlay background */
#overlay {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Menu links animation */
.menuLink {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}
#mobileMenu.show .menuLink {
  opacity: 1;
  transform: translateY(0);
}
#mobileMenu.show .menuLink:nth-child(1) {
  transition-delay: 0.1s;
}
#mobileMenu.show .menuLink:nth-child(2) {
  transition-delay: 0.25s;
}
#mobileMenu.show .menuLink:nth-child(3) {
  transition-delay: 0.4s;
}

/* Floating blobs */
.blob {
  animation: float 15s ease-in-out infinite;
  filter: blur(100px);
  opacity: 0.6;
}
.blob:nth-child(2) {
  animation-duration: 20s;
  animation-delay: 3s;
  opacity: 0.5;
}
.blob:nth-child(3) {
  animation-duration: 25s;
  animation-delay: 6s;
  opacity: 0.4;
}
.blob:nth-child(4) {
  animation-duration: 30s;
  animation-delay: 9s;
  opacity: 0.5;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  50% {
    transform: translateY(-60px) translateX(40px) scale(1.2);
  }
}

/* ===== Modal ===== */
/* Tombol close modal */
.modal-content button[onclick^="closeModal"] {
  top: 0.8rem; /* jarak dari atas */
  right: 0.8rem; /* jarak dari kanan */
  background: rgba(0, 0, 0, 0.4); /* semi transparan */
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 9999px; /* bulat */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.3s ease;
}

.modal-content button[onclick^="closeModal"]:hover {
  background: var(--secondary);
  color: #fff;
}

.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* Container animasi */
.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 800px;
  width: 92%;
  padding: 1rem;
  position: relative;
  overflow: hidden;

  /* animasi circular reveal */
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.6s ease-in-out;

  max-height: 86vh;
}

/* saat buka */
.modal-content.animate-open {
  clip-path: circle(150% at 50% 50%);
}
/* saat tutup */
.modal-content.animate-close {
  clip-path: circle(0% at 50% 50%);
}

/* Area scroll */
.modal-body {
  max-height: calc(86vh - 2.5rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  scroll-behavior: smooth;
}

/* Gambar modal */
.modal-cover {
  width: 100%;
  max-height: 40vh;
  object-fit: cover;
  display: block;
}

/* Scrollbar custom */
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 9999px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

/* ===== Theme Palette Modal ===== */
#paletteModal {
  backdrop-filter: blur(6px);
  transition: opacity 0.4s ease;
}
#paletteModal > div {
  animation: popUp 0.4s ease;
}
@keyframes popUp {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
#paletteBtn {
  transition: transform 0.2s ease, background-color 0.3s ease;
}
#paletteBtn:hover {
  transform: scale(1.05);
}

/* Highlight active palette */
.palette-active {
  border: 3px solid var(--primary, #9caf88);
  border-radius: 0.75rem;
  padding: 3px;
}
