@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

html {
  scroll-behavior: smooth;
}

.text-justify-custom {
  text-align: justify;
}

.bg-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.skill-pill:hover {
  transform: translateY(-5px);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* Swiper styles */
.swiper {
  width: 100%;
  height: 100%;
  position: relative;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Enhanced pagination styles - always positioned inside the image */
.swiper-pagination {
  position: absolute !important;
  bottom: 20px !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 20 !important;
  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 !important;
}

.swiper-pagination-bullet {
  width: 12px !important;
  height: 12px !important;
  background-color: rgba(255, 255, 255, 0.7) !important;
  opacity: 1 !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.swiper-pagination-bullet-active {
  background-color: #2563eb !important;
  transform: scale(1.2) !important;
  border-color: white !important;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close {
  position: absolute;
  top: 15px;
  right: 15px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  z-index: 110;
  cursor: pointer;
}

/* Custom navigation arrows */
.gallery-nav-prev,
.gallery-nav-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gallery-nav-prev {
  left: 20px;
}

.gallery-nav-next {
  right: 20px;
}

.gallery-nav-prev:hover,
.gallery-nav-next:hover {
  background-color: #2563eb;
  color: white;
}

/* Hide default Swiper navigation */
.swiper-button-next,
.swiper-button-prev {
  display: none !important;
}

/* Gallery image container with fixed aspect ratio */
.gallery-image-container {
  width: 100%;
  height: 0;
  padding-bottom: 40%;
  /* 16:9 aspect ratio */
  position: relative;
  background-color: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gallery-image-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  /* Gunakan flexbox untuk menengahkan gambar */
  align-items: center;
  /* Tengahkan vertikal */
  justify-content: center;
  /* Tengahkan horizontal */
  padding: 0;
  /* Hapus padding jika tidak ada teks */
  text-align: center;
}

/* Styles for image within gallery */
.gallery-slide-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Ensures the image fits within the container without cropping */
  /* Tambahkan margin-auto untuk menengahkan jika diperlukan oleh flexbox */
  margin: auto;
}

/* Styles for project icon image */
.project-icon-image {
  max-width: 100%; /* Changed from 80% */
  max-height: 100%; /* Changed from 80% */
  object-fit: cover; /* Changed from contain to cover to fill the space */
  width: 100%; /* Ensure it takes full width */
  height: 100%; /* Ensure it takes full height */
}

/* Navbar active and hover styles */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link.active {
  color: #2563eb;
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2563eb;
  transform: scaleX(1);
  transition: transform 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2563eb;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Improved responsive gallery styles */
.modal-gallery {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Improved pagination positioning for all orientations */
.gallery-pagination-container {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
  /* Allow clicks to pass through to the swiper */
}

.gallery-pagination-wrapper {
  display: inline-flex;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  padding: 5px 10px;
  pointer-events: auto;
  /* Re-enable clicks on the actual pagination */
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .gallery-pagination-container {
    bottom: 15px;
  }

  .swiper-pagination-bullet {
    width: 10px !important;
    height: 10px !important;
  }

  .gallery-image-container {
    padding-bottom: 50%;
    /* Adjusted for tablets, slightly taller than default */
  }
}

@media (max-width: 768px) {
  .gallery-pagination-container {
    bottom: 12px;
  }

  .gallery-nav-prev,
  .gallery-nav-next {
    width: 40px;
    height: 40px;
  }

  .gallery-image-container {
    padding-bottom: 60%;
    /* Adjusted for smaller tablets / landscape phones */
  }

  .gallery-image-content {
    padding: 0;
    /* Hapus padding */
  }

  /* Ensure pagination stays inside the container in landscape mode */
  @media (orientation: landscape) {
    .gallery-pagination-container {
      bottom: 10px;
    }

    .gallery-pagination-wrapper {
      padding: 3px 8px;
    }

    .swiper-pagination-bullet {
      width: 8px !important;
      height: 8px !important;
      margin: 0 3px !important;
    }
  }
}

@media (max-width: 640px) {
  #hero .container {
    padding-top: 1rem;
    /* More padding at the top for small screens */
    padding-bottom: 1rem;
    /* More padding at the bottom */
  }

  #hero h1 {
    font-size: 2.5rem;
    /* Smaller H1 for mobile */
  }

  #hero h2 {
    font-size: 1.8rem;
    /* Smaller H2 for mobile */
  }

  #hero p {
    font-size: 1.35rem;
    /* Slightly smaller paragraph text */
  }

  #hero .md:w-1/2 {
    width: 100%;
    /* Ensure text section takes full width */
  }

  #hero .md:mb-0 {
    margin-bottom: 2.5rem;
    /* Add some margin below text section before image */
  }

  #hero .relative {
    margin-top: 2rem;
    /* Space above the image */
  }

  #hero .w-64,
  #hero .h-64,
  #hero .md:w-80,
  #hero .md:h-80 {
    width: 180px;
    /* Make image circles slightly smaller */
    height: 180px;
    /* Make image circles slightly smaller */
  }

  #hero .absolute {
    /* Adjust floating circles to scale with the main image */
    -top: 3px;
    -right: 3px;
  }

  .gallery-nav-prev,
  .gallery-nav-next {
    width: 36px;
    height: 36px;
  }

  .gallery-nav-prev {
    left: 10px;
  }

  .gallery-nav-next {
    right: 10px;
  }

  .modal-content {
    width: 95%;
    height: 80vh;
  }

  .gallery-pagination-container {
    bottom: 8px;
  }

  .gallery-pagination-wrapper {
    padding: 3px 8px;
  }

  .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    margin: 0 3px !important;
  }

  .gallery-image-container {
    padding-bottom: 80%;
    /* Adjusted for mobile portrait, a bit more square */
  }

  .gallery-image-content {
    padding: 0;
    /* Hapus padding */
  }

  .gallery-image-content i {
    display: none;
    /* Sembunyikan ikon sepenuhnya jika ada */
  }

  .gallery-image-content h3 {
    display: none;
    /* Sembunyikan h3 sepenuhnya jika ada */
  }

  .gallery-image-content p {
    display: none;
    /* Sembunyikan p sepenuhnya jika ada */
  }

  /* Ensure pagination stays inside the container in landscape mode */
  @media (orientation: landscape) {
    #hero .container {
      padding-top: 8rem;
      /* Reduced top padding for landscape */
      padding-bottom: 2rem;
      /* Reduced bottom padding */
      padding-left: 1.5rem;
      /* Increased left padding */
      padding-right: 1.5rem;
      /* Increased right padding */
      display: flex;
      /* Use flexbox to better align content side-by-side */
      flex-direction: row;
      /* Arrange content in a row */
      align-items: center;
      /* Vertically align items */
      justify-content: space-around;
      /* Distribute space between items */
    }

    #hero .md:w-1/2 {
      width: 48%;
      /* Give roughly half width to text content */
      margin-bottom: 0;
      /* Remove bottom margin as content is now side-by-side */
      text-align: left;
      /* Ensure text aligns left */
    }

    #hero .md:w-1/2:last-child {
      width: 48%;
      /* Give roughly half width to image content */
      margin-top: 0;
      /* Remove top margin */
      display: flex;
      justify-content: center;
      align-items: center;
    }

    #hero h1 {
      font-size: 2rem;
      /* Further reduce H1 size for landscape to prevent wrapping */
    }

    #hero h2 {
      font-size: 1.65rem;
      /* Further reduce H2 size for landscape */
    }

    #hero p {
      font-size: 1.3rem;
      /* Further reduce paragraph size for landscape */
      margin-bottom: 0.8rem;
      /* Adjust paragraph bottom margin */
    }

    #hero .flex-wrap {
      justify-content: flex-start;
      /* Align buttons to the start */
      gap: 0.75rem; /* Slightly reduce gap between buttons */
    }

    #hero .px-6 {
      /* Target buttons directly for smaller padding */
      padding-left: 1.25rem;
      padding-right: 1.25rem;
    }
    #hero .py-3 {
      padding-top: 0.6rem;
      padding-bottom: 0.6rem;
    }

    #hero .w-64,
    #hero .h-64,
    #hero .md:w-80,
    #hero .md:h-80 {
      width: 140px;
      /* Make image circles even smaller for landscape */
      height: 140px;
      /* Make image circles even smaller for landscape */
    }

    #hero .absolute {
      /* Adjust floating circles to scale with the main image */
      -top: 1px;
      -right: 1px;
      width: 140px; /* Adjust based on new image size */
      height: 140px; /* Adjust based on new image size */
    }

    .gallery-image-container {
      padding-bottom: 56.25%;
      /* 16:9 for landscape mobile */
    }

    .gallery-pagination-container {
      bottom: 5px;
    }

    .gallery-pagination-wrapper {
      padding: 2px 6px;
    }

    .swiper-pagination-bullet {
      width: 6px !important;
      height: 6px !important;
      margin: 0 2px !important;
    }
  }
}

