/* =========================
   HERO SECTION
========================= */
.home {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #020d1f;
  color: #fff;
  font-family: 'Cairo', 'Montserrat', sans-serif;;
  font-size: 14px;
}

.home-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.home-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(2, 13, 31, 0.93) 0%,
    rgba(2, 13, 31, 0.86) 42%,
    rgba(2, 13, 31, 0.35) 68%,
    rgba(2, 13, 31, 0.12) 100%
  );
}

/* Arabic/RTL version */
[dir="rtl"] .home-bg,
html[lang="ar"] .home-bg {
  background-image: url('/static/images/homePageAr.avif');
  transform: none;
}

[dir="rtl"] .home-bg::after,
html[lang="ar"] .home-bg::after {
  display: none;
}

[dir="rtl"] .home-bg::after {
  display: block;
  background: linear-gradient(
    -105deg,
    rgba(2, 13, 31, 0.93) 0%,
    rgba(2, 13, 31, 0.86) 42%,
    rgba(2, 13, 31, 0.35) 68%,
    rgba(2, 13, 31, 0.12) 100%
  );
}

/* Dot-wave accent */
.home-dots {
  position: absolute;
  bottom: 200px;
  left: 36%;
  width: 300px;
  height: 110px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(circle, #2563eb 1.3px, transparent 1.3px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse 80% 60% at 30% 60%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 30% 60%, black 40%, transparent 100%);
  transform: skewX(-8deg);
}

[dir="rtl"] .home-dots {
  left: auto;
  right: 36%;
  transform: skewX(8deg);
}

/* Main container override */
.home .container {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 4rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: calc(100vh - 90px - 172px);
  padding: 3rem 0 2rem;
  gap: 2rem;
}

.home-content { max-width: 600px; }

/* Badge */
.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.38);
  color: #93c5fd;
  font-size: 14px;
  font-weight: 500;
  padding: 0.38rem 1rem;
  border-radius: 50px;
  letter-spacing: 0.02em;
  margin-bottom: 1.6rem;
}

.home-badge::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 7px #2563eb;
}

/* Title */
.home-title {
  font-size: 45px;
  font-weight: 800;
  line-height: 1.11;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 1rem;
}

.home-title .text-gradient { color: #3b82f6; }

/* Sub-headline */
.home-subtitle {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}
.home-subtitle .text-blue { color: #3b82f6; }

/* Body copy */
.home-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.62);
  line-height: 1.75;
  max-width: 470px;
  margin-bottom: 2rem;
}

/* Buttons */
.home-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.home-btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.72rem 1.6rem;
  border-radius: 9px;
  font-family: 'Cairo', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.home-btn-gradient:hover { background: #1d4ed8; transform: translateY(-1px); }

/* Fix FA icons inside buttons in RTL */
.home-btn-gradient i,
.home-btn-outline i {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.home-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.32);
  padding: 0.72rem 1.6rem;
  border-radius: 9px;
  font-family: 'Cairo', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.home-btn-outline:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

/* Feature bar */
.features-bottom {
  position: relative;
  z-index: 5;
  background: rgba(8, 24, 52, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(37, 99, 235, 0.2);
  padding: 1.8rem 4rem;
}

.features-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 1.4rem;
  border-right: 1px solid rgba(37, 99, 235, 0.16);
  gap: 0.85rem;
}
.feature-item:last-child { border-right: none; }

.feature-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent RTL from breaking icon rendering */
  direction: ltr;
  unicode-bidi: normal;
}

.feature-icon-wrap i {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-size: 1.25rem;
  color: #60a5fa;
}

.feature-icon-wrap svg {
  width: 22px; height: 22px;
  stroke: #60a5fa;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  direction: ltr;
}

.feature-label { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.4; letter-spacing: -0.01em; }
.feature-desc  { font-size: 14px; color: rgba(255,255,255,0.48); line-height: 1.5; margin-top: -0.25rem; }

/* =========================
   RTL — Hero
========================= */
[dir="rtl"] .home-grid    { direction: rtl; }
[dir="rtl"] .home-content { text-align: right; }
[dir="rtl"] .home-badge   { flex-direction: row-reverse; }
[dir="rtl"] .home-actions { flex-direction: row-reverse; }
[dir="rtl"] .home-btn-gradient { flex-direction: row-reverse; }
[dir="rtl"] .home-btn-outline  { flex-direction: row-reverse; }

/* Font sizes — same as LTR */
[dir="rtl"] .home-title    { font-size: 45px; }
[dir="rtl"] .home-subtitle { font-size: 20px; }
[dir="rtl"] .home-sub      { font-size: 14px; }
[dir="rtl"] .home-badge    { font-size: 14px; }
[dir="rtl"] .home-btn-gradient { font-size: 14px; }
[dir="rtl"] .home-btn-outline  { font-size: 14px; }
[dir="rtl"] .feature-label { font-size: 14px; }
[dir="rtl"] .feature-desc  { font-size: 14px; }

/* Icons — always LTR, never flip */
[dir="rtl"] .feature-icon-wrap       { direction: ltr; unicode-bidi: normal; }
[dir="rtl"] .feature-icon-wrap i     { direction: ltr; unicode-bidi: isolate; transform: none !important; }
[dir="rtl"] .feature-icon-wrap svg   { direction: ltr; transform: none !important; }
[dir="rtl"] .home-btn-gradient i,
[dir="rtl"] .home-btn-outline i      { direction: ltr; unicode-bidi: isolate; transform: none !important; }

