:root {
  --primary: #13ADEC;
  --secondary: #0E8FC3;
  --bg-light: #EAF8FE;
  --text-dark: #123041;
  --white: #FFFFFF;
  --section-bg: #F7FBFD;
  --gray: #647B89;
  --shadow-sm: 0 4px 10px rgba(18, 48, 65, 0.05);
  --shadow-md: 0 10px 30px rgba(18, 48, 65, 0.08);
  --shadow-lg: 0 25px 50px rgba(18, 48, 65, 0.15);
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --parallax-y: 0px;
}

/* Reset and Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body { 
  font-family: 'Nunito', sans-serif; 
  color: var(--text-dark); 
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.ar {
  font-family: 'Tajawal', sans-serif;
  text-align: right;
  direction: rtl;
}

/* General Layout Utility */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
.section-bg { background-color: var(--section-bg); }
.hero-bg { background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%); }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.pb-5 { padding-bottom: 3rem; }
.pt-nav { padding-top: 120px; }
.text-muted { color: var(--gray); }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* Typography */
h1, h2, h3, h4 { color: var(--text-dark); line-height: 1.3; font-weight: 800; }
body.ar h1, body.ar h2, body.ar h3, body.ar h4 { font-weight: 800; }
a { text-decoration: none; color: inherit; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  gap: 0.5rem;
}
.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(19, 173, 236, 0.4);
}
.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.navbar.scrolled {
  box-shadow: var(--shadow-sm);
  height: 75px;
}
.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.logo img { height: 45px; transition: var(--transition); }
.navbar.scrolled .logo img { height: 38px; }

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2.2rem;
}
.nav-links a {
  font-weight: 700;
  transition: var(--transition);
  color: var(--text-dark);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.nav-btn { color: var(--white); }
.nav-links a.nav-btn:hover { color: var(--white); }
.lang-switch-btn {
  font-family: 'Tajawal', sans-serif;
  color: var(--primary) !important;
  background: var(--bg-light);
  padding: 5px 12px;
  border-radius: 20px;
}
html[dir="rtl"] .lang-switch-btn { font-family: 'Nunito', sans-serif; }

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}
.mobile-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text-dark);
  margin: 6px 0;
  transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border-radius: 3px;
}
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -7px); }


/* Scroll Reveal Classes */
.scroll-reveal {
  opacity: 0;
  visibility: hidden;
  transition: all 0.9s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: opacity, transform;
}
.scroll-reveal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(0) scale(1);
}
.fade-up { transform: translateY(60px); }
.fade-left { transform: translateX(60px); }
.fade-right { transform: translateX(-60px); }
.zoom-in { transform: scale(0.85); }
/* RTL adaptations */
html[dir="rtl"] .fade-left { transform: translateX(-60px); }
html[dir="rtl"] .fade-right { transform: translateX(60px); }

/* Parallax element styling */
.parallax {
  transform: translateY(var(--parallax-y));
  will-change: transform;
}

/* Glassmorphism Classes */
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  box-shadow: var(--shadow-md);
  padding: 3rem;
  transition: var(--transition);
}
.glass-form {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  padding: 3rem;
}

/* Hero Section */
.hero {
  padding: 10rem 0 5rem;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
}
.hero-content {
  flex: 1.2;
}
.badge {
  display: inline-block;
  background: rgba(19, 173, 236, 0.1);
  color: var(--primary);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.hero-content h1 {
  font-size: 3.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}
.hero-content p {
  font-size: 1.3rem;
  color: var(--gray);
  margin-bottom: 2.5rem;
  max-width: 90%;
}
.hero-cta {
  display: flex;
  gap: 1.5rem;
}
.hero-image {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
}
.blob-shape {
  position: absolute;
  width: 550px;
  height: 550px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  animation: blobFlow 12s ease-in-out infinite alternate;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.08;
}
.floating-mockup {
  z-index: 1;
  max-width: 320px;
  animation: float 6s ease-in-out infinite;
  border-radius: 35px;
  box-shadow: 0 35px 70px rgba(18,48,65,0.2);
}
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-25px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}
@keyframes blobFlow {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

/* Sections Setup */
.highlight-section, .about, .services, .how-it-works, .faq, .contact {
  padding: 7rem 0;
}
.highlight-container {
  display: flex;
  align-items: center;
  gap: 5rem;
}
.row-reverse { flex-direction: row-reverse; }
.highlight-image { flex: 1; position: relative; }
.highlight-content { flex: 1; }
.section-title {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}
.section-title h2 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}
.section-title p {
  color: var(--gray);
  font-size: 1.2rem;
}

