/* الأساسيات */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --primary-color: #4a3260;
  --secondary-color: rgba(86, 59, 85, 0.681);
  --dark-color: #121212;
  --light-color: #f8f9fa;
  --gray-color: #2d2d2d;
}

/* Body */
body {
  background-color: var(--dark-color);
  color: var(--light-color);
  line-height: 1.6;
  transition: all 0.3s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

body.light-mode {
  background-color: var(--light-color);
  color: var(--dark-color);
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Cursor */
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s;
  opacity: 0;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.2s ease-out;
  opacity: 0;
}

body.custom-cursor .cursor-dot,
body.custom-cursor .cursor-outline {
  opacity: 1;
}

/* Header */
header {
  background-color: var(--dark-color);
  padding: 15px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.light-mode header {
  background-color: var(--light-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.logo-img {
  width: 50px;
  height: 40px;
  border-radius: 50%;
  margin-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  filter: drop-shadow(0 0 8px #541e54) drop-shadow(0 0 15px #b266b2);
  transition: 0.3s ease-in-out;
}

.logo-img:hover {
  filter: drop-shadow(0 0 12px #541e54) drop-shadow(0 0 25px #d080d0);
}

/* Nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 25px;
}

.nav-links a {
  color: var(--light-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.light-mode .nav-links a {
  color: var(--dark-color);
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* أزرار */
.language-switcher,
.theme-switcher,
.menu-toggle {
  background: var(--gray-color);
  color: var(--light-color);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  margin-left: 15px;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.light-mode .language-switcher,
.light-mode .theme-switcher,
.light-mode .menu-toggle {
  background: #e9ecef;
  color: var(--dark-color);
}
.menu-toggle:hover,
.theme-switcher:hover,
.language-switcher:hover {
  background: var(--primary-color);
  color: white;
}
/* زر العودة */
.back-btn {
  position: fixed;
  top: 90px;
  right: 20px;
  background: rgba(72, 54, 71, 0.8);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-btn:hover {
  background: var(--primary-color);
  transform: translateX(-5px);
}
/*------*/
.sidebar {
  position: fixed;
  top: 0;
  right: -350px;
  width: 300px;
  height: 100vh;
  background: linear-gradient(to bottom, var(--dark-color), #1a1a1a);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  transition: right 0.4s ease;
  z-index: 2000;
  padding: 80px 20px 20px;
  overflow-y: auto;
}

.light-mode .sidebar {
  background: linear-gradient(to bottom, var(--light-color), #e9ecef);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
  right: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .sidebar-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
/* ===== حل نهائي: ترتيب المسافة بين الأيقونة والنص في السايدبار ===== */

/* 1) تأكد أن روابط السايدبار تستخدم flex بحيث يمكن عمل مسافة بسهولة */
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px; /* المسافة بين الأيقونة والنص (عمل ممتاز على المتصفحات الحديثة) */
  white-space: nowrap; /* يمنع التفاف النص لداخل الأيقونة */
}

/* 2) اجعل الأيقونة صندوق ثابت العرض حتى النص ما يلزق فيها */
.sidebar-nav i {
  min-width: 28px;   /* عرض ثابت صغير يكفي للأيقونة */
  width: 28px;
  display: inline-flex;
  justify-content: center;
  text-align: center;
  margin: 0;         /* إلغاء أي مارجن سابق */
}

/* 3) إعدادات خاصة عندما تكون الصفحة باللغة الإنجليزية (LTR) */
body[dir="ltr"] .sidebar-nav a {
  flex-direction: row;  /* أيقونة على اليسار، نص على اليمين */
  text-align: left;
}
body[dir="ltr"] .sidebar-nav i {
  margin-right: 8px !important; /* تأمين المسافة إذا كانت هناك قواعد تِغيِرها */
  margin-left: 0 !important;
}

/* 4) إعدادات خاصة عندما تكون الصفحة بالعربية (RTL) */
body[dir="rtl"] .sidebar-nav a {
  flex-direction: row-reverse; /* أيقونة على اليمين، نص على اليسار */
  text-align: right;
}
body[dir="rtl"] .sidebar-nav i {
  margin-left: 8px !important;
  margin-right: 0 !important;
}

/* 5) احتياط: لو الأيقونات تُضاف عبر ::before بدل عنصر i */
.sidebar-nav a::before {
  display: inline-block;
  margin-right: 8px;
}
body[dir="rtl"] .sidebar-nav a::before {
  margin-left: 8px;
  margin-right: 0;
}
.sidebar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--light-color);
}

.light-mode .sidebar-title {
  color: var(--dark-color);
}

.close-sidebar {
  background: transparent;
  border: none;
  color: var(--light-color);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.light-mode .close-sidebar {
  color: var(--dark-color);
}

.close-sidebar:hover {
  color: var(--primary-color);
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 30px;
}

.sidebar-nav li {
  margin-bottom: 15px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--light-color);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.light-mode .sidebar-nav a {
  color: var(--dark-color);
}

.sidebar-nav a:hover {
  background: rgba(74, 50, 96, 0.3);
  color: var(--primary-color);
  transform: translateX(-5px);
}

.light-mode .sidebar-nav a:hover {
  background: rgba(74, 50, 96, 0.1);
}

.sidebar-nav i {
  margin-left: 10px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.sidebar-social a:hover {
  transform: translateY(-5px);
  background: var(--secondary-color);
}

.sidebar-contact {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.light-mode .sidebar-contact {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-contact p {
  margin-bottom: 10px;
  color: var(--light-color);
  font-size: 0.9rem;
}

.light-mode .sidebar-contact p {
  color: var(--dark-color);
}

.sidebar-contact a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}
/* Hero */
.hero {
  padding: 90px 0 30px;
  background: linear-gradient(to bottom, var(--dark-color), #1a1a1a);
  min-height: 25vh;
  display: flex;
  align-items: center;
  position: relative;
}

.light-mode .hero {
  background: linear-gradient(to bottom, var(--light-color), #e9ecef);
}

.hero-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.hero-content {
  background: rgba(72, 54, 71, 0.681);
  padding: 20px;
  border-radius: 16px;
  box-shadow:
    0 0 10px rgba(63, 45, 62, 0.681),
    0 0 20px rgba(63, 45, 62, 0.681),
    0 0 40px rgba(63, 45, 62, 0.681);
  border: 1px solid rgba(138, 43, 226, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--light-color);
  font-weight: 800;
}

.light-mode .hero h1 {
  color: var(--dark-color);
}

.hero p {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #ced4da;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.light-mode .hero p {
  color: #495057;
}

/* Blog Section */
.blog-section {
  padding: 40px 0;
  background: var(--dark-color);
}

.light-mode .blog-section {
  background: var(--light-color);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.blog-card {
  background: rgba(45, 45, 45, 0.6);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 1px solid rgba(63, 45, 62, 0.681);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(63, 45, 62, 0.681);
}

.blog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.blog-date {
  color: #adb5bd;
  font-size: 0.85rem;
}

.light-mode .blog-date {
  color: #6c757d;
}

.blog-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--light-color);
  font-weight: 700;
  line-height: 1.4;
}

.light-mode .blog-card h3 {
  color: var(--dark-color);
}

.blog-card p {
  color: #ced4da;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.95rem;
  flex-grow: 1;
}

.light-mode .blog-card p {
  color: #495057;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.blog-tag {
  background: rgba(111, 71, 149, 0.3);
  color: #d080d0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
  align-self: flex-start;
  margin-top: auto;
}

.card-btn i {
  margin-right: 5px;
  margin-left: 5px;

  transition: transform 0.3s ease;
}

.card-btn:hover {
  background: var(--primary-color);
  color: white;
}

.card-btn:hover i {
  transform: translateX(-5px);
}

/* Contact Section */
.contact {
  padding: 40px 0;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  text-align: center;
  margin-top: 40px;
}

.contact h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.contact p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.email {
  font-size: 1.1rem;
  margin: 20px 0;
  display: inline-block;
  padding: 12px 25px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.email:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.social-links {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 15px;
}

.social-links a {
  display: inline-flex;
  width: 45px;
  height: 45px;
  background-color: white;
  border-radius: 50%;
  margin: 0 5px;
  color: var(--primary-color);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
  padding: 25px 0;
  background-color: #0a0a0a;
  color: white;
  text-align: center;
}

.light-mode footer {
  background-color: #dee2e6;
  color: var(--dark-color);
}

/* Responsive */
@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .hero-content {
    padding: 25px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 100px 0 30px;
    min-height: 30vh;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .back-btn {
    top: 80px;
    right: 15px;
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .contact {
    padding: 30px 0;
  }

  .contact h2 {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.4rem;
  }

  .blog-card {
    padding: 15px;
  }

  .blog-card h3 {
    font-size: 1.1rem;
  }

  .back-btn {
    top: 75px;
    right: 10px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
/* 🔹 جعل الشعار والأزرار في صف واحد حتى في الجوال */
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

/* الشعار (الصورة + النص) */
header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* الحاوية اللي فيها الأزرار الثلاثة */
header nav > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 🔹 في الجوال */
@media (max-width: 768px) {
  header nav {
    flex-direction: row; /* خليهم صف واحد دائمًا */
  }

  header .logo img {
    width: 40px; /* تصغير بسيط للشعار عشان يركب بالسطر */
    height: auto;
  }

  header .logo-text {
    font-size: 1rem;
  }

  .language-switcher,
  .theme-switcher,
  .menu-toggle {
    flex-shrink: 0; /* ما يتقلص حجمها */
  }
}