/* =========================================================
   LAN Messenger — Premium SaaS Architecture CSS
   (Dragon Level Colors Restored + RTL/Arabic Support)
   ========================================================= */

/* =============================
   1. RESET & VARIABLES
============================= */
:root {
  --bg-base: #0f172a;
  --bg-surface: #111827;
  --bg-surface-hover: #1e293b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --accent-1: #6366f1; /* Indigo */
  --accent-2: #06b6d4; /* Cyan */
  --accent-3: #8b5cf6; /* Purple */
  --accent-glow: rgba(99, 102, 241, 0.4);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  --max-width: 1100px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* =============================
   2. TYPOGRAPHY & UTILITIES
============================= */
h1, h2, h3, h4 {
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* =============================
   3. BACKGROUND EFFECTS
============================= */
.bg-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  height: 100vh;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 20%, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 80%);
}

.bg-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 15% 25%, rgba(99,102,241,0.25), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(6,182,212,0.2), transparent 40%);
  z-index: -3;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2), var(--accent-3));
  background-size: 300% 300%;
  animation: gradientShift 18s ease infinite;
  opacity: 0.04;
  pointer-events: none;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =============================
   4. NAVBAR
============================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: all 0.3s var(--ease-out);
}

.navbar.scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
}

.logo-box {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text-main); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
  border: none;
}

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

/* Language Button Styling */
.lang-btn {
  padding: 0.4rem 0.6rem;
  gap: 0.4rem;
  font-weight: 600;
}
.lang-btn svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}
.lang-btn:hover svg {
  color: var(--text-main);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: 0.3s;
}

/* =============================
   5. HERO SECTION
============================= */
.hero {
  padding-top: calc(70px + var(--space-xl));
  padding-bottom: var(--space-xl);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: 0.2s;
}

.hero-badge:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-2);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.375rem);
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.stat h3 {
  font-size: 2.125rem;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stat.divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

.hero-visual {
  position: relative;
  perspective: 1200px;
}

.app-mockup {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.6s var(--ease-out);
}

.app-mockup:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.03);
}

.mockup-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-hover);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3f3f46;
}

.window-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
}

.mockup-body {
  padding: 1.5rem;
  height: 240px;
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mockup-code p {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.code-comment { color: #64748b; }
.code-keyword { color: var(--accent-2); }
.code-success { color: #10b981; }
.code-highlight { color: var(--accent-3); text-decoration: underline; text-underline-offset: 4px; }

.dots { animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* =============================
   6. SECTIONS COMMON
============================= */
section {
  padding-block: var(--space-xl);
}

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

.section-title {
  font-size: clamp(2rem, 4vw, 2.375rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* =============================
   7. FEATURES
============================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.spotlight-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 2rem;
  overflow: hidden;
  border: 1px solid transparent; 
  transition: 0.4s;
}

.spotlight-card:hover {
  transform: translateY(-10px);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    600px circle at var(--mouse-x, -100%) var(--mouse-y, -100%), 
    var(--accent-2),
    transparent 40%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, -100%) var(--mouse-y, -100%), 
    rgba(99, 102, 241, 0.15),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.spotlight-card:hover::after { opacity: 1; }

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-2);
}

.spotlight-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.spotlight-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* =============================
   8. HOW IT WORKS
============================= */
.steps-container {
  max-width: 800px;
  margin-inline: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.steps-line {
  position: absolute;
  left: 24px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-strong) 10%, var(--border-strong) 90%, transparent);
}

.step-card {
  display: flex;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent-1);
  box-shadow: 0 0 0 8px var(--bg-base);
}

.step-content {
  padding-top: 0.5rem;
  padding: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  width: 100%;
}

.step-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-muted);
}

/* =============================
   9. FAQ
============================= */
.faq-container { max-width: 700px; }

.faq-list {
  border-top: 1px solid var(--border-subtle);
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.5rem 0;
  color: var(--text-main);
  font-size: 1.125rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon-plus {
  transition: transform 0.3s var(--ease-out);
  color: var(--text-muted);
}

.faq-question[aria-expanded="true"] .icon-plus {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
  opacity: 0;
}

.faq-answer p {
  padding-bottom: 1.5rem;
  color: var(--text-muted);
}

.faq-question[aria-expanded="true"] + .faq-answer {
  opacity: 1;
}

/* =============================
   10. CTA
============================= */
.cta-box {
  position: relative;
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 300px;
  height: 300px;
  background: var(--accent-glow);
  filter: blur(80px);
  pointer-events: none;
}

.cta-box h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.cta-box p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-glow:hover::after { opacity: 1; }

/* =============================
   11. FOOTER
============================= */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  background: var(--bg-base);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand .logo-text {
  font-weight: 800;
  font-size: 1.125rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: 0.2s;
}

.footer-links a:hover { color: var(--text-main); }

/* =============================
   12. ANIMATIONS
============================= */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}

.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* =============================
   13. RESPONSIVE MEDIA QUERIES
============================= */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-description { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .app-mockup { transform: none; }
}

@media (max-width: 768px) {
  /* Hide standard nav links and primary button, but keep language button visible */
  .nav-links, .nav-actions .btn-primary { display: none; }
  .hamburger { display: flex; }
  
  .nav-actions {
    gap: 0.5rem;
  }
  
  .nav-links.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 2rem;
  }

  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* =============================
   14. RTL & ARABIC SUPPORT
============================= */
html[dir="rtl"] body {
  font-family: 'Cairo', var(--font-sans);
}

html[dir="rtl"] h1, 
html[dir="rtl"] h2, 
html[dir="rtl"] h3, 
html[dir="rtl"] h4 {
  letter-spacing: 0; 
}

html[dir="rtl"] .hero-badge svg,
html[dir="rtl"] .btn-primary svg {
  transform: rotate(180deg);
}

html[dir="rtl"] .steps-line {
  left: auto;
  right: 24px;
}

html[dir="rtl"] .faq-question {
  text-align: right; 
}