/* Small mobile devices */
@media (max-width: 375px) {
  #hero h1 {
    font-size: 2rem;
    /* Even smaller H1 for very small screens */
  }

  #hero h2 {
    font-size: 1.65rem;
    /* Even smaller H2 for very small screens */
  }

  #hero p {
    font-size: 1.3rem;
    /* Even smaller paragraph text */
  }

  #hero .w-64,
  #hero .h-64,
  #hero .md:w-80,
  #hero .md:h-80 {
    width: 180px;
    /* Make image circles even smaller */
    height: 180px;
    /* Make image circles even smaller */
  }

  #hero .flex-wrap > *:not(:last-child) {
    margin-right: 0.5rem;
    /* Reduce space between buttons if they wrap */
  }

  .swiper-pagination-bullet {
    width: 6px !important;
    height: 6px !important;
    margin: 0 2px !important;
  }

  .gallery-pagination-container {
    bottom: 5px;
  }

  .gallery-pagination-wrapper {
    padding: 2px 6px;
  }

  .gallery-nav-prev,
  .gallery-nav-next {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .gallery-image-content {
    padding: 0;
    /* Hapus padding */
  }

  .gallery-image-content i {
    display: none;
  }

  .gallery-image-content h3 {
    display: none;
  }

  .gallery-image-content p {
    display: none;
  }
}

