/* style.css */
body.print-body { 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
  background-color: #f3f4f6;
  padding: 20px;
  margin: 0;
}

.cards-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.member-card { 
  width: 100%;
  max-width: 400px; 
  min-height: 220px; 
  background: white;
  border-radius: 12px; 
  padding: 20px; 
  box-sizing: border-box;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  page-break-inside: avoid;
  break-inside: avoid;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: #43489e; 
}

.card-header { 
  text-align: center; 
  border-bottom: 2px solid #f3f4f6; 
  margin-bottom: 15px; 
  padding-bottom: 10px; 
}

.card-header h2 { 
  margin: 0; 
  font-size: 18px; 
  color: #1f2937; 
  letter-spacing: 1px;
}

.card-header p { 
  margin: 4px 0 0 0; 
  font-size: 11px; 
  color: #6b7280; 
  text-transform: uppercase;
}

.card-content { 
  font-size: 14px; 
  line-height: 1.8; 
  color: #374151;
}

.card-content strong { 
  display: inline-block; 
  width: 110px; 
  color: #111827;
}

.card-footer { 
  position: absolute; 
  bottom: 15px; 
  right: 20px; 
  font-size: 10px; 
  color: #9ca3af; 
  font-family: monospace;
}

/* --- PERBAIKAN UNTUK CETAK (PRINT) AGAR TIDAK MEMBUANG KERTAS --- */
@media print {
  body.print-body { 
    background-color: white; 
    padding: 0; 
  }
  .cards-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
  }
  .member-card { 
    width: 100%;
    max-width: 9.5cm;
    height: auto;
    min-height: 5.5cm;
    padding: 15px;
    box-shadow: none; 
    border: 1px dashed #000;
    border-radius: 0;
    margin: 0 auto;
  }
  
  .card-header h2 { font-size: 14px; }
  .card-header p { font-size: 9px; }
  .card-content { font-size: 12px; line-height: 1.5; }
  .card-content strong { width: 90px; }
  .card-footer { font-size: 9px; bottom: 10px; right: 15px; }

  @page {
    size: A4 portrait;
    margin: 1cm;
  }
}

/* ==========================================
   UI MODERN & SMARTPHONE-FRIENDLY
   ========================================== */

html, body {
  height: 100dvh;
  background-color: #e9eef8;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* Transisi halus sidebar dinamis */
#sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease-in-out;
}

.sidebar-item {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab aktif menyatu dengan latar konten di desktop */
.sidebar-item.active {
  background-color: #f4f6fc !important;
  color: #4338ca !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(20, 25, 60, 0.08);
}

.card {
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

/* Scroll tabel responsif & halus di layar sentuh */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.overflow-x-auto::-webkit-scrollbar {
  height: 5px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background-color: rgba(67, 72, 158, 0.25);
  border-radius: 9999px;
}

/* Penyesuaian khusus layar Smartphone (< 768px) */
@media (max-width: 767px) {
  body.print-body {
    padding: 10px;
  }

  .member-card {
    padding: 14px;
    min-height: 195px;
  }

  .card-content strong {
    width: 92px;
  }

  /* Netralkan tab menjorok ke kanan saat drawer sidebar dibuka di HP */
  #sidebar .sidebar-item,
  #sidebar .sidebar-item.active {
    margin-right: 0 !important;
    padding-right: 0.875rem !important;
    border-radius: 0.75rem !important;
  }

  /* Mencegah layar HP auto-zoom saat kolom input/select diklik */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Modal popup pas layar HP & bisa di-scroll saat keyboard muncul */
  #modalContainer > div,
  .modal-content {
    width: 94vw !important;
    max-height: 88dvh !important;
    overflow-y: auto !important;
    margin: auto;
    border-radius: 1.25rem !important;
  }

  #mainContent {
    padding: 0.875rem !important;
  }

  #mainContent .rounded-3xl {
    border-radius: 1.25rem;
  }
}

/* Target sentuh tombol lebih nyaman untuk jari di layar sentuh */
@media (pointer: coarse) {
  table button,
  table a {
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==========================================
   ANIMASI HALAMAN LOGIN PERPUSTAKAAN
   ========================================== */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes cloudDrift {
  0%, 100% { transform: translateX(0px); }
  50% { transform: translateX(12px); }
}

@keyframes bulbGlow {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.7)); }
  50% { opacity: 0.75; transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(250, 204, 21, 1)); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-float {
  animation: floatSlow 4.5s ease-in-out infinite;
}

.anim-cloud {
  animation: cloudDrift 6s ease-in-out infinite;
}

.anim-cloud-delay {
  animation: cloudDrift 7.5s ease-in-out infinite reverse;
}

.anim-bulb {
  transform-origin: center;
  animation: bulbGlow 2.4s ease-in-out infinite;
}

.anim-login-panel {
  animation: slideInRight 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-hero-text {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Animasi Top Progress Bar Global Loading */
@keyframes loadingBarSlide {
  0% { transform: translateX(-100%); width: 45%; }
  50% { transform: translateX(40%); width: 65%; }
  100% { transform: translateX(220%); width: 45%; }
}

.animate-loading-bar {
  animation: loadingBarSlide 1.35s ease-in-out infinite;
}

@media (max-width: 767px) {
  /* Pastikan overlay tidak memblokir sentuhan saat sidebar tertutup */
  #sidebar.-translate-x-full ~ #sidebarOverlay,
  #sidebarOverlay.hidden {
    display: none !important;
    pointer-events: none !important;
  }
}

/* Animasi Running Text Header POB & Watermark Perusahaan */
@keyframes pobMarqueeScroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.pob-marquee-wrapper {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.pob-marquee-track {
  display: inline-flex;
  align-items: center;
  width: max-content;
  animation: pobMarqueeScroll 38s linear infinite;
}

.pob-marquee-wrapper:hover .pob-marquee-track {
  animation-play-state: paused;
}

.wm-gold {
  color: #d97706;
  font-weight: 800;
  letter-spacing: 0.02em;
}