[dir="rtl"] .feature-item { border-right: none; border-left: 1px solid rgba(37, 99, 235, 0.16); }
[dir="rtl"] .feature-item:last-child { border-left: none; }

/* =========================
   RESPONSIVE — Hero
========================= */
@media (max-width: 1200px) {
  .home .container { padding: 0 2.5rem; }
  .features-bottom { padding: 1.8rem 2.5rem; }
}

@media (max-width: 992px) {
  .home .container { padding: 0 2rem; }
  .home-grid { grid-template-columns: 1fr; min-height: auto; padding: 3rem 0 2rem; gap: 0; text-align: center; }
  .home-content { max-width: 100%; }
  .home-badge { margin-left: auto; margin-right: auto; }
  .home-sub   { margin-left: auto; margin-right: auto; }
  .home-actions { justify-content: center; }
  .home-grid > div:last-child:empty { display: none; }
  .home-bg::after {
    background: linear-gradient(180deg, rgba(2,13,31,0.92) 0%, rgba(2,13,31,0.80) 60%, rgba(2,13,31,0.70) 100%);
  }
  .features-bottom { padding: 1.5rem 2rem; }
  .features-inner  { grid-template-columns: repeat(2, 1fr); }
  .feature-item { border-right: none; border-bottom: 1px solid rgba(37,99,235,0.16); padding: 1.2rem 1rem; }
  .feature-item:nth-child(odd)  { border-right: 1px solid rgba(37,99,235,0.16); }
  .feature-item:nth-last-child(-n+2) { border-bottom: none; }

  [dir="rtl"] .home-actions { justify-content: center; }
  [dir="rtl"] .home-content { text-align: center; }
  [dir="rtl"] .home-badge   { margin-left: auto; margin-right: auto; }
  [dir="rtl"] .feature-item { border-left: none; border-bottom: 1px solid rgba(37,99,235,0.16); }
  [dir="rtl"] .feature-item:nth-child(odd) { border-left: 1px solid rgba(37,99,235,0.16); }
}

@media (max-width: 768px) {
  .home .container { padding: 0 1.25rem; }
  .home-grid    { padding: 2.5rem 0 1.5rem; }
  .home-title   { font-size: clamp(1.9rem, 7vw, 2.6rem); }
  [dir="rtl"] .home-title { font-size: clamp(1.9rem, 7vw, 2.6rem); }
  .home-subtitle { font-size: clamp(1rem, 4vw, 1.15rem); }
  [dir="rtl"] .home-subtitle { font-size: clamp(1rem, 4vw, 1.15rem); }
  .home-sub     { font-size: 14px; }
  .home-dots    { display: none; }
  .features-bottom { padding: 1rem 1.25rem; }
  .features-inner  { grid-template-columns: repeat(2, 1fr); }
  .feature-item { padding: 0.9rem 0.75rem; gap: 0.65rem; }
  .feature-icon-wrap { width: 44px; height: 44px; }
  .feature-label { font-size: 14px; }
  .feature-desc  { display: none; }
  .home-actions { flex-direction: column; width: 100%; gap: 0.75rem; }
  .home-btn-gradient, .home-btn-outline { width: 100%; justify-content: center; padding: 0.85rem 1.25rem; }

  [dir="rtl"] .home-content { text-align: center; }
  [dir="rtl"] .home-actions { flex-direction: column; }
}

@media (max-width: 640px) {
  .home-title  { font-size: clamp(1.7rem, 8.5vw, 2.2rem); }
  [dir="rtl"] .home-title { font-size: clamp(1.7rem, 8.5vw, 2.2rem); }
  .home-badge  { font-size: 14px; padding: 0.32rem 0.85rem; }
  .features-inner { grid-template-columns: repeat(2, 1fr); }
  .feature-item   { padding: 0.8rem 0.5rem; }
  .feature-icon-wrap { width: 38px; height: 38px; }
  .feature-icon-wrap i   { font-size: 1rem; }
  .feature-icon-wrap svg { width: 18px; height: 18px; }
  .feature-label { font-size: 14px; }
}

@media (max-width: 480px) {
  .home-grid    { padding: 2rem 0 1.5rem; }
  .home-title   { font-size: clamp(1.55rem, 9vw, 2rem); line-height: 1.15; }
  [dir="rtl"] .home-title { font-size: clamp(1.55rem, 9vw, 2rem); }
  .home-subtitle { font-size: 0.97rem; }
  [dir="rtl"] .home-subtitle { font-size: 0.97rem; }
  .home-sub     { font-size: 14px; }
  .home-badge   { font-size: 14px; }
  .home-btn-gradient, .home-btn-outline { font-size: 14px; padding: 0.78rem 1rem; }
  .features-inner { grid-template-columns: 1fr; }
  .feature-item {
    flex-direction: row !important;
    text-align: left !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(37,99,235,0.16);
    padding: 0.85rem 1rem;
    gap: 1rem;
    align-items: center;
  }
  .feature-item:last-child  { border-bottom: none; }
  .feature-icon-wrap { flex-shrink: 0; width: 40px; height: 40px; }
  .feature-label { font-size: 14px; text-align: left; }

  [dir="rtl"] .feature-item  { text-align: right !important; }
  [dir="rtl"] .feature-label { text-align: right; font-size: 14px; }
  [dir="rtl"] .home-btn-gradient,
  [dir="rtl"] .home-btn-outline { flex-direction: row-reverse; justify-content: center; font-size: 14px; }
}