/*==================== 📱 MEDIA QUERIES RESPONSIF ====================*/

/*========== 📱 Perangkat Sangat Kecil (max-width: 350px) ==========*/
/* 💡 Digunakan untuk layar sangat kecil seperti ponsel mini */
@media screen and (max-width: 350px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav__list {
    column-gap: 0;
  }

  .home__content {
    grid-template-columns: 0.25fr 3fr;
  }

  .home__blob {
    width: 180px;
  }

  .skills__title {
    font-size: var(--normal-font-size);
  }

  .services__container {
    grid-template-columns: max-content;
    justify-content: center;
  }

  .services__content {
    padding-right: 3.5rem;
  }

  .services__modal {
    padding: 0 0.5rem;
  }

  .project__img {
    width: 200px;
  }

  .testimonial__data,
  .testimonial__header {
    flex-direction: column;
    align-items: center;
  }

  .testimonial__img {
    margin-right: 0;
    margin-bottom: var(--mb-0-25);
  }

  .testimonial__description {
    text-align: center;
  }
}


/* 🌐 Layout responsif mobile (≤ 480px termasuk 360px) */
@media screen and (max-width: 480px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center; /* 🧭 Pusatkan isi header */
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    position: relative;
    z-index: 999;
  }

  .logo {
    text-align: center;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%; /* ⬇️ Muncul di bawah header */
    left: 0;
    right: 0;
    background: var(--body-color);
    z-index: 998;
    text-align: center;
    padding: 1rem 0;
  }

  nav.active {
    display: block;
  }

  .menu-toggle {
    position: relative;
    z-index: 1001;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    align-self: center; /* 🎯 Pastikan di tengah */
  }

  .dark-mode-toggle {
    position: relative;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
  }

  .dark-mode-toggle input {
    transform: scale(1.2);
  }

  body.menu-open {
    overflow: hidden;
  }
}


/*==================== 🔔 TOAST NOTIFIKASI PREMIUM (iOS Glow) ====================*/
.theme-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 1.5rem) + 3.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  border-radius: 1.25rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 8px rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 85%;
  min-width: 200px;
  box-sizing: border-box;
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-weight: 600; /* 🔥 Tambahkan font-weight global */
}

/* 🌙 Dark mode */
html[data-bs-theme="dark"] .theme-toast {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
}

/* ☀️ Light mode */
html[data-bs-theme="light"] .theme-toast {
  background: rgba(240, 240, 245, 0.9);
  color: #111827;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 0 6px rgba(0, 0, 0, 0.04);
}

/* Saat tampil */
.theme-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

