:root {
  --primary-color: #5d7dff;
  --dark-bg: #0b0c1e;
  --card-bg: #1c1d32;
  --header-bg: #1c1d32;
  --text-color: #e3e7ff;
  --text-secondary: #c0c9ff;
  --border-color: #2e2f66;
}

/* Basic Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--dark-bg) !important; 
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4, .logo {
  font-family: 'Bungee', sans-serif;
  color: var(--text-color);
  line-height: 1.3;
  letter-spacing: 1px;
  overflow-wrap: break-word;
}

/* قاعدة منفصلة للشعار لمنع الالتفاف */
.logo {
  white-space: nowrap; 
  display: inline-block;
  line-height: 1; 
  padding: 0; /* <-- تأكد من وجود هذه الفاصلة */
  font-size: 1.8rem; /* <-- والآن هذا السطر سيعمل 100% */
}
  
p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
  color: #a3b3ff;
  text-shadow: 0 0 8px var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ========== Header & Navigation ========== */
.site-header {
  background-color: rgba(28, 29, 50, 0.8);
  backdrop-filter: blur(10px);
  /* ✅ تم التعديل: إعطاء مساحة للشعار الجديد */
  padding: 10px 0; /* <-- تم التعديل من 5px */
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  min-height: 50px;
}

.nav-links { 
  display: flex; 
  list-style: none; 
  align-items: center; 
  margin: 0; 
  padding: 0; 
}

.nav-links a {
  color: var(--text-color);
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  padding: 8px 18px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1; 
}

.nav-links a:hover {
  background-color: var(--primary-color);
  color: var(--dark-bg);
  text-shadow: none;
}

.nav-links a.active {
  color: var(--primary-color);
  background-color: transparent;
}

.hamburger { display: none; cursor: pointer; }
.hamburger div { width: 25px; height: 3px; background-color: var(--text-color); margin: 5px; transition: all 0.3s ease; }

/* ========== Page & Section General Styles ========== */
.section-heading-v2 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 35px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border-color);
}

.trending-section {
  background-color: var(--header-bg);
  padding: 70px 0;
}

.content-section {
  padding: 70px 0;
}

/* ========== Homepage Specific Sections ========== */
.hero-v2-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  padding: 70px 0;
}

.hero-v2-main {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.hero-v2-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-v2-main:hover img { transform: scale(1.05); }

/* ✅ الكود الجديد (المُعدل) */
/* الكود القديم */
.hero-v2-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, rgba(11, 12, 30, 0.95), transparent);
}

.hero-v2-tag {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--dark-bg);
  padding: 6px 18px;
  border-radius: 5px;
  font-weight: 800;
  margin-bottom: 15px;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
}

.hero-v2-overlay h2 {
  font-size: 2.2rem;
  line-height: 1.2;
  color: #fff;
  text-shadow: 2px 2px 12px #000;
  margin: 0;
}

.hero-v2-sub {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-v2-sub-item {
  display: block;
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.hero-v2-sub-item:hover { transform: translateY(-5px); }

.hero-v2-sub-item h3 {
  font-size: 1.4rem;
  color: var(--text-color);
  margin: 0 0 8px 0;
  transition: color 0.3s ease;
}

.hero-v2-sub-item:hover h3 { color: var(--primary-color); }

.hero-v2-sub-item p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* * ========================================================
 * ✅ تم التعديل: إصلاح قسم "Trending Now" بالكامل
 * ========================================================
 */
.trending-scroll {
  /* 1. استخدام Grid لإنشاء مسار أفقي */
  display: grid;
  grid-auto-flow: column; /* جعل العناصر تتدفق أفقياً */
  
  /* 2. تحديد حجم الكروت (للكمبيوتر) */
  grid-auto-columns: minmax(300px, 1fr);
  
  /* 3. السماح بالتمرير الأفقي */
  overflow-x: auto;
  gap: 25px;
  padding-bottom: 25px;


}

/* 5. تخصيص شريط التمرير (Scrollbar) */
.trending-scroll::-webkit-scrollbar { height: 8px; }
.trending-scroll::-webkit-scrollbar-track { background: var(--dark-bg); }
.trending-scroll::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }

.trending-card {
  /* 6. إعدادات الكارت الواحد */
  position: relative; 
  overflow: hidden; 
  border-radius: 8px; 
  display: block;
  height: 200px; /* <-- تحديد ارتفاع موحد للكارت */
  
  /* 7. (احترافي) تحديد نقطة الاستقرار للكارت */
  scroll-snap-align: start;
}

.trending-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* <-- أهم خاصية لجعل الصورة تملأ الكارت */
  transition: transform 0.3s ease;
}