/* Existing animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* New animations for About Me section */
/* Existing animations */
/* ... (keep your existing float, pulse-small, fade-in-out if you like them elsewhere) ... */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* New animations for About Me section icons */
.animate-float-icon-1 {
  animation: float-small-alt 3.5s ease-in-out infinite;
}

.animate-float-icon-2 {
  animation: float-small-alt 3.8s ease-in-out infinite;
  animation-delay: 0.5s;
  /* Stagger animation start */
}

.animate-float-icon-3 {
  animation: float-small-alt 3.2s ease-in-out infinite;
  animation-delay: 1s;
  /* Stagger animation start */
}

.animate-float-icon-4 {
  animation: float-small-alt 3.6s ease-in-out infinite;
  animation-delay: 0.7s;
  /* Stagger animation start */
}

.bg-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.glassmorphism {
  background-color: rgba(255, 255, 255, 0.3);
  /* Slightly transparent white */
  backdrop-filter: blur(10px);
  /* Blur effect */
  -webkit-backdrop-filter: blur(10px);
  /* For Safari support */
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Subtle white border */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Soft shadow */
}

@keyframes float-small-alt {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  25% {
    transform: translateY(-5px) rotate(2deg);
  }

  50% {
    transform: translateY(0px) rotate(0deg);
  }

  75% {
    transform: translateY(-5px) rotate(-2deg);
  }

  100% {
    transform: translateY(0px) rotate(0deg);
  }
}