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

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  scroll-behavior: smooth;
  background: #0a0e27;
  overflow-x: hidden;
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 60px;
  background: transparent;
  color: #fff;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(0px);
}

header.scrolled {
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px 60px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

header nav {
  display: flex;
  gap: 40px;
}

header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: all 0.3s ease;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

header nav a:hover::after {
  width: 100%;
}

header nav a:hover {
  color: #667eea;
  transform: translateY(-2px);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #fff;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Section Styles */
section {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px;
  position: relative;
  overflow: hidden;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  position: relative;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease;
}

.hero p {
  font-size: 1.4rem;
  margin-top: 20px;
  max-width: 800px;
  line-height: 1.8;
  opacity: 0.95;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero .cta {
  margin-top: 40px;
  display: inline-block;
  padding: 18px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 50px;
  font-size: 1.1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  animation: fadeInUp 1s ease 0.4s both;
  position: relative;
  overflow: hidden;
}

.hero .cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.hero .cta:hover::before {
  left: 100%;
}

.hero .cta:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

/* Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 50px;
  max-width: 1400px;
  width: 100%;
  padding: 0 20px;
}

.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 35px 25px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(102, 126, 234, 0.5);
}

.card h3 {
  margin-bottom: 15px;
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.card p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.card .cta {
  margin-top: 20px;
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 25px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.card .cta:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* Section Headers */
section h2 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Features */
.features img {
  max-width: 100%;
  width: 100%;
  height: 250px;
  margin: 25px auto;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.features img:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Feature Card with Image */
.features .card {
  max-width: 100%;
}

/* Icon Boxes for Visual Appeal */
.icon-box {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.card:hover .icon-box {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
}

/* Footer */
footer {
  padding: 60px 40px;
  text-align: center;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 100%);
  color: #fff;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

footer p {
  font-size: 1rem;
  opacity: 0.8;
}

footer .cta {
  display: inline-block;
  margin-top: 25px;
  padding: 15px 35px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 25px rgba(102, 126, 234, 0.4);
}

footer .cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(102, 126, 234, 0.6);
}

/* Gradient Box */
.gradient-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 40px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  margin: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

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

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

/* Card Height Standardization */
.features .card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.features .card h3 {
  flex-shrink: 0;
}

.features .card p {
  flex-grow: 1;
}

.features .card .feature-visual {
  margin-top: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  header nav {
    gap: 25px;
  }

  header nav a {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 15px 20px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  header.scrolled {
    padding: 12px 20px;
  }

  .logo {
    font-size: 1.5rem;
  }

  .hamburger {
    display: flex;
  }

  header nav {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 250px;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 80px 30px 30px;
    gap: 25px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  header nav.active {
    right: 0;
  }

  header nav a {
    font-size: 1.1rem;
    padding: 10px 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .hero {
    min-height: auto;
    padding-top: 100px !important;
  }

  .hero h1 {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  .hero p {
    font-size: 1rem;
    white-space: normal !important;
  }

  section h2 {
    font-size: 2rem;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  section {
    padding: 80px 20px;
  }

  .features .card {
    min-height: auto;
  }

  /* Fix feature-visual grids for mobile */
  .feature-visual {
    padding: 20px !important;
  }

  .feature-visual div[style*="display: grid"],
  .feature-visual div[style*="display: flex"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .feature-visual div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .feature-visual div[style*="min-width"] {
    min-width: 100% !important;
  }

  .feature-visual div[style*="font-size: 2rem"][style*="margin"] {
    display: none !important;
  }
}

@media (max-width: 480px) {
  header {
    padding: 12px 15px;
  }

  .logo {
    font-size: 1.3rem;
  }

  header nav {
    gap: 10px;
  }

  header nav a {
    font-size: 0.75rem;
  }

  .hero {
    padding-top: 160px !important;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .hero .cta {
    padding: 14px 30px;
    font-size: 0.95rem;
  }

  section h2 {
    font-size: 1.6rem;
  }

  section {
    padding: 60px 15px;
  }

  /* Additional mobile fixes for smaller screens */
  .feature-visual {
    padding: 15px !important;
  }

  .feature-visual div[style*="padding"] {
    padding: 12px !important;
  }

  .feature-visual div[style*="font-size: 2.5rem"] {
    font-size: 1.8rem !important;
  }
}

/* ========================================
   RTL (Right-to-Left) Support for Arabic
   ======================================== */

[dir="rtl"] {
  /* Global RTL text alignment */
  text-align: right;
}

/* Header RTL adjustments */
[dir="rtl"] header {
  flex-direction: row-reverse;
}

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

/* Navigation links RTL */
[dir="rtl"] header nav a::after {
  left: auto;
  right: 0;
}

/* Hero section RTL */
[dir="rtl"] .hero {
  text-align: right;
}

[dir="rtl"] .hero h1,
[dir="rtl"] .hero p {
  text-align: right;
}

/* Cards and grid layouts RTL */
[dir="rtl"] .grid,
[dir="rtl"] .cards {
  direction: rtl;
}

[dir="rtl"] .card {
  text-align: right;
}

[dir="rtl"] .card h3,
[dir="rtl"] .card p {
  text-align: right;
}

/* Features section RTL */
[dir="rtl"] .feature {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .feature-text {
  text-align: right;
}

/* Agent cards RTL */
[dir="rtl"] .agent-card {
  text-align: right;
}

[dir="rtl"] .agent-card h3,
[dir="rtl"] .agent-card p {
  text-align: right;
}

/* Use case cards RTL */
[dir="rtl"] .usecase-card {
  text-align: right;
}

[dir="rtl"] .usecase-card h3,
[dir="rtl"] .usecase-card p {
  text-align: right;
}

/* Trust badges RTL */
[dir="rtl"] .trust-grid {
  direction: rtl;
}

[dir="rtl"] .trust-badge {
  text-align: right;
}

/* FAQ section RTL */
[dir="rtl"] .faq-grid {
  direction: rtl;
}

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

/* Contact form RTL */
[dir="rtl"] .contact-form {
  text-align: right;
}

[dir="rtl"] .contact-form label {
  text-align: right;
}

[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea,
[dir="rtl"] .contact-form select {
  text-align: right;
  direction: rtl;
}

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

/* Footer RTL */
[dir="rtl"] footer {
  text-align: right;
}

[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-column {
  text-align: right;
}

/* Buttons RTL - keep centered text */
[dir="rtl"] .cta,
[dir="rtl"] button {
  text-align: center;
}

/* List items RTL */
[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-right: 20px;
  padding-left: 0;
}

/* Padding and margin adjustments for RTL */
[dir="rtl"] .feature-visual {
  margin-right: 0;
  margin-left: 30px;
}

/* Language switcher RTL adjustments */
[dir="rtl"] .lang-switcher-dropdown {
  left: 0;
  right: auto;
}

/* Mobile hamburger menu RTL */
[dir="rtl"] .hamburger {
  left: 20px;
  right: auto;
}

/* Mobile navigation RTL */
@media (max-width: 768px) {
  [dir="rtl"] .mobile-menu {
    right: auto;
    left: 0;
  }

  [dir="rtl"] header nav {
    align-items: flex-end;
  }
}

/* Ensure proper font rendering for Arabic */
[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] textarea {
  font-family: 'Poppins', 'Arial', 'Helvetica', sans-serif;
  letter-spacing: normal;
}

/* Fix gradient text for RTL */
[dir="rtl"] .logo {
  direction: ltr;
  display: inline-block;
}

/* Section titles RTL */
[dir="rtl"] section h2,
[dir="rtl"] section h3,
[dir="rtl"] section p {
  text-align: right;
}

/* Grid alignment RTL */
[dir="rtl"] .about-grid,
[dir="rtl"] .values-grid,
[dir="rtl"] .agents-grid,
[dir="rtl"] .usecases-grid {
  direction: rtl;
}

/* Agent page specific RTL */
[dir="rtl"] .agent-hero {
  text-align: right;
}

[dir="rtl"] .problem-section,
[dir="rtl"] .solution-section,
[dir="rtl"] .features-section {
  text-align: right;
}

/* Ensure all text content is right-aligned in RTL */
[dir="rtl"] * {
  text-align: right;
}

/* But keep centered elements centered */
[dir="rtl"] .hero h1,
[dir="rtl"] .hero .cta,
[dir="rtl"] section.text-center,
[dir="rtl"] .text-center {
  text-align: center !important;
}

/* Keep logos and icons in their natural direction */
[dir="rtl"] img,
[dir="rtl"] svg {
  direction: ltr;
}
