/* ═══════════════════════════════════════════════════════════
   شركة شمراخ — ملف الأنماط المخصصة
   Custom Styles — Shamrakh Law Firm
   ═══════════════════════════════════════════════════════════ */

/* ─── إعدادات أساسية ─── */
* {
  -webkit-tap-highlight-color: transparent;
}

/* تحديد العرض الأقصى للموقع — 1280px وزن متوسط مريح */
.container {
  max-width: 1280px !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #F5EFE6;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7F503E, #C9A66B);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #7F503E;
}
.dark ::-webkit-scrollbar-track {
  background: #2C1810;
}

/* تخصيص اختيار النص */
::selection {
  background: #C9A66B;
  color: #2C1810;
}

/* ─── النمط الهندسي السعودي (Saudi Pattern) ─── */
.saudi-pattern {
  background-image:
    radial-gradient(circle at 20% 50%, #C9A66B 1px, transparent 1.5px),
    radial-gradient(circle at 80% 50%, #C9A66B 1px, transparent 1.5px),
    radial-gradient(circle at 50% 20%, #C9A66B 1px, transparent 1.5px),
    radial-gradient(circle at 50% 80%, #C9A66B 1px, transparent 1.5px),
    linear-gradient(45deg, transparent 48%, #C9A66B 49%, #C9A66B 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, #C9A66B 49%, #C9A66B 51%, transparent 52%);
  background-size: 60px 60px;
  background-position: 0 0;
}

/* ─── Hero Section ─── */
.hero-glow {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(201, 166, 107, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(127, 80, 62, 0.2) 0%, transparent 50%);
  animation: glowMove 12s ease-in-out infinite alternate;
}

@keyframes glowMove {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.05); }
}

/* ميزان العدالة المتحرك */
.scale-balance {
  animation: balanceFloat 5s ease-in-out infinite;
  transform-origin: center top;
}
@keyframes balanceFloat {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-2deg) translateY(-5px); }
  75% { transform: rotate(2deg) translateY(-5px); }
}

.animate-spin-slow {
  animation: spin 20s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ─── Navbar ─── */
.nav-link {
  position: relative;
  color: #2C1810;
  transition: color 0.3s;
  padding-bottom: 4px;
}
.dark .nav-link {
  color: #F5EFE6;
}
.nav-link::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #C9A66B;
  transition: width 0.3s ease;
}
.nav-link:hover {
  color: #7F503E;
}
.dark .nav-link:hover {
  color: #C9A66B;
}
.nav-link:hover::after {
  width: 100%;
}

/* تأثير اللوغو */
.logo-mark {
  transition: transform 0.4s ease;
}
.logo-mark:hover {
  transform: rotate(-10deg) scale(1.05);
}

/* ─── بطاقات الميزات (Features) ─── */
.feature-card {
  position: relative;
  background: white;
  border: 1px solid #F5EFE6;
  border-radius: 1.5rem;
  padding: 2rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .feature-card {
  background: rgba(127, 80, 62, 0.08);
  border-color: rgba(201, 166, 107, 0.2);
}
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px -15px rgba(127, 80, 62, 0.3);
  border-color: #C9A66B;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #7F503E, #C9A66B);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}
.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-number {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 4rem;
  font-weight: 900;
  color: rgba(201, 166, 107, 0.15);
  font-family: 'Cairo', sans-serif;
  line-height: 1;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(201, 166, 107, 0.15), rgba(127, 80, 62, 0.1));
  color: #C9A66B;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all 0.4s ease;
}
.feature-card:hover .feature-icon {
  background: #7F503E;
  color: #C9A66B;
  transform: rotate(-5deg);
}

.feature-card h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2C1810;
  margin-bottom: 0.75rem;
}
.dark .feature-card h3 {
  color: #F5EFE6;
}
.feature-card p {
  font-size: 0.9rem;
  color: #6B5544;
  line-height: 1.8;
}
.dark .feature-card p {
  color: rgba(245, 239, 230, 0.7);
}

/* ─── فلتر تبويبات الخدمات ─── */
.filter-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: white;
  border: 1px solid #C9A66B;
  color: #7F503E;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}
.dark .filter-tab {
  background: transparent;
  color: #C9A66B;
}
.filter-tab:hover {
  background: #C9A66B;
  color: white;
}
.filter-tab.active {
  background: #7F503E;
  color: #C9A66B;
  border-color: #7F503E;
  box-shadow: 0 4px 15px rgba(127, 80, 62, 0.3);
}

