/* ============================================================================
 * DIRECT SELLING & MULTI-VENDOR E-COMMERCE PLATFORM
 * FILE: css/styles.css
 * DESCRIPTION: RTL Arabic Typography, Glassmorphism Surfaces, Network Tree
 *              Visual Connectors, Mobile PWA Navigation & Smooth Animations
 * ============================================================================ */

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

:root {
  --bg-deep: #070d19;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.76);
  --glass-border: rgba(148, 163, 184, 0.16);
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.22);
  --gold-accent: #f59e0b;
  --cyan-accent: #06b6d4;
}

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

html, body {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: #f8fafc;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Subtle Ambient Mesh Background */
.ambient-mesh {
  background:
    radial-gradient(circle at 12% 15%, rgba(16, 185, 129, 0.14), transparent 36%),
    radial-gradient(circle at 86% 18%, rgba(245, 158, 11, 0.10), transparent 32%),
    radial-gradient(circle at 50% 85%, rgba(6, 182, 212, 0.10), transparent 40%),
    linear-gradient(180deg, #070d19 0%, #0b1325 100%);
}

/* Glassmorphism Surfaces */
.glass-panel {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
}

.glass-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.68) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.glass-card:hover {
  border-color: rgba(16, 185, 129, 0.38);
  box-shadow: 0 14px 30px -10px rgba(16, 185, 129, 0.16);
}

.glass-card-interactive:hover {
  transform: translateY(-3px);
}

/* Hierarchical Network Tree CSS (هيكل الشبكة والوراثة) */
.tree-container {
  overflow-x: auto;
  padding: 1.5rem 0.75rem;
  direction: rtl;
}

.org-tree ul {
  padding-top: 22px;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 14px;
  list-style-type: none;
  margin: 0;
  padding-right: 0;
}

.org-tree li {
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 22px 6px 0 6px;
}

/* Connectors above nodes */
.org-tree li::before,
.org-tree li::after {
  content: '';
  position: absolute;
  top: 0;
   left: 50%;
  border-top: 2px solid rgba(16, 185, 129, 0.42);
  width: 50%;
  height: 22px;
}

.org-tree li::after {
  left: auto;
  right: 50%;
  border-right: 2px solid rgba(16, 185, 129, 0.42);
}

.org-tree li:only-child::after,
.org-tree li:only-child::before {
  display: none;
}

.org-tree li:only-child {
  padding-top: 0;
}

/* RTL first-child and last-child adjustments */
.org-tree li:first-child::before,
.org-tree li:last-child::after {
  border: 0 none;
}

.org-tree li:last-child::before {
  border-left: 2px solid rgba(16, 185, 129, 0.42);
  border-radius: 6px 0 0 0;
}

.org-tree li:first-child::after {
  border-radius: 0 6px 0 0;
}

.org-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid rgba(16, 185, 129, 0.42);
  width: 0;
  height: 22px;
}

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

::-webkit-scrollbar-track {
  background: #09101f;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.pulse-emerald {
  animation: pulseGlow 2.4s infinite;
}

/* Mobile Bottom Nav Safe Area */
.pb-safe-mobile {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}
