/* features.css — Final Reference Match */

.features { padding: 70px 0 90px; position: relative; z-index: 2; }

/* ══════════════════════════════════════════
   SECTION 1: HEADER
   ══════════════════════════════════════════ */
.features-header {
  max-width: 1100px;
  margin: 0 auto 52px;
  padding: 0 24px;
}

.features-header h2 {
  font-size: 44px;
  font-weight: 900;
  margin-bottom: 16px;
  color: #fff;
  letter-spacing: -0.5px;
}

.features-header p {
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 17px;
  max-width: 600px;
}

html[dir="rtl"] .features-header { text-align: right; }
html:not([dir="rtl"]) .features-header { text-align: left; }

/* ══════════════════════════════════════════
   SECTION 2: STATS — POLISHED GLASS (TASK 3)
   ══════════════════════════════════════════ */
.stats-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto 72px;
  padding: 36px 32px;
  border-radius: 22px;
  background: rgba(53, 217, 255, 0.03);
  border: 1px solid rgba(53, 217, 255, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 40px rgba(53, 217, 255, 0.06),
    0 0 80px rgba(53, 217, 255, 0.03),
    inset 0 1px 0 rgba(53, 217, 255, 0.06);
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  transition: background 0.3s, transform 0.3s;
}

.stat-item:hover {
  background: rgba(53, 217, 255, 0.04);
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(53, 217, 255, 0.08);
  border: 1px solid rgba(53, 217, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 20px;
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(53, 217, 255, 0.1);
  transition: box-shadow 0.3s, transform 0.3s;
}

.stat-item:hover .stat-icon {
  box-shadow: 0 0 24px rgba(53, 217, 255, 0.2);
  transform: scale(1.06);
}

.stat-item h3 {
  font-size: 38px;
  font-weight: 900;
  color: var(--cyan);
  margin-bottom: 6px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.stat-item p {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 80px;
  background: linear-gradient(180deg, transparent 5%, rgba(53, 217, 255, 0.25) 50%, transparent 95%);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   SECTION 3: FEATURES GRID — PREMIUM (TASK 4)
   ══════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 72px;
  padding: 0 24px;
}

.feature-card {
  padding: 32px 26px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease,
              box-shadow 0.35s ease,
              background 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: rgba(53, 217, 255, 0.35);
  background: rgba(53, 217, 255, 0.03);
  box-shadow: 0 16px 48px rgba(53, 217, 255, 0.12), 0 0 24px rgba(53, 217, 255, 0.06);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(53, 217, 255, 0.1);
  border: 1px solid rgba(53, 217, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--cyan);
  margin-bottom: 18px;
  box-shadow: 0 0 12px rgba(53, 217, 255, 0.08);
  transition: box-shadow 0.35s, transform 0.35s, background 0.35s;
}

.feature-card:hover .feature-icon {
  box-shadow: 0 0 24px rgba(53, 217, 255, 0.3);
  transform: scale(1.1);
  background: rgba(53, 217, 255, 0.16);
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}

.feature-accent {
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
  margin-bottom: 14px;
  opacity: 0.8;
}

.feature-card p {
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.7;
  font-size: 13px;
}

/* ══════════════════════════════════════════
   SECTION 4: THREE BOXES IN ONE ROW
   ══════════════════════════════════════════ */
.info-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 72px;
  padding: 0 24px;
  align-items: stretch;
}

.info-box {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 30px 24px;
}

.info-box h3 {
  font-size: 20px;
  font-weight: 900;
  color: var(--cyan);
  margin-bottom: 22px;
  text-align: center;
}

.info-box-desc {
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.6;
}

/* ── BENEFITS ── */
.info-box .benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  transition: border-color 0.3s, transform 0.3s;
}

.benefit-item:hover {
  border-color: rgba(53, 217, 255, 0.2);
  transform: translateY(-2px);
}

.benefit-item i {
  font-size: 14px;
  color: var(--cyan);
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

/* ── HORIZONTAL TIMELINE (TASK 2) ── */
.timeline-h {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding-top: 8px;
}

.timeline-track {
  position: absolute;
  top: 26px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), rgba(53, 217, 255, 0.15));
  border-radius: 1px;
}

