/* BantuWarung.id - Custom Styling, Design Tokens, & Print Layouts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg-app: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 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;
}

/* Hide Scrollbar Utility for Mobile */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Safe Area & Touch Enhancements */
.safe-area-bottom {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  /* Prevent horizontal shaking and clipping */
  body, html {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    -webkit-text-size-adjust: 100%;
  }

  /* Compact glass card padding on small screens */
  .glass-card {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }

  /* Touch-friendly minimum touch target & tap optimization */
  button, input, select, a {
    touch-action: manipulation;
  }

  /* Smooth momentum scrolling for mobile overflow containers */
  .overflow-x-auto, .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
  }

  /* Modal responsive sizing */
  .modal-dialog, [id^="modal-"] > div {
    max-height: 90vh !important;
    margin: 0.5rem !important;
  }
}

/* Glassmorphism Classes */
.glass-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-card);
}

.card-hover {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Input Focus Ring */
.input-focus {
  transition: all 0.15s ease-in-out;
}
.input-focus:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Preset Button Animation */
.preset-btn {
  transition: all 0.15s ease;
}
.preset-btn:active {
  transform: scale(0.96);
}

/* Pulse Indicator */
.pulse-green {
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Promo Slider Custom Track */
.promo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: linear-gradient(to right, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  outline: none;
}
.promo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.promo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.promo-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Badge Glow */
.badge-vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  /* Hide all interactive UI elements and main wrappers so only #print-area prints */
  #auth-gate-screen, #app-wrapper, #modal-auth, #modal-upgrade, #modal-qris, #modal-print, #modal-custom-rates, #modal-mass-recalc, header, nav, #app-tabs, #mobile-bottom-nav, #action-toolbar, .no-print, button, input, .preset-buttons, #toast-container, .modal-backdrop {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #print-area {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10mm !important;
  }

  .print-page-break {
    page-break-after: always;
  }

  /* Thermal printer mode if class active */
  body.thermal-mode {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 9pt !important;
    line-height: 1.2 !important;
  }
  body.thermal-mode #print-area {
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 2mm !important;
    margin: 0 auto !important;
  }
  body.thermal-mode .thermal-divider {
    border-top: 1px dashed #000000 !important;
    margin: 4px 0 !important;
  }
}
