/* Custom CSS and Styles for Mobile-First Order & Receive System
 * Theme: Soothing Dark Mode with Gradient Grays, Charcoal, Espresso & Fresh Lime Accent
 */

:root {
  --app-bg: #0d0d10;
  --app-frame: #131317;
  --app-card-bg: #18181e;
  --app-card-border: #262630;
  --app-lime: #e5ff7d;
  --app-lime-hover: #d4f844;
  --app-lime-dark: #a3ca10;
  --app-lime-bg: rgba(229, 255, 125, 0.12);
  --app-brown-900: #180f0a;
  --app-brown-800: #261710;
  --app-brown-700: #3b2318;
  --app-brown-600: #543425;
  --app-dark: #0d0d10;
  --app-text-primary: #e2e2e8;
  --app-text-secondary: #9e9ea8;
  --app-text-muted: #6c6c78;
  --app-danger: #f43f5e;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai+Looped:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

.material-symbols-rounded,
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

body {
  font-family: 'Noto Sans Thai Looped', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background-color: var(--app-bg);
  color: var(--app-text-primary);
}

/* Smooth Scrolling & Hide default scrollbars */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Glassmorphism effects for Dark Mode with Gradient Grays */
.glass-nav {
  background: rgba(19, 19, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.glass-dark {
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.glass-card {
  background: rgba(24, 24, 30, 0.95);
  backdrop-filter: blur(10px);
}

/* Soft Silver-Gray Gradient Text */
.text-gradient-gray {
  background: linear-gradient(135deg, #f0f0f4 0%, #b8b8c4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-soft {
  background: linear-gradient(135deg, #e4e4eb 0%, #9e9ea8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Interactive touch feedback */
.touch-press {
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.1s;
}
.touch-press:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Bright & Distinct Action Cards for Hub Screen */
.action-card-hub {
  background: linear-gradient(180deg, #2c303e 0%, #20232e 100%);
  border: 1.5px solid #4c5368;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.action-card-hub:hover {
  background: linear-gradient(180deg, #353a4b 0%, #262a37 100%);
  border-color: #e5ff7d;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(229, 255, 125, 0.25);
}
.action-card-hub:active {
  transform: scale(0.96);
  background: #1c1e28;
}

/* Bright & Distinct Product Item Cards for Order Catalog */
.product-card-item {
  background: linear-gradient(180deg, #282b37 0%, #1e2029 100%);
  border: 1.5px solid #454b5e;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.12s ease-in-out;
}
.product-card-item:hover {
  background: linear-gradient(180deg, #303443 0%, #242732 100%);
  border-color: #6a738f;
}
.product-card-item:active {
  transform: scale(0.98);
}

.product-card-item-ordered {
  background: linear-gradient(180deg, #24351a 0%, #192612 100%);
  border: 1.5px solid #5d8220;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(229, 255, 125, 0.15);
}

/* Sleek Metallic Silver Gradient Buttons */
.btn-silver {
  background: linear-gradient(180deg, #5a5e6d 0%, #434754 50%, #353844 100%);
  color: #ffffff;
  border: 1px solid #73788a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.12s ease-in-out;
}
.btn-silver:hover {
  background: linear-gradient(180deg, #686d7e 0%, #4f5464 50%, #3e4250 100%);
  border-color: #8c92a6;
  color: #ffffff;
}
.btn-silver:active {
  transform: scale(0.95);
  background: linear-gradient(180deg, #353844 0%, #262832 100%);
  border-color: #e5ff7d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-silver-subtle {
  background: linear-gradient(180deg, #454958 0%, #333644 100%);
  color: #f1f2f6;
  border: 1px solid #5d6274;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: all 0.12s ease-in-out;
}
.btn-silver-subtle:hover {
  background: linear-gradient(180deg, #53586a 0%, #3e4252 100%);
  border-color: #72778c;
  color: #ffffff;
}
.btn-silver-subtle:active {
  transform: scale(0.95);
  background: #252732;
}

/* Keypad Numpad Buttons in Rich Metallic Silver Gradient */
.numpad-btn {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 800;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #545868 0%, #3e4250 50%, #303340 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.28);
  border: 1px solid #6f7486;
  transition: all 0.1s ease-in-out;
}
.numpad-btn:hover {
  background: linear-gradient(180deg, #626779 0%, #494e5d 50%, #3a3d4c 100%);
  border-color: #8c92a6;
}
.numpad-btn:active {
  transform: scale(0.93);
  background: linear-gradient(180deg, #303340 0%, #20222b 100%);
  border-color: #e5ff7d;
  color: #e5ff7d;
  box-shadow: 0 0 12px rgba(229, 255, 125, 0.4);
}

.numpad-btn-action {
  background: linear-gradient(180deg, #444754 0%, #303340 100%);
  color: #dcdce6;
  border-color: #5c6072;
}
.numpad-btn-action:active {
  background: #22242e;
  border-color: #e5ff7d;
  color: #ffffff;
}

.numpad-btn-quick {
  background: linear-gradient(180deg, #4d5162 0%, #363946 100%);
  color: #ffffff;
  border: 1px solid #666b7e;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.numpad-btn-quick:active {
  background: #e5ff7d;
  border-color: #e5ff7d;
  color: #121215;
}

/* Floating Drawer Animations */
.drawer-backdrop {
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-content {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pulsing badge animation */
@keyframes soft-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.04); }
}
.animate-soft-pulse {
  animation: soft-pulse 2s infinite ease-in-out;
}

/* Custom Checkbox Dark */
input[type="checkbox"].custom-check {
  accent-color: #e5ff7d;
  width: 1.35rem;
  height: 1.35rem;
  cursor: pointer;
}

/* Floating Bottom Cart */
.floating-bottom-bar {
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.6);
}

/* Print styling for preparation list */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }
  .no-print {
    display: none !important;
  }
}

/* SweetAlert2 Theme Styling Dark Mode with Soothing Grays */
.swal2-popup {
  font-family: 'Noto Sans Thai Looped', sans-serif !important;
  border-radius: 1.75rem !important;
  padding: 1.5rem !important;
  max-width: 92vw !important;
  width: 380px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
  background: linear-gradient(180deg, #191920 0%, #131317 100%) !important;
  border: 1px solid #282834 !important;
  color: #e2e2e8 !important;
}
.swal2-title {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #ececf0 !important;
  padding-bottom: 0.25rem !important;
}
.swal2-html-container {
  font-size: 0.875rem !important;
  color: #9e9ea8 !important;
  margin: 0.5rem 0 1rem 0 !important;
}
.swal-field-label {
  display: block;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9e9ea8;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}
input.swal-custom-input,
.swal-custom-input,
#swal-add-unit,
#swal-prod-unit,
#swal-add-name,
#swal-prod-name {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: 0.95rem;
  border: 1.5px solid #4a4f63;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Noto Sans Thai Looped', sans-serif;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background-color: #1c1f2a !important;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
input.swal-custom-input::placeholder,
.swal-custom-input::placeholder {
  color: #80869a;
  -webkit-text-fill-color: #80869a;
  font-weight: normal;
}
input.swal-custom-input:focus,
.swal-custom-input:focus {
  border-color: #e5ff7d;
  background-color: #232736 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(229, 255, 125, 0.3);
}

/* Unit preset chips inside SweetAlert */
.swal-unit-btn,
.swal2-html-container .btn-silver {
  background: linear-gradient(180deg, #4f5364 0%, #393d4c 50%, #2b2e3a 100%) !important;
  color: #ffffff !important;
  border: 1px solid #6b7084 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 0.75rem !important;
  cursor: pointer !important;
  transition: all 0.12s ease-in-out !important;
}
.swal-unit-btn:hover,
.swal2-html-container .btn-silver:hover {
  background: linear-gradient(180deg, #606579 0%, #474c5d 50%, #363948 100%) !important;
  border-color: #8c92a6 !important;
  color: #ffffff !important;
}
.swal-unit-btn:active,
.swal2-html-container .btn-silver:active {
  background: #e5ff7d !important;
  border-color: #e5ff7d !important;
  color: #121215 !important;
  transform: scale(0.95) !important;
}
.swal2-actions {
  margin-top: 1.25rem !important;
  gap: 0.5rem !important;
  width: 100% !important;
}
.swal2-confirm {
  background-color: #e5ff7d !important;
  color: #121215 !important;
  font-family: 'Noto Sans Thai Looped', sans-serif !important;
  border-radius: 0.875rem !important;
  font-weight: 800 !important;
  font-size: 0.875rem !important;
  padding: 0.75rem 1.5rem !important;
  flex: 1 !important;
  box-shadow: 0 4px 14px rgba(229, 255, 125, 0.25) !important;
}
.swal2-cancel {
  background-color: #202028 !important;
  color: #9e9ea8 !important;
  font-family: 'Noto Sans Thai Looped', sans-serif !important;
  border-radius: 0.875rem !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.75rem 1.25rem !important;
  border: 1px solid #2c2c38 !important;
}
.swal2-cancel:hover {
  color: #ececf0 !important;
}

/* Hide browser default datalist dropdown arrow indicator (removes overlapping arrow icon) */
input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
}

input[list]::-moz-list-bullet {
  display: none !important;
}

/* ==========================================================================
   Admin 6-Digit PIN Security Keypad & Dots
   ========================================================================== */
.pin-dot {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  border: 2px solid #383848;
  background-color: transparent;
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

.pin-dot.filled {
  background-color: #e5ff7d !important;
  border-color: #e5ff7d !important;
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

.pin-shake {
  animation: pin-shake-anim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pin-shake-anim {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* ==========================================================================
   Admin Menu Grid Card Styles (redesigned)
   ========================================================================== */
.admin-grid-card {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  position: relative;
  background: linear-gradient(145deg, #1c1c24 0%, #15151b 100%);
  border: 1px solid #2a2a36;
  border-radius: 1.15rem;
  padding: 14px 14px 14px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 0;
  height: auto;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  overflow: visible;
  box-sizing: border-box;
  width: 100%;
}

.admin-grid-card:hover {
  border-color: #3e3e4e;
  transform: translateY(-1px);
  background: linear-gradient(145deg, #22222c 0%, #181820 100%);
}

.admin-grid-card:active {
  transform: scale(0.98);
  opacity: 0.95;
}

.admin-grid-card.active {
  border-color: #e5ff7d;
  background: linear-gradient(145deg, rgba(229, 255, 125, 0.14) 0%, #191922 100%);
  box-shadow: 0 4px 18px rgba(229, 255, 125, 0.15);
}

.admin-grid-card .admin-grid-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-grid-card .admin-grid-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.admin-grid-card .admin-grid-title {
  font-size: 13px;
  font-weight: 600;
  color: #ececf0;
  line-height: 1.35;
  word-break: break-word;
}

.admin-grid-card .admin-grid-sub {
  font-size: 11px;
  font-weight: 500;
  color: #9e9ea8;
  line-height: 1.35;
  word-break: break-word;
}

.admin-grid-card .admin-grid-badge {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e5ff7d;
  color: #121215;
  line-height: 1.2;
}

.admin-grid-card.active .admin-grid-badge {
  display: inline-flex;
}

/* =============================================================
   Thermal Receipt 58mm POS Print Styles
   ============================================================= */
@media print {
  @page {
    size: 58mm auto;
    margin: 0;
  }
  
  html, body {
    width: 58mm !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Completely hide all app elements and overlays */
  body > *:not(#print-thermal-receipt),
  .swal2-container,
  .swal2-backdrop-show,
  .swal2-popup {
    display: none !important;
    visibility: hidden !important;
  }

  #print-thermal-receipt {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 58mm !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 2mm 3mm 12mm 3mm !important;
    box-sizing: border-box !important;
    font-family: 'Courier New', Courier, monospace, 'Sarabun', sans-serif !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  #print-thermal-receipt * {
    visibility: visible !important;
    color: #000000 !important;
  }

  .thermal-58mm-slip {
    width: 100% !important;
    page-break-after: always !important;
    break-after: page !important;
  }

  .thermal-58mm-slip:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}

/* SweetAlert2 Mobile-Friendly Wide Container (Zero padding/margin for custom content) */
.swal2-popup {
  padding: 1.25rem 1rem !important;
}

.swal2-html-container {
  padding: 0 !important;
  margin: 0.5rem 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: hidden !important;
}

.swal2-title {
  padding: 0 0 0.5rem 0 !important;
  font-size: 1.1rem !important;
}
