/* ==========================================================================
   JALIN UNIVERSE - CUSTOM ISLAMIC & BSI MOBILE STYLING (HP & LAPTOP)
   Palet Warna: BSI Islamic Teal (#00877c), Emerald (#047857), Gold/Amber (#f59e0b)
   Desain: Indah, Full Color, Nan Rounded ala BSI Mobile Banking
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  --bsi-teal: #00877c;
  --bsi-teal-light: #00a39d;
  --bsi-gold: #f59e0b;
  --bsi-gold-light: #fbbf24;
  --primary-emerald: #047857;
  --primary-dark: #064e3b;
  --primary-light: #10b981;
  --primary-subtle: #ecfdf5;
  --gold-accent: #f59e0b;
  --gold-dark: #b45309;
  --gold-light: #fef3c7;
  --bg-gradient-start: #064e3b;
  --bg-gradient-end: #022c22;
  
  /* Safe Area Inset untuk HP (Notch & Gesture Bar) */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #f6faf8;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

.font-arabic {
  font-family: 'Scheherazade New', 'Amiri', serif;
}

/* Islamic Geometric Background Pattern */
.bg-islamic-pattern {
  background-color: #00695c;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, rgba(0, 135, 124, 0.95) 0%, rgba(2, 44, 34, 0.98) 100%),
    radial-gradient(#10b981 0.75px, transparent 0.75px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
}

.bg-islamic-subtle {
  background-color: #f4fbf7;
  background-image: radial-gradient(rgba(0, 135, 124, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ================= BSI MOBILE BANKING STYLE UTILITIES ================= */

/* Kartu Hero Ala BSI Mobile */
.bsi-hero-card {
  background: linear-gradient(135deg, #00877c 0%, #047857 60%, #064e3b 100%);
  border-radius: 26px;
  box-shadow: 0 14px 28px -8px rgba(0, 135, 124, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.25);
  position: relative;
  overflow: hidden;
}

/* Container Layanan BSI Mobile */
.bsi-container {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 10px 30px -10px rgba(4, 120, 87, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.15);
}

/* Squircle Icon Box Ala BSI Mobile */
.bsi-squircle {
  border-radius: 20px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  position: relative;
}

.bsi-squircle:active {
  transform: scale(0.92);
}

@media (min-width: 640px) {
  .bsi-squircle {
    border-radius: 24px;
  }
}

/* Responsive Scrollable Header Utility (HP, Tablet, Laptop) */
.header-responsive-scroll {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(52, 211, 153, 0.4) transparent !important;
}
.header-responsive-scroll::-webkit-scrollbar {
  height: 3px !important;
  display: block !important;
}
.header-responsive-scroll::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.4) !important;
  border-radius: 9999px !important;
}
.header-responsive-scroll > * {
  flex-shrink: 0 !important;
}

/* Biometric Fingerprint Realistic Ridges & Laser Pulse */
@keyframes biometricLaser {
  0% { top: 0%; opacity: 0.3; }
  50% { top: 90%; opacity: 1; }
  100% { top: 0%; opacity: 0.3; }
}
.biometric-laser-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2dd4bf, #34d399, #2dd4bf, transparent);
  box-shadow: 0 0 12px #2dd4bf;
  animation: biometricLaser 1.8s ease-in-out infinite;
  pointer-events: none;
}
.biometric-laser-reject {
  background: linear-gradient(90deg, transparent, #f43f5e, #fb7185, #f43f5e, transparent) !important;
  box-shadow: 0 0 14px #f43f5e !important;
}

/* Glassmorphism Islamic Cards */
.glass-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.18);
  box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.06), 0 8px 10px -6px rgba(6, 78, 59, 0.04);
}

.glass-card-dark {
  background: rgba(6, 78, 59, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
}

/* Gold Islamic Badge & Borders */
.gold-border {
  border: 1.5px solid #f59e0b;
}

.gold-glow {
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

.emerald-glow {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Arabesque SVG Corner Decoration */
.arabesque-corner-br {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #047857;
}

/* Sembunyikan scrollbar untuk pengalaman swipe di HP */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Smooth Touch Scrolling untuk HP */
.touch-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Animasi Slide Up untuk Modal di HP (Native Bottom Sheet Look) */
@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-sheet-mobile {
  animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 640px) {
  .modal-sheet-mobile {
    animation: fadeInModal 0.25s ease-out forwards;
  }
}

/* Touch Friendly Mobile Bottom Padding */
.safe-bottom-padding {
  padding-bottom: calc(5.5rem + var(--sab));
}

@media (min-width: 768px) {
  .safe-bottom-padding {
    padding-bottom: 4rem;
  }
}

/* Drawer Animasi Garis 3 Admin */
@keyframes slideInLeftDrawer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-drawer-in {
  animation: slideInLeftDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsif Pembungkus Tabel untuk HP & Laptop (Otomatis Dapat Digeser Mulus) */
.table-responsive-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  scrollbar-width: thin;
}

.table-responsive-wrapper::-webkit-scrollbar {
  height: 6px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 4px;
}

/* ================= PRINT CSS KHUSUS A4 RESMI FULL COLOR ================= */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Sembunyikan elemen UI web saat cetak */
  body > *:not(#printA4Container),
  #moduleModal,
  nav,
  header,
  main,
  button,
  .no-print {
    display: none !important;
  }

  #printA4Container {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1cm 1.4cm !important;
    background: #ffffff !important;
  }

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

  .page-break {
    page-break-before: always !important;
    break-before: page !important;
  }

  .avoid-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* Animasi Pulse Sensor Sidik Jari */
@keyframes fpPulseEffect {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.fp-sensor-glow {
  animation: fpPulseEffect 2s infinite;
}

/* Animasi Laser Scan Biometrik Sidik Jari */
@keyframes biometricLaserScan {
  0% {
    top: 5%;
    opacity: 0.8;
  }
  50% {
    top: 90%;
    opacity: 1;
  }
  100% {
    top: 5%;
    opacity: 0.8;
  }
}

.biometric-laser-line {
  position: absolute;
  left: 5%;
  width: 90%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, #06b6d4, #10b981, transparent);
  box-shadow: 0 0 10px #06b6d4, 0 0 18px #10b981;
  animation: biometricLaserScan 1.2s ease-in-out infinite;
  pointer-events: none;
  border-radius: 9999px;
}

/* Animasi Radar Wave Biometrik */
@keyframes biometricRadarWave {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.biometric-radar-ring {
  animation: biometricRadarWave 1.8s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

/* Animasi Pop-in Modal Full Color */
@keyframes modalPopInEffect {
  0% {
    transform: scale(0.92) translateY(12px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.animate-modal-pop {
  animation: modalPopInEffect 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hijau NU (Nahdlatul Ulama Green #008542) */
:root {
  --hijau-nu: #008542;
  --hijau-nu-dark: #006633;
  --hijau-nu-light: #00a854;
}

.text-hijau-nu {
  color: #008542 !important;
}

.bg-hijau-nu {
  background-color: #008542 !important;
}

.border-hijau-nu {
  border-color: #008542 !important;
}

/* Garis Ganda KOP Dokumen Resmi Berwarna Hijau NU & Emas */
.kop-double-line {
  border-bottom: 3px solid #008542;
  border-top: 1px solid #008542;
  height: 5px;
  margin-top: 6px;
  margin-bottom: 14px;
}

/* Touch Action & Styling Signature Pad Digital Pengusul */
canvas#permitSignaturePad {
  touch-action: none !important;
  -webkit-user-select: none;
  user-select: none;
}