html[dir="rtl"] .timeline-track {
  background: linear-gradient(270deg, var(--cyan), rgba(53, 217, 255, 0.15));
}

.tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 2px;
}

.tl-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #00131e;
  flex-shrink: 0;
  margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(53, 217, 255, 0.35);
  transition: transform 0.3s, box-shadow 0.3s;
}

.tl-step:hover .tl-circle {
  transform: scale(1.15);
  box-shadow: 0 0 24px rgba(53, 217, 255, 0.5);
}

.tl-step h4 {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1.3;
}

.tl-step p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── FAQ ── */
.info-box .faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.faq-item:hover { border-color: rgba(53, 217, 255, 0.2); }
.faq-item.open { border-color: rgba(53, 217, 255, 0.25); background: rgba(53, 217, 255, 0.02); }

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 13px;
  gap: 8px;
}

/* وضوح التركيز عند التنقّل بلوحة المفاتيح (tabindex أُضيف على كل سؤال) */
.faq-question:focus-visible {
  outline: 2px solid var(--cyan, #35d9ff);
  outline-offset: -2px;
}

.faq-arrow {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.5;
  font-size: 12px;
  color: var(--cyan);
  display: flex;
  flex-shrink: 0;
}

.faq-item.open .faq-arrow { transform: rotate(45deg); opacity: 1; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0 16px;
}

.faq-item.open .faq-answer { max-height: 200px; padding: 0 16px 14px; }

.faq-answer p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.7;
}

/* ══════════════════════════════════════════
   SECTION 5: CTA + ILLUSTRATION (TASK 1)
   ══════════════════════════════════════════ */
.cta-full {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: stretch;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(53, 217, 255, 0.12);
  box-shadow: 0 0 40px rgba(53, 217, 255, 0.05);
  overflow: hidden;
  min-height: 260px;
}

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

/* ── ILLUSTRATION ── */
.cta-illustration {
  flex-shrink: 0;
  width: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(53, 217, 255, 0.04), rgba(53, 217, 255, 0.01));
}

.illust-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 217, 255, 0.15), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: illust-pulse 4s ease-in-out infinite;
  will-change: opacity, transform;
}

@keyframes illust-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.illust-card {
  position: absolute;
  border-radius: 14px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.illust-machine {
  width: 130px;
  padding: 16px 14px;
  background: rgba(53, 217, 255, 0.06);
  border: 1px solid rgba(53, 217, 255, 0.18);
  top: 28px;
  left: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

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

.illust-machine-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(53, 217, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--cyan);
  margin-bottom: 10px;
}

.illust-machine-label {
  font-size: 18px;
  font-weight: 900;
  color: var(--cyan);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.illust-machine-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.illust-machine-bar span {
  display: block;
  height: 100%;
  width: 72%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
  animation: bar-fill 3s ease-in-out infinite;
}

@keyframes bar-fill {
  0%, 100% { width: 60%; }
  50% { width: 88%; }
}

.illust-analytics {
  width: 120px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  bottom: 30px;
  right: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

html[dir="rtl"] .illust-analytics { right: auto; left: 18px; }

.illust-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  margin-bottom: 8px;
}

.illust-chart-bars span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--cyan), rgba(53, 217, 255, 0.3));
  opacity: 0.7;
  animation: bar-grow 2.5s ease-in-out infinite;
  will-change: transform;
}

/* الارتفاعات الثابتة للأعمدة — كانت style="height:..." مضمّنة في HTML؛
   نُقلت إلى هنا (توافق CSP لـ style-src) بلا أي تغيير بصري */
.illust-chart-bars span:nth-child(1) { height: 40%; }
.illust-chart-bars span:nth-child(2) { height: 65%; animation-delay: 0.2s; }
.illust-chart-bars span:nth-child(3) { height: 50%; animation-delay: 0.4s; }
.illust-chart-bars span:nth-child(4) { height: 85%; animation-delay: 0.6s; }
.illust-chart-bars span:nth-child(5) { height: 70%; animation-delay: 0.8s; }
.illust-chart-bars span:nth-child(6) { height: 55%; animation-delay: 1s; }

