/* styles.css - Custom Styling & Thermal Receipt Printing untuk Kasirku Pro */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --receipt-width: 58mm;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism subtle utilities */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

/* Modal Fade Animation */
.modal-enter {
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Toast Notifications */
.toast-enter {
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Number Input without Spinner */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Scanner Viewport */
#scanner-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
}

#scanner-container video {
  border-radius: 12px;
  object-fit: cover;
}

/* Thermal Receipt Paper Preview Screen */
.receipt-paper-screen {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-family: 'JetBrains Mono', Courier, monospace;
}

/* ==============================================================
   PRINT STYLES: Dioptimalkan untuk Printer Thermal 58mm / 80mm
   ============================================================== */
@media print {
  /* Sembunyikan semua elemen aplikasi di layar */
  body * {
    visibility: hidden;
  }

  /* Hilangkan margin default browser */
  @page {
    margin: 0;
    size: auto;
  }

  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Tampilkan hanya area struk */
  #receipt-printable, #receipt-printable * {
    visibility: visible !important;
  }

  #receipt-printable {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--receipt-width, 58mm);
    margin: 0 auto;
    padding: 4mm 2mm;
    color: #000000 !important;
    background: #ffffff !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }

  .print-divider {
    border-top: 1px dashed #000 !important;
    margin: 6px 0 !important;
  }

  .print-double-divider {
    border-top: 1px double #000 !important;
    margin: 6px 0 !important;
  }
}