/* ─── بطاقات الخدمات ─── */
.service-card {
  position: relative;
  background: white;
  border-radius: 1.5rem;
  padding: 1.75rem;
  border: 1px solid transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.dark .service-card {
  background: rgba(44, 24, 16, 0.5);
  border-color: rgba(201, 166, 107, 0.15);
}
.service-card:hover {
  transform: translateY(-6px) rotateZ(-0.5deg);
  box-shadow: 0 20px 50px -15px rgba(127, 80, 62, 0.35);
  border-color: #C9A66B;
}
.service-card.hidden-card {
  display: none;
}

.service-icon {
  width: 70px;
  height: 70px;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #7F503E, #5C3A2B);
  color: #C9A66B;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all 0.4s ease;
}
.service-card:hover .service-icon {
  background: linear-gradient(135deg, #C9A66B, #E0C594);
  color: #2C1810;
  transform: scale(1.05);
}

.service-card h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2C1810;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.dark .service-card h3 {
  color: #F5EFE6;
}
.service-card p {
  font-size: 0.85rem;
  color: #6B5544;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.dark .service-card p {
  color: rgba(245, 239, 230, 0.65);
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #7F503E;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  transition: gap 0.3s ease;
}
.dark .service-link {
  color: #C9A66B;
}
.service-link:hover {
  gap: 0.5rem;
}

/* ─── بطاقات الشهادات (Testimonials) ─── */
.testimonial-card {
  position: relative;
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 25px -5px rgba(127, 80, 62, 0.1);
  transition: all 0.4s ease;
  border: 1px solid #F5EFE6;
}
.dark .testimonial-card {
  background: rgba(127, 80, 62, 0.08);
  border-color: rgba(201, 166, 107, 0.15);
}
.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -10px rgba(127, 80, 62, 0.25);
}

/* ─── بطاقات المدوّنة ─── */
.blog-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid #F5EFE6;
  transition: all 0.4s ease;
}
.dark .blog-card {
  background: rgba(127, 80, 62, 0.1);
  border-color: rgba(201, 166, 107, 0.15);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -15px rgba(127, 80, 62, 0.3);
}

.blog-img {
  position: relative;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.blog-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4));
}

.blog-category {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #C9A66B;
  color: #2C1810;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  z-index: 2;
}

