/* Font Face Declarations - Tajawal */
@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-200.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-300.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-800.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url('./fonts/tajawal-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Font Face Declarations - Cairo */
@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-200.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-300.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-800.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('./fonts/cairo-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-dark: #0a0e27;
  --bg-dark-secondary: #141b2d;
  --bg-light: #ffffff;
  --bg-light-secondary: #f8fafc;
  --text-dark: #ffffff;
  --text-light: #1e293b;
  --text-muted-dark: #94a3b8;
  --text-muted-light: #64748b;
  --card-dark: rgba(255, 255, 255, 0.05);
  --card-light: rgba(255, 255, 255, 0.9);
  --border-dark: rgba(255, 255, 255, 0.1);
  --border-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-light: 0 20px 60px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-dark);
  overflow-x: hidden;
  transition: var(--transition);
  line-height: 1.6;
}

body.light {
  background: var(--bg-light);
  color: var(--text-light);
}

/* Arabic Typography - Force Arabic fonts for RTL content */
/* JavaScript sets dir="rtl" on <html> element, not <body> */
html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] * {
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}

/* Override Poppins for all RTL elements - Very specific selectors */
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] a,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .hero,
html[dir="rtl"] .hero *,
html[dir="rtl"] .hero-card,
html[dir="rtl"] .hero-card *,
html[dir="rtl"] header,
html[dir="rtl"] header *,
html[dir="rtl"] section,
html[dir="rtl"] section *,
html[dir="rtl"] footer,
html[dir="rtl"] footer * {
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}

/* Headings use Tajawal */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .logo-text,
html[dir="rtl"] .section-title,
html[dir="rtl"] .demo-card h3,
html[dir="rtl"] .feature-card h3,
html[dir="rtl"] .company-badge strong,
html[dir="rtl"] .notice-content strong {
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
  font-weight: 700;
}

/* Body text uses Cairo */
html[dir="rtl"] p,
html[dir="rtl"] span:not(.notice-icon),
html[dir="rtl"] div,
html[dir="rtl"] .tagline,
html[dir="rtl"] .notice-content,
html[dir="rtl"] .demo-card p,
html[dir="rtl"] .feature-card p,
html[dir="rtl"] .cta-btn,
html[dir="rtl"] .hero-description,
html[dir="rtl"] footer,
html[dir="rtl"] footer p,
html[dir="rtl"] .company-badge {
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}

/* Animated Background */
#animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  bottom: -150px;
  right: -150px;
  animation-delay: 5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

body.light .gradient-orb {
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Particles Canvas */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
}

body.light #particles {
  opacity: 0.3;
}

/* Header */
header {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
}

/* Top Controls Bar */
.top-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

html[dir="rtl"] .top-controls {
  right: auto;
  left: 20px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-dark);
  background: var(--card-dark);
  backdrop-filter: blur(10px);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.light .control-btn {
  background: var(--card-light);
  border-color: var(--border-light);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  background: var(--primary);
  color: white;
}

/* Hero Section */
.hero {
  max-width: 1200px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-container {
  margin-bottom: 30px;
}

.logo-text {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
  letter-spacing: -2px;
  line-height: 1.3;
}

.tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-muted-dark);
  font-weight: 400;
  margin-bottom: 40px;
}

body.light .tagline {
  color: var(--text-muted-light);
}

.hero-card {
  background: var(--card-dark);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 50px 40px;
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-dark);
  margin-bottom: 30px;
  transition: var(--transition);
}

body.light .hero-card {
  background: var(--card-light);
  border-color: var(--border-light);
  box-shadow: var(--shadow-light);
}

.hero-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.companies {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
}

body.light .company-badge {
  background: rgba(99, 102, 241, 0.05);
  color: var(--text-light);
}

.company-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: scale(1.05);
  border-color: var(--primary);
}

.company-badge strong {
  font-weight: 700;
  color: var(--primary);
}

/* Notices */
.notices {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.notice {
  padding: 18px 24px;
  border-radius: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  animation: slideIn 0.5s ease-out;
  animation-fill-mode: both;
}

.notice:nth-child(1) { animation-delay: 0.1s; }
.notice:nth-child(2) { animation-delay: 0.2s; }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .notice {
  animation-name: slideInRTL;
}

@keyframes slideInRTL {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notice-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.notice-client {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.notice-password {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.notice-content {
  flex: 1;
}

/* CTA Buttons */
.cta-section {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.cta-secondary {
  background: var(--card-dark);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
}

body.light .cta-secondary {
  background: var(--card-light);
  color: var(--text-light);
  border-color: var(--border-light);
}

.cta-secondary:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-3px);
}

.cta-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cta-btn:hover::before {
  width: 300px;
  height: 300px;
}

.cta-btn span {
  position: relative;
  z-index: 1;
}

/* Demos Section */
section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.demo-card {
  background: var(--card-dark);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid var(--border-dark);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

body.light .demo-card {
  background: var(--card-light);
  border-color: var(--border-light);
}

.demo-card:nth-child(1) { animation-delay: 0.1s; }
.demo-card:nth-child(2) { animation-delay: 0.2s; }
.demo-card:nth-child(3) { animation-delay: 0.3s; }
.demo-card:nth-child(4) { animation-delay: 0.4s; }
.demo-card:nth-child(5) { animation-delay: 0.5s; }
.demo-card:nth-child(6) { animation-delay: 0.6s; }

.demo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.demo-card:hover::before {
  transform: scaleX(1);
}

.demo-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.demo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
  word-break: break-word;
}

body.light .demo-card h3 {
  color: var(--text-light);
}

.demo-card p {
  color: var(--text-muted-dark);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

body.light .demo-card p {
  color: var(--text-muted-light);
}

.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.demo-link:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.demo-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 10px;
}

.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-protected {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.loading-demos {
  text-align: center;
  padding: 40px;
  color: var(--text-muted-dark);
}

body.light .loading-demos {
  color: var(--text-muted-light);
}

/* Empty State Styling */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  animation: fadeInUp 0.6s ease-out;
}

.empty-state-icon {
  font-size: 5rem;
  margin-bottom: 25px;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
}

.empty-state-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light .empty-state-title {
  color: var(--text-light);
}

.empty-state-message {
  color: var(--text-muted-dark);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

body.light .empty-state-message {
  color: var(--text-muted-light);
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.feature-card {
  background: var(--card-dark);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 35px;
  border: 1px solid var(--border-dark);
  text-align: center;
  transition: var(--transition);
}

body.light .feature-card {
  background: var(--card-light);
  border-color: var(--border-light);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-dark);
}

body.light .feature-card h3 {
  color: var(--text-light);
}

.feature-card p {
  color: var(--text-muted-dark);
  line-height: 1.8;
}

body.light .feature-card p {
  color: var(--text-muted-light);
}

.feature-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.feature-card a:hover {
  color: var(--secondary);
}

/* Footer */
footer {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-dark-secondary);
  border-top: 1px solid var(--border-dark);
  color: var(--text-muted-dark);
}

body.light footer {
  background: var(--bg-light-secondary);
  border-color: var(--border-light);
  color: var(--text-muted-light);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

footer a:hover {
  color: var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .top-controls {
    top: 10px;
    right: 10px;
  }

  html[dir="rtl"] .top-controls {
    left: 10px;
  }

  .hero-card {
    padding: 30px 20px;
  }

  .companies {
    flex-direction: column;
    align-items: center;
  }

  .demos-grid {
    grid-template-columns: 1fr;
  }

  .cta-section {
    flex-direction: column;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}