/* ==========================================================================
   FLOATING ACTION BUTTONS (FAB) — HARMONIZED UI SYSTEM
   Sisi Kiri  : Aksesibilitas (Bawah) & Buku Tamu (Atas)
   Sisi Kanan : WhatsApp (Bawah) & Scroll To Top (Atas)
   Ukuran Seragam: 56px x 56px | Jarak Bawah: 24px | Gap Vertikal: 14px
   ========================================================================== */

/* ----------------------------------------------------
   1. SISI KANAN — WHATSAPP WIDGET (BAWAH)
   ---------------------------------------------------- */
.wa-floating-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.wa-floating-btn {
  position: relative;
  background: #25d366;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(18, 140, 126, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.wa-floating-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.5);
}

.wa-avatar-wrapper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 66px;
  height: 66px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}

.wa-avatar-img {
  width: 100%;
  height: auto;
  max-height: 72px;
  transform: translateY(2px);
  transition: transform 0.3s ease;
}

.wa-floating-btn:hover .wa-avatar-img {
  transform: translateY(-3px);
}

.wa-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background-color: #25d366;
  color: #ffffff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 2px solid #ffffff;
  z-index: 10;
}

.wa-btn-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #25d366;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  animation: waPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes waPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.wa-floating-text {
  background-color: #ffffff;
  color: #333333;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 12px 12px 4px 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(15px);
  pointer-events: none;
  white-space: nowrap;
}

.wa-floating-container:hover .wa-floating-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.wa-floating-text:hover {
  color: #128c7e;
}

/* ----------------------------------------------------
   2. SISI KANAN — SCROLL TO TOP BUTTON (ATAS)
   ---------------------------------------------------- */
#scrollTopBtn {
  position: fixed;
  bottom: 94px;
  right: 24px;
  z-index: 1030;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #139a4e;
  color: #ffffff;
  font-size: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(14, 122, 62, 0.35);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, opacity 0.25s ease, visibility 0.25s ease;
}

#scrollTopBtn.show {
  display: flex;
}

#scrollTopBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(14, 122, 62, 0.5);
  background: #0E7A3E;
  color: #ffffff;
}

.scroll-top-tooltip {
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #ffffff;
  color: #333333;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 12px 12px 4px 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

#scrollTopBtn:hover .scroll-top-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ----------------------------------------------------
   3. SISI KIRI — AKSESIBILITAS WIDGET (BAWAH)
   ---------------------------------------------------- */
#accessibilityWrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1030;
  display: flex;
  align-items: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#accessibilityBtn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #fbbf24;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 2;
}

#accessibilityBtn i {
  font-size: 24px;
}

#accessibilityBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.5);
  background: #f59e0b;
}

.accessibility-text {
  position: absolute;
  left: 68px;
  background-color: #ffffff;
  color: #333333;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

#accessibilityWrapper:hover .accessibility-text {
  opacity: 1;
  transform: translateX(0);
}

#accessibilityMenu {
  position: absolute;
  left: 68px;
  bottom: 0;
  width: 220px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  z-index: 1035;
  padding: 10px;
}

#accessibilityMenu .btn {
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
}

/* ----------------------------------------------------
   4. SISI KIRI — BUKU TAMU WIDGET (ATAS)
   ---------------------------------------------------- */
.buku-tamu-container {
  position: fixed;
  bottom: 94px;
  left: 24px;
  z-index: 1030;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.buku-tamu-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #00897b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 103, 91, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.buku-tamu-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 103, 91, 0.5);
  color: #ffffff;
}

.buku-icon-wrapper {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buku-tamu-text {
  position: absolute;
  left: 68px;
  background-color: #ffffff;
  color: #333333;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.buku-tamu-container:hover .buku-tamu-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.buku-tamu-text:hover {
  color: #00675b;
}

.buku-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #00897b;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.4;
  animation: bukuPulseAnimate 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes bukuPulseAnimate {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  70%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* ----------------------------------------------------
   5. RESPONSIVE UNTUK LAYAR KECIL / HP (< 768px)
   ---------------------------------------------------- */
@media (max-width: 768px) {
  .wa-floating-container {
    bottom: 18px;
    right: 18px;
  }

  .wa-floating-btn,
  #scrollTopBtn,
  #accessibilityBtn,
  .buku-tamu-container,
  .buku-tamu-btn {
    width: 50px !important;
    height: 50px !important;
  }

  #scrollTopBtn {
    bottom: 78px;
    right: 18px;
    font-size: 18px;
  }

  #accessibilityWrapper {
    bottom: 18px !important;
    left: 18px !important;
  }

  #accessibilityBtn i {
    font-size: 20px;
  }

  #accessibilityMenu {
    left: 0;
    bottom: 60px;
    width: 200px;
  }

  .buku-tamu-container {
    bottom: 78px;
    left: 18px;
  }

  .buku-icon-wrapper {
    font-size: 18px;
  }

  .wa-avatar-wrapper {
    width: 58px;
    height: 58px;
  }

  .wa-avatar-img {
    max-height: 64px;
  }

  /* Sembunyikan label teks mengambang di layar sentuh */
  .wa-floating-text,
  .buku-tamu-text,
  .accessibility-text,
  .scroll-top-tooltip {
    display: none !important;
  }
}

/* ----------------------------------------------------
   6. MODAL OPEN — SEMBUNYIKAN SEMUA FAB SAAT DIALOG MUNCUL
   ---------------------------------------------------- */
body.modal-open .wa-floating-container,
body.modal-open .buku-tamu-container,
body.modal-open #accessibilityWrapper,
body.modal-open #scrollTopBtn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* section-unit-kerja-pejabat.html */
/* =========================================
   MODAL DATA PEJABAT — MODERN MINIMAL
   ========================================= */

