/* Custom styles for SIM-RT */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Safe area padding for iPhones / notch */
.safe-bottom {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Smooth Touch Scrolling for Tables */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* Prevent auto-zoom on mobile inputs in Safari/Chrome */
@media (max-width: 640px) {
  input, select, textarea {
    font-size: 15px !important;
  }
}

/* Off-canvas Sliding Drawer on Mobile (<768px) */
@media (max-width: 767px) {
  #sidebar-nav.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 300px);
    z-index: 55;
    background: #ffffff;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.25);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: block !important;
    padding: 16px 14px;
  }

  #sidebar-nav.mobile-drawer.open {
    transform: translateX(0);
  }

  #mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  #mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Make modal dialogs fit mobile screens comfortably */
  .fixed.inset-0 .max-h-\[90vh\],
  .fixed.inset-0 .max-h-\[92vh\],
  .fixed.inset-0 .max-h-\[95vh\] {
    max-height: 88vh !important;
  }
}

/* Bottom Navigation Active States */
.bottom-nav-item.active {
  color: #059669;
}
.bottom-nav-item.active.role-warga {
  color: #7c3aed;
}
.bottom-nav-item.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.25));
}
.bottom-nav-item.active.role-warga i {
  filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.3));
}

/* Print Styling for Kuitansi */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-receipt-area, #printable-receipt-area * {
    visibility: visible;
  }
  #printable-receipt-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: white;
  }
  .no-print {
    display: none !important;
  }
}

/* Pulse animation for QR Waiting */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.pulse-qr {
  animation: pulse-subtle 2s infinite ease-in-out;
}

/* ================= SMOOTH UI ENHANCEMENTS & POPUPS ================= */
/* Smooth modal overlay & zoom transition */
.modal-overlay {
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1);
  opacity: 1;
}
.modal-overlay.hidden .modal-card {
  transform: scale(0.96);
  opacity: 0;
}

/* Smooth Tab Fade Transition */
.tab-pane {
  animation: smoothTabIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes smoothTabIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Interactive Clickable Info Cards & Rows */
.clickable-info-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.clickable-info-row:hover {
  background-color: #f1f5f9;
}
.clickable-info-row:active {
  transform: scale(0.995);
}

.clickable-card {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}
.clickable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}
.clickable-card:active {
  transform: scale(0.985);
}

/* Info badge pill with micro-interaction */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.info-badge:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

/* GPU Acceleration & Performance Optimization for Mobile */
.tab-pane {
  contain: content;
  transform: translateZ(0);
}

.overflow-x-auto, #gang-kas-mobile-list, #warga-kas-table-body {
  -webkit-overflow-scrolling: touch;
}


