/* ==========================================================================
   CYBER CODE IQ - Ultra-Luxury Enterprise Software Design System
   Corporate & High-Tech POS / Accounting Systems (Basra - Iraq)
   ========================================================================== */

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

:root {
  --font-primary: 'Cairo', 'Tajawal', sans-serif;
  
  /* Brand Luxury Palette */
  --bg-dark: #070b14;
  --bg-dark-surface: #0e1526;
  --bg-dark-card: rgba(15, 23, 42, 0.72);
  --border-dark: rgba(56, 189, 248, 0.14);
  --border-dark-hover: rgba(56, 189, 248, 0.4);
  
  --primary-blue: #0284c7;
  --primary-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --glow-blue: 0 0 35px rgba(2, 132, 199, 0.3);
  --glow-card: 0 20px 45px -12px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: #f1f5f9;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ==========================================================================
   Luxury Ambient Background Glow
   ========================================================================== */
.ambient-glow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  transition: all 1s ease;
}

html:not(.dark) .glow-orb {
  opacity: 0.12;
}

.glow-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #0284c7, transparent 70%);
  top: -150px;
  right: -100px;
  animation: floatOrb1 16s ease-in-out infinite alternate;
}

.glow-orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: 10%;
  left: -150px;
  animation: floatOrb2 20s ease-in-out infinite alternate;
}

.glow-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #4f46e5, transparent 70%);
  top: 40%;
  right: 25%;
  animation: floatOrb3 18s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 80px) scale(1.15); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, -60px) scale(1.1); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.15; }
  100% { transform: translate(-40px, -40px) scale(1.2); opacity: 0.25; }
}

/* Subtle Tech Grid Pattern */
.bg-grid-tech {
  background-image: radial-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
}

html:not(.dark) .bg-grid-tech {
  background-image: radial-gradient(rgba(14, 116, 144, 0.1) 1px, transparent 1px);
}

/* ==========================================================================
   Luxury Glass Cards & Containers
   ========================================================================== */
.glass-card {
  background: rgba(14, 21, 38, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.16);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 25px 45px -12px rgba(2, 132, 199, 0.18), 0 0 20px rgba(56, 189, 248, 0.08);
}

/* ==========================================================================
   Executive Buttons
   ========================================================================== */
.btn-luxury-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-luxury-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 12px 28px -4px rgba(2, 132, 199, 0.55), 0 0 15px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.btn-luxury-primary:active {
  transform: scale(0.98);
}

.btn-luxury-secondary {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #e2e8f0;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.25s ease;
}

.btn-luxury-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-2px);
}

.btn-luxury-secondary:active {
  transform: scale(0.98);
}

.btn-luxury-whatsapp {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.25s ease;
}

.btn-luxury-whatsapp:hover {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.55), 0 0 15px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.btn-luxury-whatsapp:active {
  transform: scale(0.98);
}

/* Luxury Instagram Brand Button */
.btn-luxury-instagram {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 22%, #dc2743 45%, #cc2366 70%, #bc1888 100%);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px -4px rgba(220, 39, 67, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: all 0.25s ease;
}

