/* ============================================================
   JADI DUIT - SISTEM PENYETORAN MINYAK JELANTAH
   Custom Styles, Member Card Themes, & Print Stylesheets
   ============================================================ */

:root {
  --primary: #059669;
  --primary-dark: #064e3b;
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Glassmorphism effects */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Modern POS Card & Input Enhancements */
.pos-input-hero:focus-within {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), 0 10px 25px -5px rgba(16, 185, 129, 0.1);
  border-color: #10b981 !important;
}

.pos-btn-quick {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
}
.pos-btn-quick:hover {
  transform: translateY(-1px);
}
.pos-btn-quick:active {
  transform: scale(0.95);
}

.pos-payout-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pos-payout-card:hover {
  transform: translateY(-1px);
}
.pos-payout-card:active {
  transform: scale(0.98);
}

/* ============================================================
   KARTU MEMBER KONSUMEN (ISO 7810 ID-1 RATIO: 85.6mm x 54mm)
   Aspect Ratio: 1.586
   ============================================================ */
.member-card-wrapper {
  perspective: 1000px;
}

.member-card-front,
.member-card-back {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1.586;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(5, 150, 105, 0.25), 0 10px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.member-card-front:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 32px rgba(5, 150, 105, 0.32), 0 12px 14px rgba(0, 0, 0, 0.15);
}

/* Emerald & Gold Theme */
.card-theme-emerald {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 40%, #047857 75%, #059669 100%);
  color: #ffffff;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
}

/* Card Pattern Overlay */
.card-pattern-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.25) 0%, transparent 40%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 2px, transparent 2px, transparent 10px);
  pointer-events: none;
}

/* Chip EMV Simulation */
.emv-chip {
  width: 42px;
  height: 32px;
  background: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
  border-radius: 6px;
  border: 1px solid #a16207;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.emv-chip::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(to right, transparent 48%, rgba(113, 63, 18, 0.7) 49%, rgba(113, 63, 18, 0.7) 51%, transparent 52%),
    linear-gradient(to bottom, transparent 48%, rgba(113, 63, 18, 0.7) 49%, rgba(113, 63, 18, 0.7) 51%, transparent 52%);
  border-radius: 4px;
}

/* Hologram sticker simulation */
.hologram-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a7f3d0, #fef08a, #fed7aa, #93c5fd);
  background-size: 200% 200%;
  opacity: 0.85;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  animation: shimmer 4s infinite alternate;
}

@keyframes shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* Magnetic stripe on back of card */
.magnetic-stripe {
  height: 42px;
  width: 100%;
  background: #1e293b;
  margin-top: 24px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* ============================================================
   THERMAL RECEIPT STYLING (58mm / 80mm POS Slip)
   ============================================================ */
.receipt-paper {
  width: 320px;
  background: #fff;
  padding: 18px 16px;
  font-family: 'Courier New', Courier, monospace;
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  border-top: 4px dashed #059669;
  border-bottom: 4px dashed #059669;
}

.receipt-dotted-line {
  border-top: 1px dashed #6b7280;
  margin: 8px 0;
}

.receipt-double-line {
  border-top: 2px double #374151;
  margin: 8px 0;
}

/* ============================================================
   PRINT STYLES: PRINT KARTU & PRINT STRUK
   ============================================================ */
@media print {
  /* Sembunyikan semua elemen selain print area */
  body * {
    visibility: hidden !important;
  }

  /* Jika mencetak Kartu Member */
  body.printing-card #printable-card-area,
  body.printing-card #printable-card-area * {
    visibility: visible !important;
  }

  body.printing-card #printable-card-area {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 85.6mm !important;
    margin: 0 auto;
    padding: 0;
    page-break-inside: avoid;
  }

  body.printing-card .member-card-front,
  body.printing-card .member-card-back {
    width: 85.6mm !important;
    height: 54mm !important;
    max-width: none !important;
    margin-bottom: 10mm;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Jika mencetak Struk Kasir */
  body.printing-receipt #printable-receipt-area,
  body.printing-receipt #printable-receipt-area * {
    visibility: visible !important;
  }

  body.printing-receipt #printable-receipt-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 2mm !important;
    font-size: 11px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    margin: 4mm;
  }
}

/* Pulse animation for quick buttons */
.btn-quick-active {
  background-color: #047857 !important;
  color: white !important;
  transform: scale(0.97);
}

/* ============================================================
   SMARTPHONE & MOBILE-SPECIFIC OPTIMIZATIONS
   ============================================================ */

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn.active {
  color: #059669;
}

.mobile-nav-btn.active svg {
  stroke: #059669;
  transform: translateY(-2px);
}

.mobile-nav-btn.active::after {
  content: '';
  position: absolute;
  top: 4px;
  width: 20px;
  height: 3px;
  background: #059669;
  border-radius: 999px;
}

/* Mobile responsive member card scaling */
@media (max-width: 480px) {
  .member-card-front,
  .member-card-back {
    max-width: 100%;
    padding: 14px !important;
    border-radius: 14px;
  }

  .member-card-front #card-display-name {
    font-size: 13px !important;
    max-width: 170px !important;
  }

  .member-card-front #card-display-id {
    font-size: 16px !important;
  }

  .emv-chip {
    width: 36px;
    height: 28px;
  }

  .hologram-seal {
    width: 32px;
    height: 32px;
  }

  #card-qrcode-box {
    width: 62px !important;
    height: 62px !important;
  }

  #card-qrcode-box canvas,
  #card-qrcode-box img {
    width: 60px !important;
    height: 60px !important;
  }
}

/* Smooth mobile touch scrolling */
.mobile-scroll {
  -webkit-overflow-scrolling: touch;
}

/* Big tap targets for mobile */
@media (max-width: 640px) {
  input, select, textarea, button {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  .mobile-text-xs {
    font-size: 12px !important;
  }

  .mobile-p-3 {
    padding: 12px !important;
  }
}
