/* --- BIRTHDAY MODAL STYLES --- */
.bd-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2147483647;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.opener-box {
  text-align: center;
  color: white;
  animation: bounce 2s infinite;
}

.opener-box h1 {
  font-size: 4rem;
  margin-bottom: 10px;
}
.opener-box p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-family: "Poppins", sans-serif;
}

.btn-open {
  padding: 10px 30px;
  background: #ff6b81;
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 107, 129, 0.6);
  transition: transform 0.2s;
}

.btn-open:hover {
  transform: scale(1.1);
}

.bd-modal-content {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
  display: none;

  /* --- TAMBAHAN PENTING (FIX LAYAR KECIL) --- */
  max-height: 85vh; /* Maksimal 85% tinggi layar */
  overflow-y: auto; /* Munculkan scrollbar jika konten kepanjangan */

  /* Sembunyikan Scrollbar biar tetap cantik (Opsional) */
  scrollbar-width: thin;
  scrollbar-color: #ff9ff3 transparent;
}

/* Helper Classes */
.hidden {
  display: none !important;
}
.visible {
  display: block !important;
  animation: popUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bd-title {
  font-family: "Poppins", sans-serif;
  color: #ff9ff3;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 159, 243, 0.5);
}

.typewriter-body {
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 80px;
  margin-bottom: 20px;
  white-space: pre-line;
}

.timer-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 10px;
  margin: 20px 0;
  border: 1px solid #ff9ff3;
}

.timer-label {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 5px;
}
.timer-digits {
  font-size: 1.1rem;
  font-weight: bold;
  color: #feca57;
  font-family: monospace;
}

.btn-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
}
.btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
  transition: 0.3s;
}

.cat-gif,
.cake-gif {
  max-width: 100px;
  margin: 0 auto;
  display: block;
}

/* --- Floating Music Control Styles --- */
.music-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #ff9ff3; /* Matches theme */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 159, 243, 0.6);
  z-index: 9998;
  transition:
    transform 0.3s,
    opacity 0.5s;
  animation: pulse 2s infinite;
}

.music-fab:hover {
  transform: scale(1.1);
}

.music-fab i {
  color: white;
  font-size: 1.2rem;
}

/* Animations */
@keyframes popUp {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 159, 243, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 159, 243, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 159, 243, 0);
  }
}

/* --- RESPONSIVE MOBILE TWEAKS --- */
@media (max-height: 700px) {
  /* Kalau layarnya pendek (HP Landscape / HP Kecil) */
  .bd-modal-content {
    padding: 20px 15px; /* Kurangi padding */
  }

  .cat-gif,
  .cake-gif {
    max-width: 70px; /* Kecilkan GIF biar hemat tempat */
    margin: 5px auto;
  }

  .typewriter-body {
    font-size: 0.85rem; /* Kecilkan font surat */
    min-height: 60px;
    margin-bottom: 10px;
  }

  .bd-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .timer-box {
    margin: 10px 0;
    padding: 5px;
  }

  .btn-close {
    top: 10px; /* Pepetin ke atas */
    right: 10px; /* Pepetin ke kanan */
    font-size: 1.2rem; /* Kecilkan ikon silang */
    background: rgba(0, 0, 0, 0.2); /* Kasih background dikit biar kontras */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
