:root {
  --primary: #4f46e5; 
  --primary-hover: #4338ca;
  --secondary: #db2777;
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569; 
  --border-color: #e2e8f0;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08); 
  --radius-lg: 24px;
  --radius-md: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --secondary: #f472b6;
  --bg-color: #020617;
  --surface: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1; 
  --border-color: #1e293b;
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.4);
}

* { 
  margin: 0; padding: 0; box-sizing: border-box; 
  outline: none !important; 
  -webkit-tap-highlight-color: transparent !important;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* تسريع الأداء بمنع تأثيرات الـ Blur من استهلاك المعالج */
.bg-elements {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
}

/* الإضاءة الأساسية: أزرق حيوي ومشرق */
.orb-1 {
  top: -15%; 
  left: -10%;
  width: 65vw; 
  height: 65vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.55) 0%, rgba(59, 130, 246, 0.2) 50%, transparent 75%);
  opacity: 0.85;
}

/* الإضاءة الثانوية: لمسة حمراء خفيفة ودافئة */
.orb-2 {
  top: 10%; 
  right: -5%;
  width: 45vw; 
  height: 45vw;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, rgba(244, 63, 94, 0.12) 45%, transparent 70%);
  opacity: 0.7;
}

.dark .orb-1 { opacity: 0.25; filter: blur(100px); }
.dark .orb-2 { opacity: 0.2; filter: blur(100px); }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ==========================================================================
   Floating Glass Navbar Style
   ========================================================================== */
nav {
  position: sticky;
  top: 15px;
  z-index: 1000;
  max-width: 1000px;
  width: calc(100% - 2rem);
  margin: 0 auto 2rem;
  padding: 0 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2); 
  border-radius: 50px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.dark nav {
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2.5px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.theme-btn:hover {
  background: var(--bg-color);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-main);
  cursor: pointer;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--surface);
}

.mobile-nav {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.mobile-nav.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.mobile-link i {
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.mobile-link:hover,
.mobile-link.active {
  background: var(--bg-color);
  color: var(--primary);
}

.mobile-link:hover i,
.mobile-link.active i {
  color: var(--primary);
}

/* ==========================================================================
   قسم الـ Hero
   ========================================================================== */
.hero { text-align: center; padding: 4rem 0 3rem; position: relative; z-index: 10; min-height: 480px; }

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.9rem; 
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* العنوان الرئيسي */
.hero h1 { 
  font-size: 3.0rem; 
  font-weight: 900; 
  line-height: 1.3; 
  margin-bottom: 1.5rem; 
  color: var(--text-main);
  text-shadow: 0 2px 20px rgba(99, 102, 241, 0.15);
}

/* لون اسم المنصة الملون والمضيء (Gradient Text) */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 15px rgba(219, 39, 119, 0.35));
  display: inline-block;
  padding: 0 4px;
}

/* النص الوصفي تحت العنوان */
.hero p { 
  font-size: 1.25rem; 
  color: var(--text-main);
  opacity: 0.9;
  max-width: 1000px; 
  margin: 0 auto 3rem; 
  line-height: 2.0; 
  font-weight: 500;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.5);
}

/* في الوضع الداكن (Dark Mode) */
.dark .hero h1 {
  text-shadow: 0 2px 25px rgba(129, 140, 248, 0.3);
}

.dark .hero p {
  color: #f1f5f9;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   شريط بحث زجاجي مضيء المطور (Glowing Glassmorphism Search Box)
   ========================================================================== */
.hero-search-wrapper { 
  max-width: 680px; 
  margin: 0 auto; 
  padding: 0 1rem; 
}

.hero-search-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg, rgba(255, 255, 255, 0.65));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.8));
  border-radius: 50px;
  padding: 0.35rem 0.6rem 0.35rem 1.2rem;
  
  /* خلفية هادئة مضيئة وتوهج غاية في الاحترافية */
  box-shadow: 
    0 8px 32px 0 rgba(79, 70, 229, 0.12),
    0 0 15px 2px rgba(255, 255, 255, 0.6) inset;
  
  transition: var(--transition);
  position: relative;
  min-height: 58px;
}