/* Icon Toast */
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* Pesan Toast */
.toast-message {
  font-size: 15px;
  font-weight: 600; /* ✅ Teks tebal */
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

/* 📱 Mobile */
@media screen and (max-width: 480px) {
  .theme-toast {
    bottom: 1rem;
    padding: 0.65rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    max-width: 95%;
    min-width: 240px;
  }

  .toast-icon {
    font-size: 16px;
  }

  .toast-message {
    font-size: 14px;
    font-weight: 600; /* ✅ Teks tetap tebal di mobile */
  }
}


/*========== 📱 Landscape Mode Mobile (max-width: 812px) ==========*/
/* 💡 Untuk tampilan ponsel dalam posisi landscape */
@media screen and (max-width: 812px) and (orientation: landscape) {
  body {
    font-size: 0.9rem;
  }

  .home__content {
    flex-direction: row;
    align-items: center;
  }
}


/*========== 📱 Perangkat Sedang (min-width: 568px) ==========*/
/* 💡 Tampilan mulai membagi konten menjadi 2 kolom */
@media screen and (min-width: 568px) {
  .home__content {
    grid-template-columns: max-content 1fr 1fr;
  }

  .home__data {
    grid-column: initial;
  }

  .home__img {
    order: 1;
    justify-self: center;
  }

  .about__container,
  .skills__container,
  .portfolio__content,
  .project__container,
  .contact__container,
  .footer__container {
    grid-template-columns: repeat(2, 1fr);
  }
}


/*========== 💻 Perangkat Besar (min-width: 768px) ==========*/
/* 💡 Tampilan mulai terlihat profesional dengan layout lebih luas */
@media screen and (min-width: 768px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }

  body {
    margin: 0;
    transition: background-color 0.6s ease, color 0.6s ease;
    scroll-behavior: smooth;
  }

  .section {
    padding: 6rem 0 2rem;
  }

  .section__subtitle {
    margin-bottom: 4rem;
  }

  .header {
    top: 0;
    bottom: initial;
  }

  .nav {
    height: calc(var(--header-height) + 1.5rem);
    column-gap: 1rem;
  }

  .nav__icon-img {
    display: none;
  }

  .nav__list {
    display: flex;
    column-gap: 2rem;
  }

  .change-theme {
    margin: 0;
    transition: transform 0.4s ease, color 0.4s ease;
  }

  .home__container {
    row-gap: 5rem;
  }

  .home__content {
    padding-top: 5.5rem;
    column-gap: 2rem;
  }

  .home__blob {
    padding-top: 5.5rem;
  }

  .home {
    display: block;
  }

  .home__scroll-button {
    margin-left: 3rem;
  }

  .about__container {
    column-gap: 5rem;
  }

  .about__img {
    width: 350px;
  }

  .about__description {
    text-align: initial;
  }

  .about__info {
    justify-content: space-between;
  }

  .about__buttons {
    justify-content: initial;
  }

  .services__container {
    grid-template-columns: repeat(3, 218px);
    justify-content: center;
  }

  .services__icon {
    font-size: 2rem;
  }

  .services__content {
    padding: 6rem 0 2rem 2.5rem;
  }

  .services__modal-content {
    width: 450px;
  }

  .portfolio__img {
    width: 320px;
  }

  .portfolio__content {
    align-items: center;
  }

  .project {
    text-align: initial;
  }

  .project__bg {
    background: none;
  }

  .project__container {
    background-color: var(--first-color-second);
    border-radius: 1rem;
    padding: 3rem 2.5rem 0;
    grid-template-columns: 1fr max-content;
    column-gap: 3rem;
  }

  .project__data {
    padding-top: 0.8rem;
  }

  .footer__container {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__bg {
    padding: 2rem;
  }

  .footer__links {
    flex-direction: row;
    column-gap: 2rem;
  }

  .footer__socials {
    justify-self: flex-end;
  }

  .footer__copy {
    margin-top: 1.5rem;
  }
}


/*========== 🖥️ Perangkat Ekstra Besar (min-width: 1024px) ==========*/
/* 💡 Untuk layar desktop besar, optimalkan ruang dan navigasi */
@media screen and (min-width: 1024px) {
  .home__blob {
    width: 320px;
  }

  .home__social {
    transform: translateX(-6rem);
  }

  .services__container {
    grid-template-columns: repeat(3, 238px);
  }

  .swiper-portfolio-icon {
    font-size: 3.5rem;
  }

  .swiper-button-prev {
    left: -3.5rem;
  }

  .swiper-button-next {
    right: -3.5rem;
  }

  .swiper-container-horizontal > .swiper-pagination-bullets {
    bottom: -4.5rem;
  }

  .contact__form {
    width: 460px;
  }

  .contact__inputs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== 📱 Responsif untuk Mobile Devices ==================== */
@media screen and (max-width: 768px) {
  .ai-assistant-toggle .eye {
    top: 45px;               /* Sedikit lebih atas agar pas dengan ukuran kecil */
    width: 52px;             /* Lebar mata dikurangi */
    height: 24px;
  }

  .eye::before,
  .eye::after {
    width: 10px;              /* Bola mata lebih kecil */
    height: 9px;
  }

  .eye::before {
    left: 10px;              /* Jarak dari kiri dikurangi */
    top: 6px;
  }

  .eye::after {
    right: 10px;             /* Jarak dari kanan dikurangi */
    top: 6px;
  }
}

/* 🌐 Tablet & HP besar (max-width: 768px) */
@media screen and (max-width: 768px) {
  emoji-picker.emoji-picker {
    width: 230px;
    max-height: 300px;
    left: 10px;
    right: auto;         /* Geser ke kanan agar tidak mentok */
    bottom: 70px;
  }
}

/* 📱 HP standar (max-width: 480px) */
@media screen and (max-width: 480px) {
  emoji-picker.emoji-picker {
    width: 230px;
    max-height: 300px;
    right: 10px;
    bottom: 60px;
  }
}

/* 📱 HP kecil banget (max-width: 360px) */
@media screen and (max-width: 360px) {
  emoji-picker.emoji-picker {
    width: 230px;
    max-height: 300px;
    right: 10px;
    bottom: 58px;
  }
}


/* ==================== 📱 Responsive: Ukuran HP Kecil ==================== */
@media screen and (max-width: 480px) {
  .ai-assistant-toggle {
  position: fixed;
  top: 50%; /* Posisi vertikal tengah */
  left: 20px; /* Jarak dari tepi kiri */
  transform: translateY(-50%); /* Agar titik tengah elemen tepat di tengah layar */
  width: 100px;
  height: 100px;
  z-index: 9999;
  transition: all 0.4s ease;
}

  .ai-assistant-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.4s ease, filter 0.4s ease;
  }
}

/* ==================== 📱 Responsive: Tablet atau HP Lebih Besar ==================== */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .ai-assistant-toggle {
  position: fixed;
  top: 50%; /* Posisi vertikal tengah */
  left: 20px; /* Jarak dari tepi kiri */
  transform: translateY(-50%); /* Agar titik tengah elemen tepat di tengah layar */
  width: 100px;
  height: 100px;
  z-index: 9999;
  transition: all 0.4s ease;
}

  .ai-assistant-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
  }
}