@keyframes bar-grow {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.7); }
}

.illust-chart-line {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.4;
}

/* ── CTA CONTENT ── */
.cta-content {
  flex: 1;
  padding: 52px 48px;
}

html[dir="rtl"] .cta-content { text-align: right; }
html:not([dir="rtl"]) .cta-content { text-align: left; }

.cta-content h2 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 14px;
  color: #fff;
}

.cta-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 26px;
}

.cta-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease,
              background 0.3s ease;
}

.cta-buttons .btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #00131e;
  box-shadow: 0 0 20px rgba(53, 217, 255, 0.25);
}

.cta-buttons .btn-primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 36px rgba(53, 217, 255, 0.45), 0 8px 24px rgba(53, 217, 255, 0.2);
}

.cta-buttons .btn-dark {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.cta-buttons .btn-dark:hover {
  transform: translateY(-4px) scale(1.03);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.06);
}

/* ══════════════════════════════════════════
   SCROLL REVEAL + STAGGER
   ══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.stagger-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stagger-child.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════
   ABOUT (shared section-header)
   ══════════════════════════════════════════ */
.about { padding: 60px 0 80px; position: relative; z-index: 2; }
.section-header { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section-header h2 { font-size: 40px; font-weight: 900; margin-bottom: 14px; }
.section-header p { color: var(--text-soft); line-height: 1.8; font-size: 17px; }
.about .section-header { max-width: 860px; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* Laptop */
@media (max-width: 1100px) {
  .cta-illustration { width: 240px; }
}

/* Tablet */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .info-row { grid-template-columns: 1fr; gap: 18px; }
  .timeline-h { padding: 8px 0; gap: 4px; }
  .tl-step h4 { font-size: 12px; }
  .tl-step p { font-size: 11px; -webkit-line-clamp: 3; }
  .cta-full { flex-direction: column; }
  html[dir="rtl"] .cta-full { flex-direction: column; }
  .cta-illustration { width: 100%; height: 180px; }
  .cta-content { padding: 36px 40px; text-align: center; }
  html[dir="rtl"] .cta-content { text-align: center; }
  .cta-content p { margin-inline: auto; }
  .cta-buttons { justify-content: center; }
  .illust-machine { top: 20px; left: 50px; }
  html[dir="rtl"] .illust-machine { left: auto; right: 50px; }
  .illust-analytics { bottom: 16px; right: 50px; }
  html[dir="rtl"] .illust-analytics { right: auto; left: 50px; }
}

/* Tablet small */
@media (max-width: 768px) {
  .features-header h2 { font-size: 32px; }
  .features-header, html[dir="rtl"] .features-header { text-align: center; }
  .features-header p { margin-inline: auto; }
  .stats-container { flex-wrap: wrap; gap: 16px; padding: 28px 20px; }
  .stat-divider { display: none; }
  .stat-item { min-width: 130px; }
  .stat-item h3 { font-size: 30px; }
  .features-grid { gap: 14px; }
  .info-box .benefits-grid { grid-template-columns: 1fr; }
  .timeline-h { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .timeline-track { display: none; }
  .tl-step { width: 30%; min-width: 90px; margin-bottom: 8px; }
}

/* Mobile */
@media (max-width: 480px) {
  .features { padding: 40px 0 60px; }
  .features-header h2 { font-size: 26px; }
  .stats-container { flex-direction: column; padding: 24px 16px; }
  .stat-item { min-width: auto; }
  .features-grid { grid-template-columns: 1fr; }
  .cta-illustration { height: 150px; }
  .cta-content h2 { font-size: 22px; }
  .cta-content { padding: 28px 20px; }
  html[dir="rtl"] .cta-content { padding: 28px 20px; }
  .cta-buttons { flex-direction: column; }
  .cta-buttons .btn { width: 100%; text-align: center; }
  .tl-step { width: 45%; }
}
