/* =====================================================
   iMoul (مول) — High-Fidelity Modern Moroccan Theme
   Tailwind CSS + DaisyUI + Custom Micro-Interactions
   ===================================================== */

:root {
  --primary-morocco: #136f4b;
  --primary-hover: #0e563a;
  --accent-terracotta: #d9532f;
  --accent-sand: #e6b85c;
  --bg-sand-subtle: #fbf9f4;
  --border-subtle: rgba(19, 111, 75, 0.12);
}

[data-theme="dark"] {
  --primary-morocco: #10b981;
  --primary-hover: #059669;
  --accent-terracotta: #f87171;
  --accent-sand: #fbbf24;
  --bg-sand-subtle: #13171f;
  --border-subtle: rgba(255, 255, 255, 0.1);
}

body {
  font-family: "Noto Sans Arabic", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-sand-subtle);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Moroccan Hero Card Gradient (Crisp Dark Emerald in both Day and Dark mode with clear White Text) */
.gradient-morocco {
  background: linear-gradient(135deg, #136f4b 0%, #064e3b 100%) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .gradient-morocco {
  background: linear-gradient(135deg, #0e563a 0%, #043826 100%) !important;
  color: #ffffff !important;
}

.gradient-morocco h1,
.gradient-morocco h2,
.gradient-morocco h3 {
  color: #ffffff !important;
}

.gradient-morocco .text-emerald-100 {
  color: #d1fae5 !important;
}

.gradient-morocco .text-emerald-200 {
  color: #a7f3d0 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.5);
}

/* Bottom Nav Floating Bar (Mobile First) */
.bottom-nav-floating {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  border-radius: 28px;
  z-index: 40;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .bottom-nav-floating {
  background: rgba(26, 31, 44, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

.bottom-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 20px;
  transition: all 0.2s ease;
  color: #6b7280;
  position: relative;
  flex: 1;
}

[data-theme="dark"] .bottom-tab-btn {
  color: #9ca3af;
}

.bottom-tab-btn.active {
  color: #10b981;
  font-weight: 700;
}

.bottom-tab-btn.active .tab-icon-wrap {
  transform: translateY(-2px) scale(1.1);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.tab-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphic Cards */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .glass-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Status Badges */
.badge-qoffa-open {
  background-color: #f3f4f6;
  color: #374151;
}
.badge-qoffa-sent {
  background-color: #fef3c7;
  color: #92400e;
}
.badge-qoffa-seen {
  background-color: #e0f2fe;
  color: #0369a1;
}
.badge-qoffa-ready {
  background-color: #d1fae5;
  color: #065f46;
}
.badge-qoffa-done {
  background-color: #ecfdf5;
  color: #047857;
}
.badge-qoffa-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Pulse animation for active orders */
@keyframes soft-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

.animate-soft-pulse {
  animation: soft-pulse 2s infinite ease-in-out;
}

/* Barcode Scanner Viewport Container */
#scanner-video-region {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #000;
}

#scanner-video-region video {
  border-radius: 20px;
  object-fit: cover;
  width: 100% !important;
}

/* Scanner target box overlay */
.scanner-laser {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 12px 2px #ef4444;
  animation: scanLaser 2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 25%; opacity: 0.3; }
  50% { top: 75%; opacity: 1; }
  100% { top: 25%; opacity: 0.3; }
}

/* RTL and LTR direction styling helper */
[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

/* Leaflet Map Height */
.map-container {
  height: 380px;
  width: 100%;
  border-radius: 18px;
  z-index: 10;
}

/* Currency symbol / style */
.price-tag {
  font-family: "Plus Jakarta Sans", "Noto Sans Arabic", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Touch feedback ripple */
.touch-feedback:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* ==========================================================================
   Universal Responsive Badge & Pill Wrapping Fix (Mobile & Multiline Screens)
   حل تشوه خلفيات الشارات والأزرار عند التفاف النصوص على عدة أسطر فـ DaisyUI
   ========================================================================== */

.badge {
  height: auto !important;
  min-height: 1.35rem;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  text-align: right;
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

[dir="ltr"] .badge {
  text-align: left;
}

.badge-lg {
  min-height: 1.75rem;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  line-height: 1.4 !important;
}

.badge-sm {
  min-height: 1.15rem;
  padding-top: 0.15rem !important;
  padding-bottom: 0.15rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  line-height: 1.35 !important;
}

.badge-xs {
  min-height: 1rem;
  padding-top: 0.1rem !important;
  padding-bottom: 0.1rem !important;
  padding-left: 0.4rem !important;
  padding-right: 0.4rem !important;
  line-height: 1.3 !important;
}

/* Ensure custom pill containers wrap smoothly */
.inline-flex.rounded-full,
.inline-flex.rounded-2xl,
.inline-flex.rounded-xl,
.inline-flex.rounded-lg {
  height: auto !important;
  min-height: 1.5rem;
  white-space: normal !important;
  line-height: 1.4 !important;
  max-width: 100%;
  flex-wrap: wrap;
}

