/* ============================================================
   GLAMPOS v4 — Custom CSS  (Tailwind handles utilities)
   Tablet-first responsive design for beauty & therapy POS
   ============================================================ */

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ---- Sidebar ---- */
.sidebar-gradient {
  background: linear-gradient(180deg, #0f172a 0%, #131f34 100%);
}

/* ---- POS Layout — Tablet optimized ---- */
.pos-wrap {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.pos-left {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}
.pos-right {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-left: 1px solid #f1f5f9;
  overflow: hidden;
}

/* Mobile (< 640px): stack vertically */
@media (max-width: 639px) {
  .pos-wrap { flex-direction: column; height: auto; min-height: calc(100vh - 56px); }
  .pos-left  { max-height: 50vh; min-height: 200px; }
  .pos-right { width: 100%; flex: 1; }
}

/* Small tablet portrait (640px - 767px): side by side, narrower cart */
@media (min-width: 640px) and (max-width: 767px) {
  .pos-right { width: 280px; }
}

/* Tablet (768px - 1023px): optimized for iPad */
@media (min-width: 768px) and (max-width: 1023px) {
  .pos-right { width: 320px; }
  .pos-left { padding: 12px; }
}

/* ---- Touch-friendly targets ---- */
@media (pointer: coarse) {
  .touch-target { min-height: 44px; min-width: 44px; }
  button, a[role="button"], .pay-btn, .cat-pill, .item-card {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ---- Item card hover ---- */
.item-card {
  transition: transform 0.13s ease, box-shadow 0.13s ease, border-color 0.13s ease;
}
.item-card:not(.sold-out):hover,
.item-card:not(.sold-out):active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(184,134,11,0.15), 0 4px 8px -2px rgba(0,0,0,0.06);
  border-color: #d4a017;
}
.item-card:not(.sold-out):active {
  transform: translateY(0);
}
.item-card.sold-out { opacity: 0.45; cursor: not-allowed; }

/* ---- Modal backdrop animation ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
}
.modal-panel {
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---- Stat card hover ---- */
.stat-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.08);
}

/* ---- Gold gradient button ---- */
.btn-gold {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  transition: filter 0.12s ease, transform 0.1s ease;
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* ---- Charge button ---- */
.charge-btn {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  transition: filter 0.13s ease;
}
.charge-btn:hover:not(:disabled) { filter: brightness(1.08); }
.charge-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* ---- Nav link active ---- */
.nav-active {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
}

/* ---- SweetAlert2 custom theme ---- */
.swal2-popup.swal-glam {
  font-family: 'Inter', sans-serif !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.18) !important;
}
.swal2-popup.swal-glam .swal2-title {
  font-size: 1rem !important; font-weight: 600 !important; color: #0f172a !important;
}
.swal2-popup.swal-glam .swal2-html-container {
  font-size: 0.875rem !important; color: #64748b !important;
}
.swal2-popup.swal-glam .swal2-confirm {
  background: linear-gradient(135deg,#b8860b,#d4a017) !important;
  border-radius: 10px !important; font-size: 0.875rem !important; font-weight: 500 !important;
  padding: 10px 24px !important; min-height: 44px;
}
.swal2-popup.swal-glam .swal2-cancel {
  background: #f8fafc !important; color: #374151 !important;
  border: 1px solid #e5e7eb !important; border-radius: 10px !important;
  font-size: 0.875rem !important; padding: 10px 24px !important; min-height: 44px;
}
.swal2-popup.swal-toast-glam {
  font-family: 'Inter', sans-serif !important;
  border-radius: 12px !important;
  font-size: 0.855rem !important;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12) !important;
  border: 1px solid #f1f5f9 !important;
}
.swal2-popup.swal-toast-glam .swal2-timer-progress-bar {
  background: #b8860b !important;
}

/* ---- Form focus ring ---- */
.form-input:focus {
  outline: none;
  border-color: #b8860b;
  box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
}

/* ---- Table row hover ---- */
.tbl-row { transition: background 0.08s; }
.tbl-row:hover { background: #f8fafc; }
.tbl-row.clickable { cursor: pointer; }

/* ---- Responsive table helpers ---- */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}
@media (max-width: 1023px) {
  .hide-tablet { display: none !important; }
}

/* ---- Pagination (built by PHP) ---- */
.pg-link-active {
  background: linear-gradient(135deg,#b8860b,#d4a017) !important;
  color: white !important; border-color: transparent !important;
}

/* ---- Print / PDF Export ---- */
@media print {
  /* Hide navigation & chrome */
  .no-print, aside#sidebar, header, #sidebarOverlay,
  .btn-gold, nav, [onclick="openSidebar()"],
  button[onclick="exportPDF()"] { display: none !important; }

  /* Reset body & layout */
  body {
    background: white !important;
    font-size: 12px !important;
    display: block !important;
    min-height: auto !important;
  }

  /* Remove sidebar margin from main wrapper */
  body > div, .flex-1.flex.flex-col {
    margin-left: 0 !important;
    min-height: auto !important;
  }

  /* Content area */
  main {
    padding: 12px 0 !important;
  }

  /* Cards */
  .stat-card, .bg-white {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
  }
  .stat-card { border: 1px solid #e5e7eb !important; }

  /* Shadows off */
  .shadow-card, .shadow-card-lg, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl {
    box-shadow: none !important;
  }

  /* Tables */
  table { font-size: 11px; }
  .overflow-x-auto { overflow: visible !important; }

  /* Borders softer */
  .rounded-2xl { border-radius: 8px !important; }
  .rounded-3xl { border-radius: 10px !important; }

  /* Charts */
  canvas { max-height: 180px !important; }

  /* Print-only header */
  .print-header { display: flex !important; }

  /* Links */
  a { color: inherit !important; text-decoration: none !important; }
  a[href]::after { content: none !important; }

  /* Grids — keep responsive layout */
  .grid { gap: 8px !important; }

  /* POS */
  .pos-wrap { display: block; height: auto; }

  /* Page setup */
  @page {
    margin: 1.2cm;
    size: A4;
  }
}

/* ---- Beauty industry glass card effect ---- */
.glass-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* ---- Smooth page transitions ---- */
main { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Virtual Tour / Onboarding ---- */
.tour-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}
.tour-overlay.tour-active {
  background: rgba(0,0,0,0.55);
}
.tour-highlight {
  position: absolute;
  border: 2px solid #d4a017;
  border-radius: 12px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.5), 0 0 20px rgba(184,134,11,0.3);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  z-index: 10000;
}
.tour-tooltip {
  position: absolute;
  z-index: 10001;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  opacity: 0;
  transition: opacity 0.25s ease, top 0.35s ease, left 0.35s ease;
}
.tour-tooltip-arrow {
  position: absolute;
  width: 12px; height: 12px;
  background: white;
  transform: rotate(45deg);
  border-radius: 2px;
}
.tour-tooltip-arrow.arrow-top {
  top: -6px; left: 50%; margin-left: -6px;
  box-shadow: -1px -1px 2px rgba(0,0,0,0.06);
}
.tour-tooltip-arrow.arrow-bottom {
  bottom: -6px; left: 50%; margin-left: -6px;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.06);
}
.tour-tooltip-arrow.arrow-left {
  left: -6px; top: 24px;
  box-shadow: -1px 1px 2px rgba(0,0,0,0.06);
}
.tour-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Tour help button (floating) */
.tour-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(184,134,11,0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  font-size: 18px;
}
.tour-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184,134,11,0.5);
}
@media print { .tour-overlay, .tour-fab { display: none !important; } }
