/* ================================================================
   HexiBite Premium UI — Custom CSS Foundation
   ================================================================ */

/* ── Base ──────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Custom Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Material Symbols ─────────────────────────────────────────── */
.material-symbols-outlined {
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Button Press Effect ──────────────────────────────────────── */
button:active { transform: scale(0.97); }

/* ── Modal Transition ─────────────────────────────────────────── */
#modal-container { transition: opacity 0.25s ease-in-out; }

/* ================================================================
   GLASSMORPHISM
   ================================================================ */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.glass-dark {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================================================================
   GRADIENT TEXT
   ================================================================ */
.gradient-text {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-cool {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   KEYFRAME ANIMATIONS
   ================================================================ */

/* ── Fade In Up (Page transitions) ────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

/* ── Staggered children fade-in ───────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }

/* ── Shimmer / Skeleton Loader ────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 8px;
}

/* ── Slide In Right (Toast notifications) ─────────────────────── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
.animate-slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.animate-slide-out-right {
  animation: slideOutRight 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Toast auto-dismiss progress bar ──────────────────────────── */
@keyframes shrinkWidth {
  from { width: 100%; }
  to   { width: 0%; }
}
.toast-progress {
  animation: shrinkWidth 4s linear forwards;
}

/* ── Pulsing dot (live order indicator) ───────────────────────── */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
.pulse-dot {
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* ── Float animation (hero decorative elements) ───────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-12px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

/* ── Glow pulse (CTA buttons) ─────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }
  50%      { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6), 0 0 50px rgba(245, 158, 11, 0.2); }
}
.glow-amber { animation: glowPulse 2.5s ease-in-out infinite; }

/* ================================================================
   CARD HOVER LIFT
   ================================================================ */
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ================================================================
   MOBILE HAMBURGER MENU
   ================================================================ */
.mobile-menu-panel {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu-panel.open {
  transform: translateX(0);
}
.mobile-menu-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger to X animation */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}
.hamburger-active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================================================================
   PASSWORD TOGGLE
   ================================================================ */
.password-wrapper { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.password-toggle:hover { color: #4b5563; }

/* ================================================================
   FOCUS RINGS
   ================================================================ */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  border-color: #f59e0b !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ================================================================
   TOAST CONTAINER
   ================================================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}
#toast-container > * {
  pointer-events: auto;
}

/* ================================================================
   MISC UTILITIES
   ================================================================ */
.text-shadow-sm { text-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.text-shadow-md { text-shadow: 0 2px 6px rgba(0,0,0,0.2); }

/* Gradient border effect */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 16px;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gradient-border:focus-within::before {
  opacity: 1;
}

/* ================================================================
   LEAFLET MAP CUSTOM STYLING
   ================================================================ */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  padding: 4px !important;
}
.leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.4 !important;
}
.custom-user-marker, .custom-shop-marker {
  background: transparent;
  border: none;
}