/* Mockups and Images */
.rounded-image {
  border-radius: 25px;
  width: 100%;
  max-width: 240px; /* Constrain the max width further for long screens */
  margin: 0 auto;
  display: block;
}
.mockup-wrapper {
  position: relative;
  z-index: 1;
  display: flex; /* Center the image in the wrapper */
  justify-content: center;
}
.mockup-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 260px; /* Adjust border tracking image size */
  height: 105%;
  border: 4px solid var(--primary);
  border-radius: 30px;
  z-index: -1;
  opacity: 0.2;
}

.icon-box {
  width: 70px;
  height: 70px;
  background: var(--bg-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}
.highlight-content h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
.highlight-content p { font-size: 1.2rem; color: var(--gray); margin-bottom: 2rem; line-height: 1.8; }

.features-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.feature-item { display: flex; align-items: center; gap: 1rem; font-size: 1.1rem; font-weight: 600; }
.feature-item .check {
  background: var(--primary);
  color: var(--white);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Stats */
.stats-row { display: flex; gap: 3rem; }
.stat-box h3 { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.2rem; }
.stat-box p { color: var(--gray); font-weight: 600; margin: 0; }

/* Services Grid */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; }
.service-card {
  background: var(--white);
  padding: 3rem 2.5rem;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.02);
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0); transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.service-card:hover { transform: translateY(-15px); box-shadow: var(--shadow-lg); }
.service-card:hover::before { transform: scaleX(1); }
.service-icon { font-size: 3rem; margin-bottom: 1.5rem; }
.service-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.service-card p { color: var(--gray); }

/* How It Works Steps */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.step { text-align: center; position: relative; }
.step-num {
  width: 80px; height: 80px; margin: 0 auto 1.5rem;
  background: var(--bg-light); color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; box-shadow: var(--shadow-sm); position: relative;
}
.step h3 { font-size: 1.3rem; }
.step::after {
  content: '→'; position: absolute; top: 40px; right: -20px;
  font-size: 2rem; color: var(--primary); opacity: 0.3;
}
.step:last-child::after { display: none; }
html[dir="rtl"] .step::after { content: '←'; left: -20px; right: auto; }

/* App Showcase Interactive */
.app-showcase { position: relative; padding: 6rem 0; min-height: 80vh; }
.showcase-gallery { display: flex; justify-content: center; align-items: center; position: relative; height: 600px; margin-top: 4rem; }
.showcase-img {
  position: absolute; border-radius: 35px; box-shadow: var(--shadow-lg);
  max-width: 320px; transition: transform 0.1s ease-out;
}
.img-center { z-index: 3; width: 280px; transform: translateY(var(--parallax-y)); }
.img-left {
  z-index: 2; left: 20%; opacity: 0.85; filter: blur(2px);
  transform: scale(0.8) rotate(-8deg) translateY(calc(var(--parallax-y)*1.5));
}
html[dir="rtl"] .img-left { right: 20%; left: auto; transform: scale(0.8) rotate(8deg) translateY(calc(var(--parallax-y)*1.5)); }
.img-right {
  z-index: 2; right: 20%; opacity: 0.85; filter: blur(2px);
  transform: scale(0.8) rotate(8deg) translateY(calc(var(--parallax-y)*0.8));
}
html[dir="rtl"] .img-right { left: 20%; right: auto; transform: scale(0.8) rotate(-8deg) translateY(calc(var(--parallax-y)*0.8)); }