#modalPejabat .modal-dialog {
  max-width: 1180px;
}

.official-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid #e7ece8;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(26, 52, 37, 0.035);
}

.official-portrait,
.official-portrait-placeholder {
  display: grid;
  width: 76px;
  height: 92px;
  flex: 0 0 76px;
  place-items: center;
  overflow: hidden;
  background: #edf4ef;
  border-radius: 11px;
}

.official-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.official-portrait-placeholder {
  color: #7b9b84;
  font-size: 2rem;
}
.official-card-details {
  min-width: 0;
}
.official-card-position {
  margin: 0 0 0.35rem;
  color: #6f7e74;
  font-size: 0.72rem;
  line-height: 1.4;
}
.official-card-name {
  margin: 0 0 0.55rem;
  color: #25372c;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.official-card-rank {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  color: #276342;
  background: #edf6ef;
  border-radius: 50rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.kua-profile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  color: #174c38;
  text-decoration: none;
  background: #f4f8f5;
  border: 1px solid #dce9e0;
  border-radius: 14px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.kua-profile-link:hover {
  color: #103c2b;
  background: #eaf3ed;
  border-color: #bdd5c5;
  transform: translateY(-2px);
}

.kua-profile-copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.kua-profile-copy > i {
  font-size: 1.2rem;
}
.kua-profile-copy span {
  display: grid;
  gap: 0.15rem;
  text-align: left;
}
.kua-profile-copy strong {
  font-size: 0.9rem;
}
.kua-profile-copy small {
  color: #6b7e73;
  font-size: 0.74rem;
}
.kua-profile-arrow {
  color: #668b74;
  font-size: 1rem;
}

.officials-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: min(100%, 330px);
  padding: 0.65rem 0.9rem;
  text-align: left;
  color: #173f30;
  background: #fff;
  border: 1px solid #dce7df;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(24, 59, 42, 0.07);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.officials-trigger:hover {
  border-color: #a9c8b3;
  box-shadow: 0 10px 26px rgba(24, 59, 42, 0.12);
  transform: translateY(-2px);
}

.officials-trigger:focus-visible,
.kua-profile-link:focus-visible {
  outline: 3px solid rgba(25, 135, 84, 0.28);
  outline-offset: 3px;
}

.officials-trigger-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #176440;
  background: #eaf4ed;
  border-radius: 12px;
  font-size: 1.1rem;
}

.officials-trigger-label {
  display: grid;
  flex: 1;
  gap: 0.1rem;
}
.officials-trigger-label strong {
  font-size: 0.9rem;
  font-weight: 700;
}
.officials-trigger-label small {
  color: #748178;
  font-size: 0.74rem;
}
.officials-trigger-arrow {
  color: #799382;
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  .kua-profile-link,
  .officials-trigger {
    transition: none;
  }
}

#modalPejabat .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
}

/* Header */
#modalPejabat .modal-header {
  background: #fff !important;
  color: #212529 !important;
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}

#modalPejabat .modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #198754;
  letter-spacing: -0.01em;
}

#modalPejabat .modal-title i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
  border-radius: 10px;
  font-size: 0.95rem;
}

#modalPejabat .btn-close {
  opacity: 0.55;
  transition: 0.2s ease;
}

#modalPejabat .btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* Body */
#modalPejabat .modal-body {
  background: #f8f9fa;
  padding: 1.5rem !important;
}

/* Section */
#modalPejabat #data-pejabat-container > h5 {
  position: relative;
  margin-top: 1.75rem !important;
  margin-bottom: 0.75rem !important;
  padding: 0 0 0.65rem 0.85rem;
  border-bottom: 1px solid #dee2e6;
  color: #212529 !important;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#modalPejabat #data-pejabat-container > h5:first-child {
  margin-top: 0 !important;
}

#modalPejabat #data-pejabat-container > h5::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 0.65rem;
  width: 3px;
  border-radius: 4px;
  background: #198754;
}

#modalPejabat #data-pejabat-container > h5 i {
  display: none;
}

/* Table wrapper */
#modalPejabat .table-responsive {
  margin-bottom: 2rem !important;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
}

/* Table */
#modalPejabat table {
  margin-bottom: 0;
  border: 0;
  font-size: 0.875rem;
}

/* Header table */
#modalPejabat table thead {
  background: #f8f9fa;
}

#modalPejabat table thead th {
  background: #f8f9fa !important;
  color: #6c757d;
  border: 0;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Body */
#modalPejabat table tbody td {
  padding: 0.8rem 1rem;
  border: 0;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
  color: #495057;
}

#modalPejabat table tbody tr:last-child td {
  border-bottom: 0;
}

/* Nomor */
#modalPejabat table tbody td:first-child {
  width: 5%;
  color: #adb5bd;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* Nama */
#modalPejabat table tbody td:nth-child(3) {
  color: #212529;
  font-weight: 600;
}

/* Golongan */
#modalPejabat table tbody td:last-child {
  text-align: center;
  color: #198754;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Hover */
#modalPejabat table tbody tr {
  transition: background-color 0.15s ease;
}

#modalPejabat table tbody tr:hover {
  background-color: rgba(25, 135, 84, 0.035);
}

/* Footer */
#modalPejabat .modal-footer {
  background: #fff;
  border-top: 1px solid #e9ecef;
  padding: 0.85rem 1.5rem;
}

#modalPejabat .modal-footer .btn {
  border-radius: 50rem;
  padding: 0.45rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* layanan-utama.html */
.card-link {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.card-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* layanan-madrasah.html */
#ppdb-hero-photo {
  opacity: 0;
  transform: translateX(-40px);
  will-change: opacity, transform;
}

#ppdb-hero-photo.ppdb-hero-visible {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