.trending-card:hover img {
  transform: scale(1.1); 
}

.trending-card .trending-title {
  /* 8. إعدادات العنوان فوق الصورة */
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-family: 'Bungee', sans-serif;
  font-size: 1.2rem; /* <-- حجم خط مناسب */
  color: #ffffff;
  text-align: center;
  text-transform: uppercase; 
  letter-spacing: 1px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  padding: 20px 10px 15px 10px; /* <-- تعديل الحشو */
  margin: 0;
}
/* ========== نهاية قسم Trending Now ========== */


/* ========== الكود الناقص لقسم آخر الأخبار والشريط الجانبي ========== */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.feed-item {
  display: grid;
  grid-template-columns: 250px 1fr; 
  gap: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.feed-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(93, 125, 255, 0.1);
}

.feed-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0; 
}

.feed-item div { /* Container for text content */
  padding: 20px;
}

.feed-tag {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--dark-bg);
  padding: 4px 12px;
  border-radius: 5px;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-family: 'Roboto', sans-serif;
}

.feed-item h3 {
  font-size: 1.4rem;
  margin: 0 0 10px 0;
  color: var(--text-color);
  line-height: 1.4;
}

.feed-item:hover h3 {
  color: var(--primary-color);
}

.feed-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky; /* لجعل الشريط الجانبي ثابت عند النزول */
  top: 95px; /* (ارتفاع الهيدر الجديد + 20 بكسل) */
}

.sidebar-item {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.sidebar-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sidebar-item:hover img {
  transform: scale(1.05);
}

.sidebar-score {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(93, 125, 255, 0.9); 
  color: var(--dark-bg);
  font-family: 'Bungee', sans-serif;
  font-size: 1.2rem;
  padding: 5px 10px;
  border-radius: 5px;
}

.sidebar-item h4 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(11, 12, 30, 0.95), transparent);
  padding: 20px 15px 15px;
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}
/* ========== نهاية الكود الناقص ========== */


/* ========== كود الدليل المميز ========== */
.featured-guide-section {
  padding: 50px 0;
  text-align: center;
}

