/* SIMK-Panti Custom Styles & Perfect Print Optimization */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Custom Scrollbar - Dark Sidebar Theme */
.dark-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.dark-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.dark-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.dark-scrollbar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
.dark-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* PERFECT 1-PAGE PRINT CSS RULES */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  /* Reset html, body, and root container */
  html, body, #root, main {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Hide all UI elements: headers, navbars, footers, buttons, banners, toasts */
  header,
  nav,
  footer,
  .no-print,
  .simulasi-banner,
  .toast-alert,
  button {
    display: none !important;
    visibility: hidden !important;
  }

  /* When modal receipt is open, hide the main page behind it */
  body:has(.fixed.inset-0) main {
    display: none !important;
  }

  /* Reset modal overlay backdrop to plain white paper background */
  .fixed.inset-0 {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Reset modal dialog card dimensions */
  .max-h-\[92vh\], 
  .max-h-\[90vh\], 
  .max-w-xl, 
  .max-w-2xl {
    max-height: none !important;
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 5px !important;
    margin: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  /* Document Printable Area */
  .printable-area {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
  }

  .bg-slate-50 {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
  }

  .bg-white {
    background-color: #ffffff !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
  }
}
