/* ===== SERVICES STYLES (Optimized) ===== */

/* 1. Global & Grid Layout */
#services { padding: 40px 0 80px; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

@media (max-width: 1024px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* Mini-hero strip */
.services-hero {
  position: relative; margin: 0 0 40px; padding: 30px; border: 1px solid var(--line, #1b2430);
  border-radius: 16px; background: linear-gradient(180deg, #0f141b, #0c1117); overflow: hidden;
  text-align: center; will-change: transform;
}
.services-hero .beam {
  position: absolute; inset: -50%;
  background: radial-gradient(circle, rgba(88,166,255,.1), transparent 60%);
  filter: blur(20px); opacity: 0.6;
}
.section-title { font-size: 2rem; font-weight: 900; color: #fff; margin-bottom: 10px; }
.section-subtitle { color: #9fb0d6; font-size: 1.1rem; }
.gradient { background: linear-gradient(135deg, #a78bfa, #58a6ff); -webkit-background-clip: text; color: transparent; }

/* 2. CARD Styles (Premium Glassmorphism) */
.card {
  position: relative;
  isolation: isolate;
  background: rgba(15, 20, 31, 0.4);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px 24px;
  overflow: hidden;
  transform-style: preserve-3d;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  will-change: transform, opacity;
  contain: layout paint;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, 
    rgba(155, 92, 243, 0.3) 0%, 
    rgba(106, 167, 255, 0.2) 50%, 
    rgba(245, 37, 133, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.card.reveal {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(155, 92, 243, 0.5);
  box-shadow: 0 20px 60px rgba(155, 92, 243, 0.2),
              0 8px 24px rgba(106, 167, 255, 0.15);
}

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

/* Icons with Scale Effect */
.icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(155, 92, 243, 0.1);
  border: 1px solid rgba(155, 92, 243, 0.2);
  margin-bottom: 20px;
  color: rgba(155, 92, 243, 0.9);
  transition: transform 0.3s ease, 
              background 0.3s ease,
              border-color 0.3s ease;
}

.card:hover .icon {
  transform: scale(1.1);
  background: rgba(155, 92, 243, 0.15);
  border-color: rgba(155, 92, 243, 0.4);
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

/* Single Premium CTA Button */
.cta-row {
  display: flex;
  gap: 0;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  background: transparent;
}

.a-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.a-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.a-btn:hover svg {
  transform: translateX(4px);
}

/* Remove old ring/glow effects */
.ring, .glow {
  display: none;
}

/* =========================================
   3. DETAIL PAGE STYLES (New)
   ========================================= */
.service-detail-wrapper {
  grid-column: 1 / -1; /* تأخذ كامل العرض */
  background: #0f141b; border: 1px solid #1b2430; border-radius: 24px;
  padding: 40px; max-width: 900px; margin: 0 auto;
  opacity: 0; transform: translateY(20px); transition: 0.5s ease;
}
.service-detail-wrapper.reveal { opacity: 1; transform: none; }

.back-link {
  display: inline-block; color: #6aa7ff; margin-bottom: 30px; font-weight: 700; text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.detail-icon {
  width: 80px; height: 80px; background: rgba(102, 163, 255, 0.1); 
  border-radius: 20px; display: grid; place-items: center; color: #6aa7ff;
}
.detail-header h1 { font-size: 2.2rem; margin: 0; color: #fff; }

.main-desc { font-size: 1.1rem; line-height: 1.8; color: #c0cce0; margin-bottom: 30px; }

.detail-tags span {
  display: inline-block; padding: 8px 16px; background: #1a2236; 
  border-radius: 8px; margin-left: 10px; color: #8b5cf6; font-weight: 700;
}

.detail-actions { margin-top: 40px; text-align: center; }
.big-btn { 
  display: inline-flex; align-items: center; gap: 10px; 
  padding: 16px 32px; font-size: 1.1rem; border-radius: 12px;
}

@media (max-width: 768px) {
  .service-detail-wrapper { padding: 24px; }
  .detail-header { flex-direction: column; text-align: center; }
  .detail-header h1 { font-size: 1.8rem; }
  .big-btn { width: 100%; justify-content: center; }
}