/* =========================================================
   SnackPOS - Edisi Kasir Retail Minimarket (Alfamart Style)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  --alfa-red: #d61823;
  --alfa-red-dark: #b91c1c;
  --alfa-yellow: #ffcc00;
  --alfa-blue: #0055a5;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Header Khas Kasir Retail */
.alfa-header {
  background: linear-gradient(135deg, #d61823 0%, #b91c1c 100%);
  color: #ffffff;
  border-bottom: 3px solid #ffcc00;
}

/* Kotak Layar LED Total Digital Kasir */
.pos-led-display {
  background: #090d16;
  border: 2px solid #1e293b;
  border-radius: 1rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0,0,0,0.15);
  font-family: var(--font-mono);
}

.pos-led-label {
  color: #fbbf24;
  letter-spacing: 0.1em;
}

.pos-led-total {
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.pos-led-change {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* Tabel Scan Kasir Kontras Tinggi */
.pos-table-header {
  background-color: #0055a5;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pos-table-row {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.15s ease;
}

.pos-table-row:hover {
  background-color: #f8fafc;
}

/* Sorot Baris Barang yang Baru Saja Discan */
.active-scan-row {
  background-color: #fef3c7 !important;
  border-left: 4px solid #d61823 !important;
  animation: scanHighlight 1s ease-out;
}

@keyframes scanHighlight {
  0% { background-color: #fde047; }
  100% { background-color: #fef3c7; }
}

/* Tombol Fungsi Keyboard Kasir (F1 - F10) */
.f-key-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.7rem;
  color: #ffffff;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  min-width: 65px;
}

.f-key-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.f-key-btn:active {
  transform: translateY(1px);
}

.f-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 900;
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  margin-bottom: 0.15rem;
  line-height: 1;
}

/* Warna Khas Tombol Kasir */
.btn-f-red { background-color: #d61823; }
.btn-f-blue { background-color: #0055a5; }
.btn-f-amber { background-color: #d97706; }
.btn-f-green { background-color: #16a34a; }
.btn-f-purple { background-color: #7c3aed; }
.btn-f-slate { background-color: #475569; }

/* Status Indikator Cloud Supabase */
.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.cloud-online {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.cloud-offline {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.cloud-syncing {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde047;
}

/* Struk Thermal Kertas Kasir */
.thermal-receipt {
  font-family: var(--font-mono);
  background: #ffffff;
  color: #000000;
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  margin: 0 auto;
}

.thermal-receipt.width-58 {
  max-width: 320px;
  width: 100%;
  font-size: 11px;
  line-height: 1.35;
}

.thermal-receipt.width-80 {
  max-width: 420px;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
}

.receipt-dashed-line {
  border-top: 1px dashed #475569;
  margin: 0.5rem 0;
}

.receipt-double-line {
  border-top: 2px dashed #0f172a;
  margin: 0.5rem 0;
}

/* CSS Print Struk Kasir Thermal */
@media print {
  body * {
    visibility: hidden;
  }
  
  #printable-receipt-container,
  #printable-receipt-container * {
    visibility: visible;
  }

  #printable-receipt-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .thermal-receipt {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 2mm !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    color: #000000 !important;
  }

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

/* =========================================================
   PENGATURAN TAMPILAN RESPONSIVE MOBILE / SMARTPHONE (HP)
   ========================================================= */
@media (max-width: 768px) {
  /* Hilangkan horizontal overflow berlebih */
  html, body {
    overflow-x: hidden;
    touch-action: manipulation;
  }

  /* Padding bawah untuk memberi ruang navigasi mobile */
  main {
    padding-bottom: 5.5rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Display LED lebih proporsional di layar kecil */
  .pos-led-display {
    padding: 0.75rem !important;
    border-radius: 0.875rem !important;
  }

  .pos-led-total {
    font-size: 1.65rem !important;
  }

  /* Optimasi tabel keranjang di layar HP */
  .pos-table-row td {
    padding: 0.5rem 0.35rem !important;
  }

  /* Tombol stepper Qty yang nyaman ditekan jempol */
  .qty-btn-touch {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
  }

  /* Modal fullscreen atau bottom sheet yang nyaman di HP */
  .modal-backdrop > div {
    max-height: 94vh !important;
    border-radius: 1.25rem !important;
    margin: 0.5rem !important;
  }

  /* Navigasi bawah HP */
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn:active {
    transform: scale(0.95);
  }
}