/* Download Section */
.download-section {
  padding: 8rem 0;
  border-top: 1px solid rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.store-buttons-mega {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-store {
  display: inline-flex;
  align-items: center;
  background: var(--text-dark);
  color: var(--white) !important;
  padding: 0.8rem 1.8rem;
  border-radius: 18px;
  gap: 15px;
  transition: var(--transition);
  border: none;
}
.btn-store:hover {
  transform: translateY(-5px);
  background: var(--primary);
  box-shadow: var(--shadow-md);
  color: var(--white) !important;
}
.btn-store img {
  filter: brightness(0) invert(1);
}
.btn-store-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.btn-store-text.text-left { text-align: left; }
html[dir="rtl"] .btn-store-text.text-left { text-align: right; }
.btn-store-text small {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 500;
}
.btn-store-text strong {
  font-size: 1.3rem;
  font-weight: 800;
}
.mx-auto { margin-left: auto; margin-right: auto; }
.justify-content-center { justify-content: center; }
.drop-shadow-lg { box-shadow: 0 15px 35px rgba(18, 48, 65, 0.15); }

/* FAQ Accordion */
.faq-container { max-width: 800px; }
.accordion { display: flex; flex-direction: column; gap: 1rem; }
.accordion-item {
  background: var(--white); border-radius: 20px; padding: 0.5rem 1.5rem;
  box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid rgba(0,0,0,0.03);
}
.accordion-item:hover { box-shadow: var(--shadow-md); }
.accordion-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 0; cursor: pointer; user-select: none;
}
.accordion-header h4 { font-size: 1.2rem; margin: 0; }
.accordion-header .icon { font-size: 1.8rem; color: var(--primary); transition: var(--transition); }
.accordion-header.active .icon { transform: rotate(45deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.accordion-body p { padding-bottom: 1.5rem; color: var(--gray); }

/* Contact Form */
.contact-container { display: flex; align-items: stretch; gap: 5rem; }
.contact-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.contact-form-wrapper { flex: 1.2; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; }
.form-control {
  width: 100%; padding: 1rem 1.5rem; border: 2px solid transparent;
  background: var(--bg-light); border-radius: 15px; font-family: inherit;
  font-size: 1rem; transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 4px rgba(19, 173, 236, 0.1); }
textarea.form-control { resize: vertical; min-height: 120px; }
.btn-block { width: 100%; font-size: 1.1rem; }

/* CAPTCHA Styles */
.captcha-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-wrapper .form-control {
  flex: 1;
}
.captcha-img {
  height: 50px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--primary);
}
.captcha-refresh-btn {
  padding: 0;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loader */
.btn-loading { position: relative; pointer-events: none; opacity: 0.9; }
.btn-loading .btn-text { opacity: 0; }
.loader {
  display: none; position: absolute; width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: var(--white);
  border-radius: 50%; animation: spin 1s infinite linear;
}
.btn-loading .loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Form Messages */
.form-message { padding: 1rem; border-radius: 10px; font-weight: 700; display: none; text-align: center; }
.form-message.success { display: block; background: #e0f2e9; color: #2d7a5b; }
.form-message.error { display: block; background: #fdeaea; color: #c93535; }

/* Footer */
.footer { background: var(--text-dark); color: rgba(255,255,255,0.7); padding: 5rem 0 2rem; margin-top: 4rem; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 4rem; margin-bottom: 4rem; }
.footer-logo { filter: brightness(0) invert(1); height: 50px; margin-bottom: 1.5rem; }
.footer-col h3 { color: var(--white); margin-bottom: 1.5rem; font-size: 1.2rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col a { transition: var(--transition); }
.footer-col a:hover { color: var(--primary); padding-inline-start: 5px; }
.store-links { display: flex; flex-direction: column; gap: 1rem; }
.store-btn {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.1);
  padding: 10px 20px; border-radius: 12px; color: var(--white); font-weight: 600; transition: var(--transition);
}
.store-btn img { filter: brightness(0) invert(1); }
.store-btn:hover { background: var(--primary); transform: translateY(-3px); }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* Responsive adjustments */
@media (max-width: 992px) {
  .hero-container, .highlight-container, .contact-container { flex-direction: column; text-align: center; }
  .row-reverse { flex-direction: column; }
  .hero-content h1 { font-size: 2.8rem; }
  .hero-cta { justify-content: center; }
  .features-list { align-items: center; }
  .stats-row { justify-content: center; }
  .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .contact-form-wrapper { width: 100%; max-width: 600px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: var(--white); flex-direction: column; padding: 2rem 0; gap: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  }
  .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  .step::after { display: none; }
  .showcase-gallery { height: 400px; }
  .img-center { width: 220px; }
  .img-left, .img-right { width: 160px; filter: blur(3px); }
  .img-left { left: 5%; } .img-right { right: 5%; }
  html[dir="rtl"] .img-left { right: 5%; } html[dir="rtl"] .img-right { left: 5%; }
  
  .footer-content { grid-template-columns: 1fr; }
  .hero { padding-top: 8rem; }
}