@media screen and (max-width: 480px) {
  .popup-ad {
    left: 8%;
    bottom: auto;
    top: 35%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
    border-radius: 1rem;
    padding: 0;
  }

  .popup-ad-content {
    padding: 1.2rem;
    margin-top: -10px; /* ⬆️ Geser ke atas sedikit */
    box-sizing: border-box;
    text-align: center;
    width: 100%;
    overflow: hidden;
  }

  .popup-ad-content .button,
  #payment-modal #btnToPayment {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    display: block;
    margin: 0.6rem auto 0;
  }
}

@media screen and (max-width: 360px) {
  .popup-ad {
    width: 95%;
    max-width: 300px;
    transform: translate(-50%, -50%);
}

.popup-ad-content {
    padding: 1rem;
    margin-top: -12px; /* ⬆️ Geser lebih atas sedikit untuk HP kecil */
    box-sizing: border-box;
    text-align: center;
    width: 100%;
    overflow: hidden;
  }

  .popup-ad-content .button {
    font-size: 0.85rem;
    padding: 0.5rem 1.1rem;
    display: block;
    margin: 0.6rem auto 0;
  }
}

@media screen and (max-width: 600px) {
  .footer__container {
    grid-template-columns: 1fr;
    text-align: center;
    justify-content: center;
  }

  .footer__container > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer__title {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    text-align: center;
  }

  .footer__subtitle {
    font-size: 0.8rem;
    text-align: center;
  }
}


/* ==================== SERVICES ==================== */
/* 📱 Mobile: 1 kolom layanan */
@media screen and (max-width: 480px) {
  .services__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0 1rem;
  }

  .services__content {
    padding: 2rem 1.25rem;
  }
}

/* 📱 Tablet: 2 kolom layanan */
@media screen and (min-width: 481px) and (max-width: 767px) {
  .services__container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0 2rem;
  }
}
