@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* إعدادات عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #194a7c; /* اللون الأزرق الرئيسي */
  --secondary-color: #99cc00; /* اللون الأخضر الثانوي */
  --text-color: #333; /* لون النص الأساسي */
  --light-gray: #f8f8f8; /* رمادي فاتح للخلفيات */
  --medium-gray: #eee; /* رمادي متوسط للحدود */
  --dark-gray: #666; /* رمادي داكن للنصوص الثانوية */
  --border-color: #ddd; /* لون الحدود */
  --white: #fff; /* اللون الأبيض */
  --black: #111; /* اللون الأسود */
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* ظل موحد */
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--light-gray);
  color: var(--text-color);
  line-height: 1.6;
  direction: rtl;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s;
}

a:hover {
  color: var(--secondary-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* الرأس */
header {
  background-color: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  height: 70px; /* ارتفاع ثابت للهيدر */
}

.logo-container {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo-image {
  height: 180px;
  width: auto;
  display: block;
}

.date {
  color: var(--dark-gray);
  font-size: 14px;
}

/* شريط الألوان المتعدد */
.color-bar {
  display: flex;
  width: 100%;
  height: 4px;
}

.color-segment {
  height: 100%;
}

.color-1 { background-color: #8B4513; width: 12.5%; } /* بني - مقالات */
.color-2 { background-color: #FFD700; width: 12.5%; } /* ذهبي - ملتيميديا */
.color-3 { background-color: #FF6347; width: 12.5%; } /* برتقالي محمر - منوعات */
.color-4 { background-color: #9370DB; width: 12.5%; } /* أرجواني - ثقافة وفن */
.color-5 { background-color: #4169E1; width: 12.5%; } /* أزرق ملكي - اقتصاد */
.color-6 { background-color: #32CD32; width: 12.5%; } /* أخضر - رياضة */
.color-7 { background-color: #1E90FF; width: 12.5%; } /* أزرق - أخبار */
.color-8 { background-color: #000000; width: 12.5%; } /* أسود - الرئيسية */

/* شريط التنقل */
.nav-container {
  background-color: var(--white);
  border-top: 1px solid var(--medium-gray);
  border-bottom: 1px solid var(--medium-gray);
  position: relative;
}

.main-nav {
  width: 100%;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.main-nav li {
  position: relative;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.main-nav a:hover {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

.main-nav a.active {
  background-color: transparent;
  color: var(--text-color);
  border-bottom: 3px solid var(--primary-color);
}

/* مسار التنقل */
.breadcrumb {
  margin: 15px 0;
  font-size: 14px;
  color: var(--dark-gray);
}

.breadcrumb a {
  color: var(--primary-color);
  margin: 0 3px;
}

.breadcrumb span {
  margin: 0 3px;
}

/* قسم العنوان الرئيسي */
.headline {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--medium-gray);
}

h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.headline-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
  font-size: 14px;
  color: var(--dark-gray);
}

.badge {
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 3px;
  font-weight: 500;
}

.author, .date-time {
  position: relative;
  padding-right: 10px;
}

.author:before, .date-time:before {
  content: '•';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--secondary-color);
}

/* أزرار المشاركة الاجتماعية */
.social-share-bar {
  display: flex;
  margin-bottom: 20px;
  gap: 8px;
}

.social-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border-radius: 50%;
  transition: opacity 0.3s;
}

.social-btn:hover {
  opacity: 0.8;
}

.facebook { background-color: #3b5998; }
.twitter { background-color: #1da1f2; }
.whatsapp { background-color: #25d366; }
.linkedin { background-color: #0077b5; }
.print { background-color: #666; }
.email { background-color: #ea4335; }

/* تخطيط المحتوى الرئيسي */
.main-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 40px;
}

.content {
  flex: 2; /* زيادة حجم محتوى الخبر بالنسبة للنموذج */
  min-width: 500px; /* زيادة الحد الأدنى للعرض */
}

.form-container {
  flex: 1;
  min-width: 300px;
  max-width: 400px; /* تحديد الحد الأقصى لعرض النموذج */
}

.content-box {
  background-color: var(--white);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
}

/* الصورة الرئيسية للخبر */
.feature-image {
  width: 100%;
  height: auto;
  max-height: 450px; /* تحديد الحد الأقصى للارتفاع */
  object-fit: cover; /* للتأكد من تغطية المساحة المخصصة بشكل جيد */
  border-radius: 5px;
  margin-bottom: 15px;
  display: block;
}

.lead-paragraph {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-color);
  font-weight: 500;
}

/* الأخبار ذات الصلة */
.related-news {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--medium-gray);
}

.related-news h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 20px;
  position: relative;
  padding-right: 15px;
}

.related-news h3:before {
  content: '';
  position: absolute;
  right: 0;
  top: 5px;
  height: 16px;
  width: 4px;
  background-color: var(--secondary-color);
}

.related-news ul {
  list-style: none;
}

.related-news li {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--medium-gray);
}

.related-news li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.related-news a {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.news-date {
  font-size: 12px;
  color: var(--dark-gray);
  display: block;
}

/* تنسيق قسم التعليقات */
.comments-section {
  margin-top: 40px;
  background-color: var(--white);
  border-radius: 5px;
  padding: 20px;
  box-shadow: var(--box-shadow);
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--medium-gray);
  padding-bottom: 10px;
}

.comments-title {
  font-size: 20px;
  color: var(--primary-color);
  font-weight: 700;
}

.comment-count {
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* تنسيق التعليق الفردي */
.comment {
  display: flex;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--medium-gray);
}

.comment:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comment-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-left: 15px;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-content {
  flex: 1;
}

.comment-author {
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.comment-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.comment-text {
  line-height: 1.5;
  color: var(--text-color);
}

.comment-reply {
  margin-top: 10px;
}

.reply-button {
  background-color: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  font-family: 'Tajawal', sans-serif;
}

.like-button {
  background-color: transparent;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  font-family: 'Tajawal', sans-serif;
}

.like-button.liked {
  color: var(--primary-color);
}

.like-count {
  color: #666;
  font-size: 14px;
  margin-left: 5px;
}

/* أنماط النموذج */
.form-container {
  background-color: var(--white);
  padding: 25px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
}

.form-header {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
}

.form-icon {
  font-size: 30px;
  display: block;
  margin-bottom: 10px;
}

.form-headline {
  font-size: 20px;
  color: var(--primary-color);
  font-weight: 700;
  position: relative;
  padding-bottom: 15px;
}

.form-headline:after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 25%;
  left: 25%;
  height: 3px;
  background-color: var(--secondary-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 500;
}

.form-group input, 
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus, 
.form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
}

.radio-group .radio-options {
  display: flex;
  gap: 20px;
}

.radio-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-options input {
  width: auto;
  margin-left: 8px;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  font-family: 'Tajawal', sans-serif;
}

.submit-btn:hover {
  background-color: #0d2d4e;
}

.submit-btn:disabled {
  background-color: var(--dark-gray);
  cursor: not-allowed;
}

.privacy-note {
  margin-top: 15px;
  font-size: 12px;
  color: var(--dark-gray);
  text-align: center;
}

/* تذييل الصفحة */
footer {
  background-color: var(--black);
  padding: 20px 0;
  color: var(--white);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-right {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #aaa;
}

.footer-right span {
  margin-bottom: 5px;
}

.footer-middle {
  display: flex;
  align-items: center;
}

.footer-logo-image {
  height: 70px;
  filter: brightness(0) invert(1);
}

.footer-left {
  display: flex;
  gap: 15px;
}

.footer-social {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background-color: #333;
  border-radius: 50%;
  font-size: 12px;
  transition: background-color 0.3s;
}

.footer-social:hover {
  background-color: var(--primary-color);
}

.footer-links {
    margin-top: 10px;
    font-size: 14px;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* صفحة الشكر */
.thank-you-container {
  text-align: center;
  background-color: var(--white);
  padding: 40px 30px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
  margin: 30px auto 50px;
  max-width: 700px;
}

.thank-you-icon {
  color: var(--secondary-color);
  font-size: 70px;
  margin-bottom: 25px;
}

.thank-you-title {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 700;
}

.thank-you-message {
  font-size: 18px;
  margin-bottom: 30px;
  color: var(--text-color);
  line-height: 1.7;
}

.success-details {
  background-color: rgba(153, 204, 0, 0.1);
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 30px;
  text-align: right;
}

.success-details ul {
  list-style: none;
  padding: 0;
}

.success-details li {
  padding: 10px 0;
  position: relative;
  padding-right: 30px;
  color: var(--text-color);
  font-size: 16px;
}

.success-details i {
  position: absolute;
  right: 0;
  top: 12px;
  color: var(--secondary-color);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.back-home {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 4px;
  font-size: 16px;
  transition: all 0.3s;
}

.back-home i {
  margin-left: 8px;
}

.back-home:hover {
  background-color: #0d2d4e;
  color: var(--white);
}

/* زر التمرير للنموذج على الجوال */
.scroll-to-form-btn {
  display: none; /* مخفي افتراضياً، سيتم إظهاره عبر JavaScript على الجوال */
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: var(--primary-color);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 999;
  transition: all 0.3s;
}

.scroll-to-form-btn:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

/* إظهار البيانات الإلزامية في نموذج التسجيل */
.form-group label::after {
  content: " *";
  color: #e74c3c;
}

/* التحقق من صحة الإدخال */
.error {
  border-color: #e74c3c !important;
}

.error-message {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.form-group.has-error .error-message {
  display: block;
}

/* تصميم متجاوب لجميع أحجام الشاشة */
@media (max-width: 992px) {
  .main-nav ul {
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .main-nav a {
    padding: 10px 15px;
    font-size: 15px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  .lead-paragraph {
    font-size: 16px;
  }
  
  .content {
    min-width: 400px;
  }
}

@media (max-width: 768px) {
  /* تحسين الهيدر على الجوال */
  .header-content {
    height: auto;
    padding: 10px 0;
  }
  
  /* تغيير ترتيب العناصر في الجوال */
  .main-content {
    flex-direction: column;
  }
  
  .content, .form-container {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
  }
  
  /* تحسين النموذج على الجوال */
  .form-container {
    order: 2; /* جعل النموذج يظهر بعد المحتوى */
    margin-top: 20px;
    padding: 15px;
  }
  
  /* تصغير العناصر على الجوال */
  .headline-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  /* تحسين شكل التعليقات على الجوال */
  .comment {
    flex-direction: column;
  }
  
  .comment-avatar {
    margin-left: 0;
    margin-bottom: 10px;
  }
  
  /* تحسين الفوتر على الجوال */
  .footer-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .footer-right {
    order: 3;
  }
  
  .footer-middle {
    order: 1;
    margin-bottom: 15px;
  }
  
  .footer-left {
    order: 2;
    justify-content: center;
  }
  
  @media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-right {
        order: 3;
    }
    
    .footer-links {
        margin-top: 5px;
    }
    
    .footer-middle {
        order: 1;
        margin-bottom: 15px;
    }
    
    .footer-left {
        order: 2;
        justify-content: center;
    }
}
  
  /* تحسين أزرار المشاركة على الجوال */
  .social-share-bar {
    justify-content: center;
  }
  
  /* إظهار زر التمرير للنموذج */
  .scroll-to-form-btn {
    display: block;
  }
  
  /* تحسين صورة الخبر على الجوال */
  .feature-image {
    max-height: 200px;
  }
  
  /* تحسين نموذج الراديو على الجوال */
  .radio-group .radio-options {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  /* تحسينات للهواتف الصغيرة */
  .logo-image {
    height: 70px;
  }
  
  .date {
    font-size: 12px;
  }
  
  h1 {
    font-size: 20px;
  }
  
  .content-box {
    padding: 15px;
  }
  
  .feature-image {
    max-height: 180px;
  }
  
  .form-headline {
    font-size: 18px;
  }
  
  .form-group label {
    font-size: 14px;
  }
  
  .form-group input, 
  .form-group select {
    padding: 10px;
    font-size: 14px;
  }
}

@media (max-width: 320px) {
  /* تحسينات إضافية للهواتف الصغيرة جداً */
  .feature-image {
    max-height: 150px;
  }
  
  .comments-title {
    font-size: 16px;
  }
  
  .comment-avatar {
    width: 40px;
    height: 40px;
  }
}

.mobile-cta-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-cta-btn {
        display: block;
        width: 90%;
        margin: 20px auto;
        text-align: center;
        background-color: #004A99;
        color: #fff;
        padding: 12px;
        font-size: 18px;
        font-weight: bold;
        border-radius: 8px;
        text-decoration: none;
        transition: background-color 0.3s;
    }

    .mobile-cta-btn:hover {
        background-color: #002e66;
    }
}

/* تحسينات إضافية للطباعة */
@media print {
  .nav-container, 
  .social-share-bar, 
  .form-container, 
  .comments-section, 
  .footer,
  .scroll-to-form-btn {
    display: none;
  }
  
  .content {
    width: 100%;
    min-width: 100%;
  }
}