/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Cairo', sans-serif;
  background: #0c1117;
  color: #e7edf3;
  line-height: 1.7;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

section { padding: 80px 0; }
@media (max-width: 768px) { section { padding: 50px 0; } }

.section-header { text-align: center; margin-bottom: 60px; }
.section-title {
  font-size: 2.5rem; font-weight: 800; color: #e7edf3; margin-bottom: 16px;
  position: relative; display: inline-block;
}
.section-subtitle {
  font-size: 1.1rem; color: #9fb2c9; font-weight: 400; max-width: 600px; margin: 0 auto;
}
@media (max-width: 768px) {
  .section-title { font-size: 1.8rem; }
  .section-subtitle { font-size: 1rem; }
}

/* ===== Technologies Grid ===== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
  perspective: 1000px; /* تقليل المنظور قليلاً للأداء */
}

@media (max-width: 1200px) { .tech-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1024px) { .tech-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
  .tech-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* Card: Optimized */
.tech-card {
  position: relative; isolation: isolate; cursor: pointer; overflow: hidden;
  background: #0f141b; border: 1px solid #1b2430; border-radius: 18px;
  padding: 24px; text-align: center;
  
  transform-style: preserve-3d;
  /* تحسين الأداء */
  will-change: transform, opacity;
  contain: layout paint;
  
  opacity: 0;
  transform: translate3d(0, 20px, 0); /* تبسيط الحركة الابتدائية */
  
  box-shadow: 0 10px 18px rgba(0, 0, 0, .25);
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* Revealed State */
.tech-card.revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Hover Effects (Desktop Only) */
@media (hover: hover) {
  .tech-card:hover {
    border-color: #2a3a4f;
    box-shadow: 0 18px 40px rgba(88, 166, 255, .15);
  }
}

/* Mobile Optimization: Disable heavy 3D & Shadows */
@media (max-width: 768px) {
  .tech-card {
    transform: none !important;
    transition: opacity 0.5s ease !important;
    will-change: auto;
  }
}

/* Content layers */
.tech-inner {
  position: relative; z-index: 2;
  /* إزالة translateZ الافتراضي لتقليل استهلاك الذاكرة */
  transition: transform 0.3s ease;
}

/* Logo */
.tech-logo {
  width: 48px; height: 48px; margin-bottom: 12px;
  filter: drop-shadow(0 6px 10px rgba(88, 166, 255, .16));
  transition: transform 0.3s ease;
}
.tech-card:hover .tech-logo { transform: translateY(-3px) scale(1.05); }

.tech-name { font-size: 1rem; font-weight: 800; color: #e7edf3; margin-bottom: 6px; letter-spacing: .2px; }
.tech-desc { font-size: .86rem; color: #9fb2c9; margin-bottom: 10px; line-height: 1.55; }
.tech-badge {
  display: inline-block; padding: 5px 12px;
  background: rgba(88, 166, 255, .12); color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, .25); border-radius: 999px;
  font-size: .73rem; font-weight: 700;
}

/* Glow Effect */
.glow {
  position: absolute; inset: -1px; border-radius: 18px;
  background: radial-gradient(300px 300px at var(--mx, 50%) var(--my, 50%), rgba(88, 166, 255, .15), transparent 40%);
  opacity: 0; transition: opacity .25s ease; z-index: 1; pointer-events: none;
  mix-blend-mode: screen;
}
.tech-card:hover .glow { opacity: 1; }

/* Click Ripple */
.ripple {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%);
  animation: tech-ripple .6s ease forwards; pointer-events: none;
}
@keyframes tech-ripple {
  from { opacity: .5; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(20); }
}

/* ===== Why Us ===== */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 768px) { .why-grid { grid-template-columns: 1fr; gap: 20px; } }

.why-card {
  background: #0f141b; border: 1px solid #1b2430; border-radius: 16px;
  padding: 32px; position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.why-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(167, 139, 250, .12); }

.why-number {
  position: absolute; top: 20px; left: 20px; width: 40px; height: 40px;
  background: linear-gradient(135deg, #58a6ff, #a78bfa);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.why-title { font-size: 1.3rem; font-weight: 700; color: #e7edf3; margin-bottom: 12px; padding-right: 50px; }
.why-desc { font-size: .95rem; color: #9fb2c9; line-height: 1.6; }

/* ===== FAQ ===== */
#faq { background: #0f141b; }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: #0c1117; border: 1px solid #1b2430; border-radius: 16px; margin-bottom: 16px; overflow: hidden;
}
.faq-question {
  width: 100%; padding: 24px; background: transparent; border: none;
  color: #e7edf3; font-size: 1.1rem; font-weight: 700; font-family: 'Cairo', sans-serif;
  text-align: right; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.faq-icon { font-size: 1.5rem; transition: transform .2s ease; margin-left: 16px; }
.faq-item.active .faq-icon { transform: rotate(45deg); color: #58a6ff; }
.faq-answer {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
}
.faq-item.active .faq-answer { max-height: 500px; opacity: 1; padding: 0 24px 24px; }
.faq-answer p { color: #9fb2c9; line-height: 1.7; font-size: .95rem; }

/* ===== Timeline ===== */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; top: 0; right: 50%; width: 2px; height: 100%;
  background: linear-gradient(180deg, #58a6ff, #a78bfa);
}
@media (max-width: 768px) { .timeline::before { right: 20px; } }

.timeline-item { display: flex; margin-bottom: 50px; position: relative; }
.timeline-item:nth-child(odd) { flex-direction: row-reverse; }
@media (max-width: 768px) {
  .timeline-item { padding-right: 50px; }
  .timeline-item:nth-child(odd) { flex-direction: row; }
}

.timeline-content {
  width: 45%; background: #0f141b; border: 1px solid #1b2430; border-radius: 16px;
  padding: 28px; transition: transform .2s ease;
}
@media (max-width: 768px) { .timeline-content { width: 100%; } }
.timeline-content:hover { transform: translateY(-3px); }

.timeline-dot {
  position: absolute; right: 50%; transform: translateX(50%);
  width: 20px; height: 20px; background: linear-gradient(135deg, #58a6ff, #a78bfa);
  border-radius: 50%; border: 4px solid #0c1117;
}
@media (max-width: 768px) { .timeline-dot { right: 11px; transform: none; } }

.timeline-number {
  display: inline-block; width: 36px; height: 36px;
  background: linear-gradient(135deg, #58a6ff, #a78bfa); border-radius: 50%;
  text-align: center; line-height: 36px; font-weight: 800; font-size: 1rem; margin-bottom: 12px;
}
.timeline-title { font-size: 1.2rem; font-weight: 700; color: #e7edf3; margin-bottom: 10px; }
.timeline-desc { font-size: .95rem; color: #9fb2c9; line-height: 1.6; }