.hero-search-box:focus-within {
  background: var(--glass-bg, rgba(255, 255, 255, 0.85));
  border-color: var(--primary);
  box-shadow: 
    0 12px 40px 0 rgba(79, 70, 229, 0.25),
    0 0 20px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

/* ضبط توسيط الأيقونة رأسياً ودائرياً */
.hero-search-icon { 
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  width: 44px; 
  height: 44px; 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-left: 12px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.hero-search-icon i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.hero-search-box:focus-within .hero-search-icon {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.hero-search-box input {
  flex: 1; 
  border: none; 
  background: transparent;
  padding: 0.8rem 0; 
  font-size: 1.02rem; 
  color: var(--text-main);
  outline: none; 
  font-family: 'Tajawal', sans-serif; 
  font-weight: 500;
  text-align: right;
}

.hero-search-box input::placeholder { 
  color: var(--text-muted); 
  opacity: 0.7; 
  font-size: 0.95rem;
}

.hero-search-clear {
  background: rgba(0, 0, 0, 0.05); 
  border: none; 
  color: var(--text-muted);
  font-size: 0.9rem; 
  cursor: pointer; 
  display: none;
  width: 26px; 
  height: 26px; 
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-right: 8px;
}

.hero-search-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.dark .hero-search-box {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px 0 rgba(0, 0, 0, 0.37),
    0 0 15px 1px rgba(129, 140, 248, 0.1);
}

.dark .hero-search-box:focus-within {
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 
    0 12px 40px 0 rgba(99, 102, 241, 0.3),
    0 0 20px rgba(129, 140, 248, 0.2);
}

/* ==========================================================================
   أزرار التصنيفات (Desktop View)
   ========================================================================== */
.category-filter-bar { 
  margin-top: 2.5rem; 
  padding: 0.5rem 1rem; 
  width: 100%;
}

.category-chips { 
  display: flex; 
  flex-wrap: wrap; /* التوافق التلقائي للأسطر في الكمبيوتر */
  align-items: center;
  justify-content: center;
  gap: 0.8rem; 
  max-width: 950px; 
  margin: 0 auto; 
}

.category-chip {
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  font-family: 'Tajawal', sans-serif; 
  font-weight: 700; 
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.category-chip i { 
  font-size: 1rem; 
  transition: transform 0.3s ease; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
}

.category-chip:hover { 
  transform: translateY(-3px); 
  box-shadow: var(--shadow-md); 
  color: var(--primary); 
}

.category-chip.active { 
  background: var(--primary); 
  color: #ffffff; 
  border-color: var(--primary); 
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* الفاصل */
.hero-divider {
  width: 100%; position: relative; margin: 3.5rem 0 2.5rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px;
}
.hero-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; 
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15) 25%, rgba(99, 102, 241, 0.15) 75%, transparent);
  z-index: 0;
}
.dark .hero-divider::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.05) 75%, transparent);
}
.divider-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); padding: 0.6rem 2rem; border-radius: 50px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.divider-icon { color: var(--primary); font-size: 1rem; opacity: 0.9; }
.divider-title { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin: 0; }

/* قسم الأدوات والكروت */
.tools-section {
  content-visibility: auto;
  contain-intrinsic-size: 1000px;
}
.tools-grid { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 1.25rem; 
  margin-bottom: 4rem; 
}

.tool-link { text-decoration: none; color: inherit; display: block; outline: none; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem; 
  height: 100%;
  display: flex; flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 180px; 
}

.tool-card:hover { 
  transform: translateY(-5px); 
  box-shadow: var(--shadow-hover); 
  border-color: var(--border-color); 
}

.tool-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 0.75rem; 
}

.tool-title { 
  font-size: 1.15rem; 
  font-weight: 700; 
  color: var(--text-main); 
  margin: 0; 
}

.tool-image {
  width: 44px; 
  height: 44px; 
  border-radius: 12px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  flex-shrink: 0; 
}

.tool-image i {
  font-size: 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dark .tool-card:hover .tool-image { filter: brightness(1.2); }
.tool-card:hover .tool-image { transform: scale(1.05) rotate(3deg); transition: all 0.3s ease; }

.tool-desc { 
  font-size: 0.85rem; 
  color: var(--text-muted); 
  line-height: 1.6; 
  margin-bottom: 1rem; 
}

.tool-footer {
  display: flex; justify-content: flex-start;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
}
.tool-category { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }

.tools-empty-message {
  display: none; text-align: center; padding: 4rem 1rem;
  background: var(--surface); border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg); margin-bottom: 4rem;
}
.empty-icon { font-size: 3.5rem; color: var(--text-muted); opacity: 0.3; margin-bottom: 1rem; }
.tools-empty-message h3 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 0.5rem; }
.tools-empty-message p { color: var(--text-muted); }

/* ==========================================================================
   الفوتر المطور - إبراز الحواف والنصوص والخلفية المتموجة
   ========================================================================== */
