/* ==========================================================================
   Ngantri Barbershop & Multi-Industry Queue - Clean Modern Stylesheet
   Enhanced for High-End UI/UX, Full Mobile Responsiveness & Seamless PWA
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-hover: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-ambient-color: rgba(150, 170, 255, 0.20);
  
  --brand-cyan-light: #0284c7;
  --brand-cyan: #00b4d8;
  --brand-blue: #0284c7;
  --brand-blue-dark: #1d4ed8;
  --brand-glow: rgba(0, 180, 216, 0.25);
  --brand-border: rgba(2, 132, 199, 0.22);
  --brand-ambient: rgba(150, 170, 255, 0.24);

  --gold-primary: #0284c7;
  --gold-light: #38bdf8;
  --gold-dark: #0369a1;
  --gold-glow: rgba(2, 132, 199, 0.25);
  --gold-border: rgba(2, 132, 199, 0.22);

  --accent-cyan: #00b4d8;
  --accent-sky: #0284c7;
  --accent-blue: #2563eb;
  --accent-green: #059669;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-gold: 0 10px 25px -5px rgba(2, 132, 199, 0.35);
  --shadow-brand: 0 10px 25px -5px rgba(2, 132, 199, 0.35);
  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px rgba(150, 170, 255, 0.24);

  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(150, 170, 255, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(56, 189, 248, 0.16) 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Fix iOS auto-zoom on inputs */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Ambient Background Glow */
.bg-ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-ambient-glow::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 15%;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 170, 255, 0.22) 0%, rgba(0, 180, 216, 0.10) 40%, rgba(255, 255, 255, 0) 70%);
  filter: blur(80px);
}

.bg-ambient-glow::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: 10%;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 170, 255, 0.18) 0%, rgba(37, 99, 235, 0.08) 45%, rgba(255, 255, 255, 0) 70%);
  filter: blur(95px);
}

/* Brand Fonts */
.font-brand {
  font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: 0.02em;
  font-weight: 800;
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 14px 35px -5px rgba(2, 132, 199, 0.15);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

/* Brand Gradients */
.text-brand-gradient,
.text-ngantri-gradient,
.text-gold-gradient {
  background: linear-gradient(135deg, #0284c7 0%, #00b4d8 35%, #0369a1 70%, #1d4ed8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-gradient-bg,
.gold-gradient-bg {
  background: linear-gradient(135deg, #0284c7 0%, #00b4d8 40%, #0369a1 75%, #1d4ed8 100%);
}

/* Modern Brand Buttons */
.btn-brand,
.btn-gold {
  background: linear-gradient(135deg, #0284c7 0%, #00b4d8 50%, #0369a1 100%);
  color: #ffffff;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.6rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  touch-action: manipulation;
}

.btn-brand:hover,
.btn-gold:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.4);
  filter: brightness(1.06);
}

.btn-brand:active,
.btn-gold:active {
  transform: translateY(0) scale(0.98);
}

.btn-outline-brand,
.btn-outline-gold {
  background: #f0f9ff;
  color: #0284c7;
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  touch-action: manipulation;
}

.btn-outline-brand:hover,
.btn-outline-gold:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
}

/* Service & Provider Selection Cards */
.selection-card {
  cursor: pointer;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-lg);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
  touch-action: manipulation;
}

.selection-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  background: #f0f9ff;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.12);
}

.selection-card.active {
  border-color: #0284c7;
  background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.22);
}

.selection-card.active::before {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

/* Time Slot Badges */
.slot-pill {
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  touch-action: manipulation;
}

.slot-pill:hover:not(.booked):not(.expired) {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.15);
}

.slot-pill.active {
  border-color: #0284c7;
  background: linear-gradient(135deg, #0284c7 0%, #00b4d8 100%);
  color: #ffffff !important;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.35);
  transform: scale(1.02);
}

.slot-pill.booked {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.slot-pill.expired {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Time Slot & Filter Pills (Horizontal Touch Scrollable) */
.slot-filter-btn {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
}

.slot-filter-btn:hover {
  color: #0f172a;
  border-color: #0284c7;
  background: #e0f2fe;
}

.slot-filter-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #00b4d8 100%);
  color: #ffffff;
  font-weight: 800;
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Digital Boarding Pass Ticket */
.digital-ticket {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(2, 132, 199, 0.18), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.digital-ticket::before,
.digital-ticket::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--bg-main);
  border-radius: 50%;
  top: 68%;
  z-index: 10;
}

.digital-ticket::before {
  left: -13px;
  border-right: 2px solid #0284c7;
}

.digital-ticket::after {
  right: -13px;
  border-left: 2px solid #0284c7;
}

.ticket-perforation {
  position: absolute;
  top: 68%;
  left: 20px;
  right: 20px;
  border-top: 2px dashed rgba(2, 132, 199, 0.35);
  margin-top: 12px;
}

/* Pulsing Badge & Live Indicator */
.live-pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

.live-pulse-amber {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d97706;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
  animation: pulse-ring-amber 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(2, 132, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

@keyframes pulse-ring-amber {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* Queue Number Highlight Box */
.queue-number-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0284c7;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(2, 132, 199, 0.12), 0 8px 24px rgba(2, 132, 199, 0.08);
}

/* Custom Scrollbars & No-Scrollbar Utility */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Bottom Navigation Bar (PWA Style) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 50;
  display: flex;
  justify-content: space-around;
  padding: 0.55rem 0.25rem;
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  box-shadow: 0 -6px 25px rgba(15, 23, 42, 0.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 60px;
  touch-action: manipulation;
}

.bottom-nav-item.active {
  color: #0284c7;
  font-weight: 800;
  background: #f0f9ff;
}

.bottom-nav-item.active svg,
.bottom-nav-item.active i {
  color: #0284c7;
  transform: scale(1.1);
}

.bottom-nav-item:hover {
  color: #0284c7;
}

.bottom-nav-item svg,
.bottom-nav-item i {
  font-size: 1.15rem;
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

/* Responsive Modal Styling (Bottom-sheet on Mobile) */
@media (max-width: 640px) {
  .responsive-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-bottom: 0 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .glass-card {
    border-radius: 20px;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Category Grid for Merchant Registration */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  touch-action: manipulation;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 8px 18px -4px rgba(2, 132, 199, 0.15);
}

.category-card.active {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px #0284c7, 0 8px 20px -4px rgba(2, 132, 199, 0.22);
}

.category-icon {
  font-size: 24px;
  margin-bottom: 6px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.category-card.active .category-icon {
  transform: scale(1.12);
}