/* ─── FAQ Accordion ─── */
.faq-item {
  background: white;
  border: 1px solid #F5EFE6;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}
.dark .faq-item {
  background: rgba(127, 80, 62, 0.08);
  border-color: rgba(201, 166, 107, 0.2);
}
.faq-item[open] {
  border-color: #C9A66B;
  box-shadow: 0 4px 20px -5px rgba(127, 80, 62, 0.2);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  color: #2C1810;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  transition: color 0.3s;
}
.dark .faq-item summary {
  color: #F5EFE6;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: #7F503E; }
.dark .faq-item summary:hover { color: #C9A66B; }

.faq-icon {
  flex-shrink: 0;
  color: #C9A66B;
  transition: transform 0.3s ease;
}
.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-body {
  padding: 0 1.5rem 1.5rem;
  color: #6B5544;
  font-size: 0.95rem;
  line-height: 1.9;
  border-top: 1px solid #F5EFE6;
  padding-top: 1.25rem;
}
.dark .faq-body {
  color: rgba(245, 239, 230, 0.75);
  border-color: rgba(201, 166, 107, 0.15);
}

/* ─── الفوتر ─── */
.footer-link {
  position: relative;
  padding-right: 0;
  transition: all 0.3s ease;
}
.footer-link:hover {
  color: #C9A66B;
  padding-right: 8px;
}
.footer-link::before {
  content: '←';
  position: absolute;
  right: -15px;
  opacity: 0;
  transition: all 0.3s ease;
  color: #C9A66B;
}
.footer-link:hover::before {
  right: 0;
  opacity: 1;
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(201, 166, 107, 0.1);
  border: 1px solid rgba(201, 166, 107, 0.3);
  color: #C9A66B;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.social-icon:hover {
  background: #C9A66B;
  color: #2C1810;
  transform: translateY(-3px);
}

/* ─── العناصر العائمة ─── */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  z-index: 40;
  transition: transform 0.3s ease;
}
.floating-whatsapp:hover {
  transform: scale(1.1);
}

.whatsapp-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  animation: pulse 2s infinite;
  z-index: -1;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #7F503E;
  color: #C9A66B;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(127, 80, 62, 0.4);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.4s ease;
  border: none;
  cursor: pointer;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #C9A66B;
  color: #2C1810;
  transform: translateY(-4px);
}

/* ═══════════════════════════════════════════════════════════
   قسم «من نحن» — Glassmorphism + Floating Cards + 3D Tilt
   ═══════════════════════════════════════════════════════════ */

/* البطاقات الزجاجية العائمة */
.glass-card-floater {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1.25rem;
  padding: 0.85rem 1.1rem;
  box-shadow:
    0 20px 50px -15px rgba(127, 80, 62, 0.35),
    0 0 0 1px rgba(201, 166, 107, 0.1) inset;
  animation: floatY 4.5s ease-in-out infinite;
  z-index: 3;
  transition: transform 0.35s ease;
}
.dark .glass-card-floater {
  background: rgba(44, 24, 16, 0.7);
  border-color: rgba(201, 166, 107, 0.25);
}
.glass-card-floater:hover {
  transform: scale(1.05) translateY(-2px);
  animation-play-state: paused;
}

/* الشارة الزجاجية الصغيرة */
.glass-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(201, 166, 107, 0.3);
  border-radius: 9999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1E3A2F;
  white-space: nowrap;
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.18);
  animation: floatY 5s ease-in-out infinite;
  z-index: 3;
}
.dark .glass-pill {
  background: rgba(30, 58, 47, 0.85);
  color: #C9A66B;
  border-color: rgba(201, 166, 107, 0.4);
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* بطاقات القيم (Value Pills) */
.value-pill {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 166, 107, 0.25);
  border-radius: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.dark .value-pill {
  background: rgba(127, 80, 62, 0.15);
  border-color: rgba(201, 166, 107, 0.18);
}
.value-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 166, 107, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.value-pill:hover {
  transform: translateY(-4px);
  border-color: #C9A66B;
  background: white;
  box-shadow: 0 15px 35px -10px rgba(201, 166, 107, 0.45);
}
.dark .value-pill:hover {
  background: rgba(127, 80, 62, 0.3);
}
.value-pill:hover::before {
  opacity: 1;
}

.value-pill-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(201, 166, 107, 0.25), rgba(127, 80, 62, 0.1));
  color: #C9A66B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
}
.value-pill:hover .value-pill-icon {
  background: linear-gradient(135deg, #C9A66B, #E0C594);
  color: #2C1810;
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 8px 20px -5px rgba(201, 166, 107, 0.5);
}
.value-pill > div:last-child {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* تأثير التدرّج المتحرك للعنوان */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
.animate-gradient-shift {
  animation: gradient-shift 6s ease-in-out infinite;
}

/* خط ذهبي يُرسم تحت العنوان عند الظهور */
.about-underline {
  transition: stroke-dashoffset 1.5s ease-out 0.4s;
}
.about-section.in-view .about-underline {
  stroke-dashoffset: 0;
}

/* تخصيص space-x-reverse للـ RTL — اللي يخلي الصور تتراكب صح */
.rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

/* تحسينات للجوال */
@media (max-width: 640px) {
  .glass-card-floater {
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
  }
  .glass-card-floater .text-2xl {
    font-size: 1.35rem;
  }
  .glass-pill {
    font-size: 0.65rem;
    padding: 0.35rem 0.7rem;
  }
}

/* ─── حركات الظهور (Reveal animations) ─── */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── ضمانة ظهور البطاقات حتى لو فشل GSAP ─── */
/* GSAP سيعيد ضبط الـ opacity عند التشغيل، وهذي الـ rules تضمن الظهور كـ fallback */
.service-card,
.feature-card,
.testimonial-card {
  opacity: 1;
}
.no-js .service-card,
.no-js .feature-card,
.no-js .testimonial-card {
  opacity: 1 !important;
  transform: none !important;
}

/* ─── شريط التنقل عند التمرير ─── */
nav.scrolled {
  height: 70px;
  box-shadow: 0 4px 30px -10px rgba(127, 80, 62, 0.2);
}

/* ─── دعم RTL لأيقونات الأسهم ─── */
[dir="rtl"] .arrow-flip {
  transform: scaleX(-1);
}

/* ─── Responsive Tweaks ─── */
@media (max-width: 640px) {
  .feature-number {
    font-size: 3rem;
  }
  .feature-card {
    padding: 1.5rem;
  }
  .service-card {
    padding: 1.5rem;
  }
}

/* ─── منع وميض المحتوى عند تحميل الخطوط ─── */
.fonts-loading body {
  opacity: 0;
}
.fonts-loaded body {
  opacity: 1;
  transition: opacity 0.3s ease;
}