footer {
  content-visibility: auto;
  contain-intrinsic-size: 300px;
  background: var(--surface);
  
  /* حواف علوية دائرية بارزة */
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  
  /* حدود علوية واضحة لتحديد الانحناءات */
  border-top: 1.5px solid rgba(79, 70, 229, 0.2);
  
  padding: 4.5rem 0 1.5rem;
  margin-top: 5rem;
  position: relative;
  overflow: hidden; /* يضمن احتواء الألوان والتدرجات داخل الانحناءات */
  
  /* إسقاط ظل علوي يبرز الانحناءات الدائرية بشكل واضح */
  box-shadow: 0 -15px 35px rgba(79, 70, 229, 0.08);
}

/* خلفية أمواج ملونة ومضيئة بدرجة وضوح أعلى */
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(219, 39, 119, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* التخصيص في الوضع الداكن (Dark Mode) */
.dark footer {
  border-top-color: rgba(129, 140, 248, 0.25);
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.4);
}

.dark footer::before {
  background: 
    radial-gradient(circle at 15% 20%, rgba(129, 140, 248, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(244, 114, 182, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
}

/* رفع محتوى الفوتر ليكون أعلى خلفية الأمواج الملونة */
.footer-inner, 
.footer-bottom {
  position: relative;
  z-index: 1;
}

.footer-inner { 
  display: flex; 
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 3rem; 
  margin-bottom: 3rem; 
}

.footer-main { flex: 1.5; min-width: 300px; }
.footer-logo { font-size: 1.8rem; font-weight: 900; color: var(--text-main); margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; }
.footer-logo i { color: var(--primary); width: 24px; height: 24px; display: inline-flex; justify-content: center; align-items: center;}

/* زيادة وضوح وسمك الوصف تحت اللوجو */
.footer-desc { 
  color: var(--text-main); 
  opacity: 0.85; 
  line-height: 1.75; 
  font-size: 0.98rem; 
  font-weight: 600; 
  max-width: 400px; 
}

.footer-links-group { display: flex; gap: 3rem; flex-wrap: wrap; flex: 2; justify-content: flex-end;} 

/* تبارز عناوين الأقسام بشكل أثقل وأوضح (Ultra-Bold) */
.footer-col h4 { 
  font-size: 1.15rem; 
  font-weight: 900; 
  color: var(--text-main); 
  margin-bottom: 1.5rem; 
  position: relative; 
}

.footer-col h4::after { content: ''; position: absolute; bottom: -8px; right: 0; width: 32px; height: 3px; background: var(--primary); border-radius: 2px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 1rem; }

/* توضيح روابط القوائم بالفوتر */
.footer-col a { 
  color: var(--text-muted); 
  text-decoration: none; 
  font-weight: 600; 
  transition: var(--transition); 
}
.footer-col a:hover { color: var(--primary); padding-right: 5px; }

/* توضيح نص حقوق النشر بالأسفل */
.footer-bottom {
  text-align: center; 
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-main); 
  opacity: 0.8;
  font-size: 0.95rem; 
  font-weight: 600;
}

/* ==========================================================================
   Media Queries للتجاوب مع كافة الشاشات والموبايل
   ========================================================================== */
@media (max-width: 1100px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ميديا كويري الشاشات الصغرى فقط (الموبايل والتابلت) */
@media (max-width: 768px) {
  nav {
    top: 10px;
    margin: 0 0.8rem 1rem;
    padding: 0;
  }
  .nav-container { height: 58px; }
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .logo { font-size: 1.2rem; }

  /* تصغير نصوص وقسم الـ Hero للموبايل */
  .hero { padding: 2.5rem 0 2rem; min-height: auto; }
  .hero h1 { 
    font-size: 1.8rem !important; 
    line-height: 1.4 !important; 
    margin-bottom: 1rem !important;
  }
  
  .hero p { 
    font-size: 0.95rem !important; 
    line-height: 1.7 !important;
    padding: 0 0.5rem;
    margin-bottom: 2rem !important;
  }

  .hero-badge {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.75rem !important;
    margin-bottom: 1.2rem !important;
  }

  /* تجاوب شريط البحث للشاشات الصغيرة */
  .hero-search-box {
    min-height: 52px;
    padding: 0.3rem 0.5rem 0.3rem 1rem;
  }
  .hero-search-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    margin-left: 8px;
  }
  .hero-search-box input {
    font-size: 0.95rem;
  }
  .hero-search-box input::placeholder {
    font-size: 0.88rem;
  }

  /* خاص بالموبايل فقط: تحويل التصنيفات لشريط أفقي سحب بدون سكرول مالي الأبعاد */
  .category-filter-bar { 
    overflow-x: auto; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.8rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .category-filter-bar::-webkit-scrollbar { 
    display: none; 
  }

  .category-chips {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    padding: 0.25rem 1rem;
    width: max-content;
  }

  .category-chip {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* تجاوب انحناء الفوتر للموبايل */
  footer {
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
  }
  
  .footer-inner { flex-direction: column; }
  .footer-links-group { gap: 2.5rem; flex-direction: column; justify-content: flex-start; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
}
/* ==========================================================================
   Cookie Consent Banner (ToolifyBox)
   ========================================================================== */
/* Cookie consent simple bottom bar (like real websites) */
.tb-cookie-bar {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 99999;
  background: #14141f;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.9rem 1.5rem;
}
.tb-cookie-wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.tb-cookie-msg {
  flex: 1;
  color: #c9cad4;
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
}
.tb-cookie-msg a { color: #8b9cf7; text-decoration: underline; }
.tb-cookie-acts { display: flex; align-items: center; gap: 0.9rem; flex-shrink: 0; }
.tb-cookie-ok {
  background: #5b6cf0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}
.tb-cookie-ok:hover { background: #4a59d9; }
.tb-cookie-link {
  color: #c9cad4;
  font-size: 0.85rem;
  text-decoration: underline;
}
body.tb-cookie-open { padding-bottom: 70px; }
@media (max-width: 768px) {
  .tb-cookie-wrap { flex-direction: column; align-items: flex-start; text-align: right; }
  body.tb-cookie-open { padding-bottom: 120px; }
}


/* ToolifyBox final mobile navigation override */
@media (max-width: 768px) {
  /* On phones the capsule contains only the logo, theme control, and menu button. */
  nav {
    position: sticky !important;
    top: 10px !important;
    width: calc(100% - 1.6rem) !important;
    margin: 0 0.8rem 1rem !important;
    padding: 0 !important;
    border-radius: 50px !important;
    overflow: visible !important;
  }
  .nav-container {
    height: 58px !important;
    min-height: 58px !important;
    padding: 0 0.85rem !important;
  }
  .nav-links {
    display: none !important;
  }
  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }
  .mobile-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    font-size: 1.35rem !important;
    background: transparent !important;
  }
  .mobile-nav {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(300px, calc(100vw - 1.6rem)) !important;
    max-height: calc(100vh - 92px) !important;
    overflow-y: auto !important;
    padding: 0.85rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    text-align: right !important;
    direction: rtl !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18) !important;
    transform: translateY(-10px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .mobile-nav.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .mobile-menu-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
    padding-bottom: 0.45rem !important;
    border-bottom: 1px solid var(--border-color) !important;
  }
  .mobile-menu-section:last-child {
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
  }
  .mobile-menu-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.35rem 0.8rem 0.45rem !important;
    color: var(--text-main) !important;
    font-weight: 900 !important;
    font-size: 1.05rem !important;
  }
  .mobile-menu-title i {
    color: var(--primary) !important;
    width: 1.2rem !important;
    text-align: center !important;
  }
  .mobile-nav .mobile-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.7rem !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 0.62rem 0.8rem !important;
    box-sizing: border-box !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
  .mobile-nav .mobile-link i {
    width: 1.25rem !important;
    flex: 0 0 1.25rem !important;
    text-align: center !important;
  }
  .logo {
    max-width: calc(100% - 100px) !important;
    min-width: 0 !important;
  }
  .logo > div {
    font-size: 1.28rem !important;
    white-space: nowrap !important;
  }
  .logo > span {
    font-size: 0.68rem !important;
    white-space: nowrap !important;
  }
}


/* ============================================================================
   ToolifyBox header dimension sync
   توحيد أبعاد هيدر صفحات الأدوات مع الواجهة الرئيسية دون حذف أي قواعد سابقة
   ============================================================================ */
nav .nav-container {
  height: 70px !important;
  min-height: 70px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

nav .nav-links {
  gap: 2.2rem !important;
  align-items: center !important;
}

nav .nav-link {
  font-size: 0.98rem !important;
  padding: 0.5rem 0 !important;
  line-height: normal !important;
}

nav .nav-actions {
  gap: 1rem !important;
  align-items: center !important;
}

nav .theme-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  font-size: 1.1rem !important;
}

nav .mobile-menu-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  font-size: 1.4rem !important;
}

@media (max-width: 768px) {
  nav .nav-container {
    height: 58px !important;
    min-height: 58px !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  nav .nav-actions {
    gap: 0.35rem !important;
  }

  nav .theme-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  nav .mobile-menu-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-size: 1.35rem !important;
  }
}
/* نهاية توحيد أبعاد الهيدر */