.featured-guide-content {
  max-width: 700px;
  margin: 0 auto;
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.featured-guide-image {
  margin-bottom: 20px;
  width: 100%;
  height: auto;
  border-radius: 8px; 
}

.featured-guide-content h3 {
  font-family: 'Bungee', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.featured-guide-content h3 a {
  color: var(--text-color); 
  text-decoration: none;
}

.featured-guide-content h3 a:hover {
  text-decoration: underline;
}

.featured-guide-content p {
  color: var(--text-secondary); 
  font-size: 1.1rem;
  margin-bottom: 25px;
  line-height: 1.6;
}

.featured-guide-section .back-btn {
  margin-top: 0;
  display: inline-block;
}
/* ========== نهاية كود الدليل المميز ========== */


/* ========== Weekly Poll Section ========== */
.weekly-poll {
  padding: 70px 0;
  text-align: center;
  background-color: var(--header-bg);
}

.weekly-poll .poll-question {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.poll-form {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}

.poll-option {
  background-color: var(--card-bg);
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.poll-option:hover {
  border-color: var(--primary-color);
  background-color: #2a2c3a;
}

.poll-option input[type="radio"] {
  display: none;
}

.poll-option label {
  font-size: 1.1rem;
  color: var(--text-color);
  cursor: pointer;
  display: block;
  width: 100%;
}

.poll-button {
  display: block;
  width: 100%;
  padding: 15px;
  font-size: 1.2rem;
  font-family: 'Bungee', sans-serif;
  font-weight: bold;
  color: var(--dark-bg);
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

.poll-button:hover {
  background-color: #a3b3ff;
}

/* ========== Other Pages & Footer ========== */
.page-header{
  text-align:center;
  padding: 60px 20px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  
  /* ✅ السطر الجديد: لإجبار الكلمات الطويلة على النزول لسطر جديد */
  overflow-wrap: break-word;
}

.article-content{
  padding: 40px 0;
  max-width: 800px;
  margin: 0 auto;
}

/* Back to Blog Button Style */
.back-btn {
  display: inline-block;
  margin-top: 40px;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: var(--dark-bg);
  font-family: 'Bungee', sans-serif;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.back-btn:hover {
  background-color: #a3b3ff;
  transform: translateY(-2px);
}

.site-footer{
  background-color: var(--header-bg);
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
}

.footer-nav a{
  margin: 0 15px;
  color: var(--text-secondary);
}

.copyright{
  color: var(--text-secondary);
  font-size: .9rem;
}


/* ========== Responsive Design ========== */
@media screen and (max-width: 768px) {
    /* --- إعدادات قائمة التنقل (الهامبرغر) --- */
    .nav-links {
        position: absolute;
        right: 0;
        top: 50px; 
        background-color: var(--header-bg);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform .5s ease-in;
        border-top: 1px solid var(--border-color);
        
        
    }
    .nav-links li {
        opacity: 0;
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        padding: 18px;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        border-radius: 0; 
    }
     .nav-links li:last-child a {
        border-bottom: none; 
    }
    .hamburger {
        display: block;
    }
    .nav-active {
        transform: translateX(0);
    }

    /* --- تعديلات إضافية للهاتف --- */
    .site-header {
        padding: 3px 0; 
    }
    .navbar {
        min-height: 44px; 
    }
    .logo {
        font-size: 1.5rem; 
        white-space: nowrap; 
    }
    .logo img {
        max-height: 30px; 
    }

    /* 1. تصغير أحجام العناوين العامة */
    h1 { font-size: 2.2rem; }
    h2, .section-heading-v2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }

    /* 2. تعديل النص فوق الصورة الرئيسية */
    .hero-v2-overlay { padding: 20px; }
    .hero-v2-overlay h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: normal; }

    /* 3. تعديلات أخرى */
    .hero-v2-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    /* 4. تصغير خط سؤال الاستطلاع على الهاتف */
    .weekly-poll .poll-question {
        font-size: 1rem; 
    }
    
    /* 5. تعديلات كود الهاتف للأقسام المضافة */
    .content-grid {
      grid-template-columns: 1fr; /* جعل آخر الأخبار والشريط الجانبي تحت بعض */
    }

    .sidebar-list {
      position: relative; /* إلغاء تثبيت الشريط الجانبي */
      top: auto;
    }

    .feed-item {
      grid-template-columns: 1fr; /* جعل صورة المقال فوق النص */
    }

    .feed-item img {
      height: 200px; /* تحديد ارتفاع موحد للصور على الهاتف */
    }

   /* ... (تأكد أن الأكواد السابقة كلها سليمة) ... */

    /* * =============================================
     * ✅ تم التعديل: إصلاح قسم "Trending Now" للهاتف
     * =============================================
     */
    .trending-scroll {
      /* جعل الكروت أعرض على الهاتف لسهولة القراءة */
      grid-auto-columns: minmax(260px, 1fr);
      gap: 20px;
    }

    .trending-card {
      /* تقليل ارتفاع الكارت قليلاً على الهاتف */
      height: 180px; 
    }

    .trending-card .trending-title {
      /* تصغير الخط ليتناسب مع الهاتف */
      font-size: 1rem;
      padding: 15px 10px 10px 10px;
    } /* <-- تأكد من وجود قوس الإغلاق هذا */

    /* ✅ [جديد] إصلاح حجم عنوان المقالات على الهاتف */
    .article-content h1 {
        font-size: 1.8rem; /* <-- تصغير الخط */
        line-height: 1.3;  /* <-- تقليل المسافة بين السطور */
    }

} /* <-- هذا هو القوس الأخير لإغلاق الميديا كويري */

/* Animation for Nav Links */
@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}