/* ========================================= */
/* 1. المتغيرات والألوان الرسمية (كما طلبت) */
/* ========================================= */
:root {
  --primary-color: #e63946;  /* الأحمر الرسمي */
  --secondary-color: #ffd166; /* الأصفر الذهبي */
  --dark-color: #1d3557;     /* الأزرق الداكن */
  --light-color: #f1faee;    /* الأبيض المائل للكريمي */
  --glass-effect: rgba(29, 53, 87, 0.7); /* تأثير الزجاج بلون الموقع */
  --card-bg: rgba(0, 0, 0, 0.25); /* خلفية البطاقات */
  --header-height: 70px;
}

/* ========================================= */
/* 2. إعدادات الصفحة والجسم */
/* ========================================= */
body {
  font-family: 'Cairo', sans-serif;
  /* الخلفية المتدرجة الرسمية */
  background: linear-gradient(135deg, var(--dark-color), var(--primary-color));
  color: var(--light-color);
  margin: 0;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.news-main {
  padding: clamp(15px, 4vw, 30px);
  max-width: 1400px;
  margin: 0 auto;
}

.news-hero {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 28px);
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.news-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.news-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

/* ========================================= */
/* 3. الهيدر (نفس التصميم القديم) */
/* ========================================= */
.header {
  background: rgba(29, 53, 87, 0.9);
  backdrop-filter: blur(10px);
  height: var(--header-height);
  padding: 0 clamp(15px, 4vw, 30px);
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .logo { display: flex; align-items: center; gap: 12px; }
.header .logo img { height: 45px; width: auto; }
.header .logo h1 { margin: 0; font-size: 1.4rem; font-weight: 700; color: #fff; }

.nav ul { display: flex; gap: 15px; list-style: none; margin: 0; padding: 0; }
.nav ul li a { color: var(--light-color); text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: 30px; transition: 0.3s; }
.nav ul li a:hover, .nav ul li a.active { background: rgba(255, 255, 255, 0.2); }

/* ========================================= */
/* 4. أقسام البحث والفلاتر */
/* ========================================= */
.search-section {
  background: var(--glass-effect);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto; margin-right: auto;
}

.search-container input {
  flex-grow: 1;
  padding: 12px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  outline: none;
}

.search-container input::placeholder { color: rgba(255,255,255,0.6); }

.search-container button {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(230, 57, 70, 0.4);
}
.search-container button:hover { transform: scale(1.05); background: #ff4d5a; }

.categories-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  justify-content: center;
}

.category-btn {
  font-family: 'Cairo', sans-serif;
  background: rgba(255, 255, 255, 0.1);
  color: var(--light-color);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-weight: 600;
}

.category-btn.active, .category-btn:hover {
  background: var(--light-color);
  color: var(--dark-color);
  transform: translateY(-2px);
}

/* ========================================= */
/* 5. شبكة الأخبار والبطاقات (الهيكل الجديد بالألوان القديمة) */
/* ========================================= */
.breaking-news-section, .sports-news-section {
    margin-bottom: 40px;
}

.section-title {
  font-size: 1.6rem;
  color: var(--light-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color); /* الخط الأصفر */
  display: inline-block;
}
.section-title i { color: var(--secondary-color); margin-left: 10px; }

/* إعدادات الشبكة (Grid) */
#breaking-news, #sports-news, #news-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* البطاقة الموحدة */
.news-card, .breaking-news-card {
  background: var(--card-bg); /* لون الخلفية الشفاف الداكن */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.news-card:hover, .breaking-news-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.4);
}

/* حاوية الصورة */
.news-image-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
  background-color: #2a3b4c;
}

.news-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover img { transform: scale(1.1); }

/* بادج التصنيف (فوق الصورة) */
.news-category-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary-color); /* الأحمر الرسمي */
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* محتوى البطاقة */
.news-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-title {
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.news-title a {
  color: var(--light-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  transition: color 0.3s;
  
  /* قص العنوان لسطرين */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-title a:hover { color: var(--secondary-color); /* التغيير للأصفر عند التحويم */ }

.news-summary {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.read-more-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.read-more-link:hover { text-decoration: underline; color: #fff; }

.news-source {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================= */
/* 6. زر تحميل المزيد */
/* ========================================= */
.load-more-btn {
  display: none; /* يظهر بواسطة JS */
  margin: 30px auto;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.load-more-btn:hover {
  background: #c92a35;
  transform: translateY(-2px);
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #555;
}

/* ========================================= */
/* 7. شريط التواصل الاجتماعي (كما في الكود القديم) */
/* ========================================= */
.social-bar {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 0 10px 10px 0;
    z-index: 999;
}

.social-icon {
    color: white;
    font-size: 24px;
    padding: 8px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.social-icon:hover { transform: scale(1.2); }
.social-icon.tiktok:hover { color: #00f2ea; }
.social-icon.instagram:hover { color: #e4405f; }
.social-icon.youtube:hover { color: #ff0000; }

/* ========================================= */
/* 8. التجاوب والتحميل */
/* ========================================= */
@media (max-width: 768px) {
  #breaking-news, #sports-news, #news-grid-container {
    grid-template-columns: 1fr;
  }
  .header .logo h1 { display: none; }
  .news-main { padding: 15px; }
  .nav { display: none; } /* إذا كنت ستضيف زر قائمة لاحقاً */
}

/* مؤشر التحميل */
.loading-indicator, .loading-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 40px;
  color: var(--light-color);
  grid-column: 1 / -1;
}

.loader, .fa-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  width: 40px; height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-news, .error-msg {
  text-align: center;
  padding: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--light-color);
  grid-column: 1 / -1;
}
