/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Colors */
  --bg-primary: #060d0a;
  --bg-secondary: #0c1813;
  --bg-tertiary: #12241d;
  
  --primary-rgb: 16, 185, 129; /* Emerald */
  --primary: rgb(var(--primary-rgb));
  --primary-light: #34d399;
  --primary-dark: #047857;
  
  --gold-rgb: 217, 119, 6; /* Gold */
  --gold: rgb(var(--gold-rgb));
  --gold-light: #f59e0b;
  --gold-dark: #b45309;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(16, 185, 129, 0.2);
  
  --glass-bg: rgba(12, 24, 19, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  /* Fonts */
  --font-en: 'Outfit', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  
  /* Layout */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
}

/* RTL Override Variables */
html[dir="rtl"] {
  --font-primary: var(--font-ar);
}
html[dir="ltr"] {
  --font-primary: var(--font-en);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

p {
  line-height: 1.6;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* ==========================================================================
   BACKGROUND GLOWS
   ========================================================================== */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(6, 13, 10, 0) 70%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

.bg-glow-1 {
  top: -100px;
  right: -100px;
  animation: drift 15s infinite alternate ease-in-out;
}

.bg-glow-2 {
  top: 60%;
  left: -200px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.04) 0%, rgba(6, 13, 10, 0) 70%);
  animation: drift 20s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 80px) scale(1.1); }
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.text-gold {
  color: var(--gold-light) !important;
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(6, 13, 10, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.logo i {
  color: var(--primary);
  font-size: 24px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-menu a:hover {
  color: var(--primary-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.btn-lang:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 80px 0 100px 0;
  position: relative;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-content h1 {
  font-size: 54px;
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.download-badges {
  display: flex;
  gap: 16px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.store-badge:hover {
  border-color: var(--primary);
  background-color: var(--bg-tertiary);
  transform: translateY(-2px);
}

.store-badge i {
  font-size: 24px;
  color: white;
}

.store-badge div {
  display: flex;
  flex-direction: column;
}

.store-badge .badge-text {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.store-badge .badge-title {
  font-size: 14px;
  font-weight: 600;
  color: white;
}

/* Hero Visual (Heritage Card) */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.heritage-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 24px;
  position: relative;
  overflow: hidden;
  animation: float 6s infinite ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.heritage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.card-header {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.card-header .circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.card-header .circle.red { background-color: #ef4444; }
.card-header .circle.yellow { background-color: #f59e0b; }
.card-header .circle.green { background-color: #10b981; }

/* Tree Graphic */
.tree-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tree-graphic .node {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: var(--transition-fast);
}

.tree-graphic .node:hover {
  border-color: var(--primary);
  background-color: rgba(16, 185, 129, 0.05);
}

.tree-graphic .node-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tree-graphic .node-name {
  font-size: 14px;
  font-weight: 600;
}

.tree-graphic .connectors {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.tree-graphic .line.vertical {
  width: 2px;
  height: 20px;
  background-color: var(--border-color);
}

.tree-graphic .line.horizontal {
  width: 60%;
  height: 2px;
  background-color: var(--border-color);
}

.tree-graphic .leaves {
  display: flex;
  justify-content: space-around;
  width: 100%;
  gap: 16px;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.features-section {
  padding: 100px 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px auto;
}

.section-header h2 {
  font-size: 36px;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.feature-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 36px;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.05);
}

.feature-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--border-radius-md);
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 24px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

/* ==========================================================================
   INTERACTIVE TREE PREVIEW SECTION
   ========================================================================== */
.tree-preview-section {
  padding: 100px 0;
}

.interactive-tree-wrapper {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 60px 40px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.interactive-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree-row {
  display: flex;
  gap: 40px;
  justify-content: center;
  position: relative;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  min-width: 240px;
}

.tree-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
}

.tree-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.tree-item.root .tree-avatar {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.tree-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
}

.tree-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.tree-connector-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  height: 40px;
}

.tree-vertical-line {
  width: 2px;
  height: 100%;
  background-color: var(--border-color);
}

/* Generation 2 Connection styling */
.row-multiple {
  position: relative;
}

.row-multiple::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 120px;
  right: 120px;
  height: 2px;
  background-color: var(--border-color);
}

/* ==========================================================================
   STATISTICS SECTION
   ========================================================================== */
.stats-section {
  padding: 80px 0;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-top: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-item {
  text-align: center;
  padding: 24px;
}

.stat-numberCount {
  font-size: 48px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   APP SHOWCASE SECTION
   ========================================================================== */
.showcase-section {
  padding: 100px 0;
  border-top: 1px solid var(--border-color);
}

.showcase-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.showcase-content h2 {
  font-size: 36px;
  margin-bottom: 20px;
}

.showcase-content p.lead {
  font-size: 18px;
  margin-bottom: 32px;
}

.showcase-list {
  list-style: none;
  margin-bottom: 40px;
}

.showcase-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 15px;
}

.showcase-list li i {
  color: var(--primary);
  margin-top: 3px;
}

/* Phone Mockup Frame */
.showcase-visual {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 320px;
  height: 640px;
  background-color: #121212;
  border: 12px solid #2d2d2d;
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), inset 0 0 10px rgba(255,255,255,0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-speaker {
  width: 60px;
  height: 4px;
  background-color: #2d2d2d;
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.phone-screen {
  flex: 1;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  padding-top: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 700;
}

.app-header i {
  color: var(--text-secondary);
}

.app-content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.app-welcome-card {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(16,185,129,0.05) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.app-welcome-card h5 {
  font-size: 14px;
  margin-bottom: 4px;
}

.app-welcome-card p {
  font-size: 11px;
}

.app-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-event-card {
  display: flex;
  gap: 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px;
}

.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--border-radius-sm);
  width: 36px;
  height: 36px;
  color: white;
}

.event-date-badge .day {
  font-size: 12px;
  font-weight: 700;
}

.event-date-badge .month {
  font-size: 8px;
  font-weight: 600;
}

.app-event-card .event-info h6 {
  font-size: 12px;
  font-weight: 600;
}

.app-event-card .event-info p {
  font-size: 9px;
  margin-top: 2px;
}

.app-message-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.app-message-card p {
  font-size: 11px;
  line-height: 1.4;
}

.phone-home-button {
  width: 32px;
  height: 32px;
  border: 2px solid #2d2d2d;
  border-radius: 50%;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 80px 0 0 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand p {
  margin-top: 16px;
  font-size: 14px;
  max-width: 320px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links h4, .footer-contact h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: white;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-contact p {
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-contact i {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  background-color: var(--bg-primary);
}

.footer-bottom-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  font-size: 18px;
  color: var(--text-muted);
}

.social-links a:hover {
  color: var(--primary-light);
}

/* ==========================================================================
   RTL DIRECTIONS & ALIGNMENTS
   ========================================================================== */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .hero-content {
  align-items: flex-start;
}

html[dir="rtl"] .store-badge div {
  align-items: flex-start;
}

html[dir="rtl"] .showcase-list li i {
  margin-left: 0;
  margin-right: 0;
}

html[dir="rtl"] .header-actions {
  flex-direction: row-reverse;
}

/* ==========================================================================
   SCROLL REVEAL & RESPONSIVE
   ========================================================================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .hero-ctas {
    justify-content: center;
  }
  
  .download-badges {
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .showcase-container {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  
  .showcase-content {
    text-align: center;
  }
  
  .showcase-list {
    display: inline-block;
    text-align: left;
  }
  
  .showcase-downloads {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
    gap: 20px;
    z-index: 99;
  }
  
  .nav-menu.mobile-active {
    display: flex;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero-content h1 {
    font-size: 40px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