.btn-luxury-instagram:hover {
  background: linear-gradient(135deg, #bc1888 0%, #cc2366 30%, #dc2743 55%, #e6683c 80%, #f09433 100%);
  box-shadow: 0 12px 28px -4px rgba(220, 39, 67, 0.6), 0 0 16px rgba(204, 35, 102, 0.35);
  transform: translateY(-2px);
}

.btn-luxury-instagram:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Luxury Return Button (العودة إلى القائمة الرئيسية)
   ========================================================================== */
.luxury-back-btn {
  background: rgba(14, 21, 38, 0.85);
  backdrop-filter: blur(12px);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  padding: 10px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.luxury-back-btn:hover {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
  transform: translateX(4px);
}

/* ==========================================================================
   SPA Views Transitions
   ========================================================================== */
.app-view {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 10;
}

.app-view.active-view {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: luxuryViewFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes luxuryViewFade {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Interactive Live SaaS Dashboard Frame
   ========================================================================== */
.dashboard-mockup-window {
  background: rgba(10, 16, 30, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(2, 132, 199, 0.15);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.window-header-bar {
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
  padding: 10px 16px;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   PROMINENT DARK MODE TOGGLE (Executive Sliding Pill Button)
   ========================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 12px;
  min-height: 42px;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.theme-toggle-btn:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   COMPLETE HIGH-CONTRAST LIGHT MODE SYSTEM (الوضع النهاري المتناسق)
   ========================================================================== */
html:not(.dark) {
  color-scheme: light;
}

html:not(.dark) body {
  background-color: #f8fafc;
  color: #0f172a;
}

/* Background Grids & Ambient Glow in Light Mode */
html:not(.dark) .bg-grid-tech {
  background-image: radial-gradient(rgba(2, 132, 199, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

html:not(.dark) .glow-orb {
  opacity: 0.08;
}

/* Header, Navbar & Footer */
html:not(.dark) header {
  background-color: #ffffff !important;
  border-bottom-color: #e2e8f0 !important;
}

html:not(.dark) nav {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-bottom-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) footer {
  background-color: #ffffff !important;
  border-top-color: #e2e8f0 !important;
}

/* All Slate Backgrounds (including Tailwind /60, /70, /80, /90, /95 opacity variants) */
html:not(.dark) [class*="bg-slate-900"],
html:not(.dark) [class*="bg-slate-950"],
html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-950 {
  background-color: #ffffff !important;
}

/* All Slate Borders (including Tailwind /60, /70, /80, /90 variants) */
html:not(.dark) [class*="border-slate-800"],
html:not(.dark) [class*="border-slate-700"],
html:not(.dark) [class*="border-slate-600"],
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700 {
  border-color: #e2e8f0 !important;
}

/* Cards & Windows in Light Mode */
html:not(.dark) .glass-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.02) !important;
}

html:not(.dark) .glass-card:hover {
  border-color: rgba(2, 132, 199, 0.5) !important;
  box-shadow: 0 20px 35px -8px rgba(2, 132, 199, 0.12) !important;
}

html:not(.dark) .dashboard-mockup-window {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) .window-header-bar {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

html:not(.dark) .pos-item-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .pos-item-card:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.18) !important;
}

/* Convert Dark Gradients into Luxury Light Gradients */
html:not(.dark) [class*="from-sky-950"],
html:not(.dark) [class*="to-indigo-950"],
html:not(.dark) [class*="from-slate-900"],
html:not(.dark) [class*="to-slate-900"] {
  --tw-gradient-from: #f0f9ff !important;
  --tw-gradient-to: #e0f2fe !important;
  --tw-gradient-stops: #f0f9ff, #f8fafc, #e0f2fe !important;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 50%, #e0f2fe 100%) !important;
}

/* Hero & Headline Gradient Text */
.hero-gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html:not(.dark) .hero-gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #4338ca 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Hero Line 2: Guaranteed single straight line on all devices without breaking or dropping */
.hero-line-2 {
  font-size: clamp(14px, 3.2vw, 38px);
  white-space: nowrap;
  letter-spacing: -0.01em;
  display: block;
  text-align: center;
}

@media (max-width: 400px) {
  .hero-line-2 {
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  .hero-line-2 {
    font-size: 11.5px;
  }
}

/* Light Mode Typography & Color Contrast */
html:not(.dark) .text-white {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200 {
  color: #1e293b !important;
}

html:not(.dark) .text-slate-300 {
  color: #334155 !important;
}

html:not(.dark) .text-slate-400 {
  color: #475569 !important;
}

html:not(.dark) .text-slate-500 {
  color: #64748b !important;
}

/* Brand Accents Contrast in Light Mode */
html:not(.dark) .text-sky-400,
html:not(.dark) .text-sky-300 {
  color: #0284c7 !important;
}

html:not(.dark) .text-cyan-400,
html:not(.dark) .text-cyan-300 {
  color: #0891b2 !important;
}

html:not(.dark) .text-emerald-400,
html:not(.dark) .text-emerald-300 {
  color: #047857 !important;
}

html:not(.dark) .text-amber-400,
html:not(.dark) .text-amber-300 {
  color: #b45309 !important;
}

html:not(.dark) .text-rose-400,
html:not(.dark) .text-rose-300 {
  color: #be123c !important;
}

html:not(.dark) .text-indigo-400,
html:not(.dark) .text-indigo-300 {
  color: #4338ca !important;
}

/* Light Mode Soft Badges & Pills */
html:not(.dark) [class*="bg-sky-500\/10"],
html:not(.dark) [class*="bg-sky-500\/15"],
html:not(.dark) [class*="bg-sky-500\/20"] {
  background-color: #e0f2fe !important;
  border-color: #bae6fd !important;
  color: #0284c7 !important;
}

html:not(.dark) [class*="bg-emerald-500\/10"],
html:not(.dark) [class*="bg-emerald-500\/20"] {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

html:not(.dark) [class*="bg-amber-500\/10"],
html:not(.dark) [class*="bg-amber-500\/20"] {
  background-color: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

html:not(.dark) [class*="bg-rose-500\/10"],
html:not(.dark) [class*="bg-rose-500\/20"] {
  background-color: #ffe4e6 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

/* Theme Toggle Button in Light Mode */
html:not(.dark) .theme-toggle-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

html:not(.dark) .theme-toggle-btn:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18) !important;
}

/* Secondary Button in Light Mode */
html:not(.dark) .btn-luxury-secondary {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .btn-luxury-secondary:hover {
  background: #f8fafc !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

/* Back Button in Light Mode */
html:not(.dark) .luxury-back-btn {
  background: #ffffff !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.1) !important;
}

html:not(.dark) .luxury-back-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

/* Inputs & Form Elements in Light Mode */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="number"],
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html:not(.dark) input::placeholder {
  color: #94a3b8 !important;
}

/* Protected White-Text Elements (Buttons with solid colored backgrounds) */
html:not(.dark) .btn-luxury-primary,
html:not(.dark) .btn-luxury-primary *,
html:not(.dark) .btn-luxury-whatsapp,
html:not(.dark) .btn-luxury-whatsapp *,
html:not(.dark) .btn-luxury-instagram,
html:not(.dark) .btn-luxury-instagram *,
html:not(.dark) .bg-emerald-600,
html:not(.dark) .bg-emerald-600 *,
html:not(.dark) .bg-sky-600,
html:not(.dark) .bg-sky-600 *,
html:not(.dark) .bg-amber-600,
html:not(.dark) .bg-amber-600 *,
html:not(.dark) .bg-rose-600,
html:not(.dark) .bg-rose-600 *,
html:not(.dark) .keep-white,
html:not(.dark) .keep-white *,
html:not(.dark) .mac-dot {
  color: #ffffff !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #070b14;
}

html:not(.dark) ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.1);
}

::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

/* Badge Glow Pill */
.badge-pill-glow {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.15);
}

html:not(.dark) .badge-pill-glow {
  background: rgba(2, 132, 199, 0.08);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.25);
}

/* Floating Concierge WhatsApp Widget */
.floating-concierge {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
}

@media (max-width: 640px) {
  .floating-concierge {
    bottom: 16px;
    left: 16px;
  }
}

/* ==========================================================================
   Mobile & iPad Drawer Enhancements & Light Mode Synchronization
   ========================================================================== */
#mobileNavDrawer {
  animation: slideDownNav 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html:not(.dark) #mobileNavDrawer {
  background-color: rgba(255, 255, 255, 0.98) !important;
  border-top-color: #e2e8f0 !important;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) #mobileNavDrawer .bg-slate-900\/70,
html:not(.dark) #mobileNavDrawer .bg-slate-900\/80,
html:not(.dark) #mobileNavDrawer .bg-slate-900\/40 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html:not(.dark) #mobileNavDrawer .text-slate-200 {
  color: #1e293b !important;
}

html:not(.dark) #mobileNavDrawer .text-slate-300 {
  color: #334155 !important;
}

html:not(.dark) #mobileNavDrawer .text-slate-400 {
  color: #64748b !important;
}

/* Tablet / iPad Specific Polish (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-mockup-window {
    border-radius: 16px;
  }
  
  .pos-item-card {
    min-height: 120px;
  }

  .theme-toggle-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* Phone Specific Polish (< 640px) */
@media (max-width: 639px) {
  .theme-toggle-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 38px;
    gap: 5px;
  }
}

