/* الألوان الرئيسية للموقع */
:root {
  --primary-color: #2c3e50; /* لون داكن أزرق مائل للرمادي - يعطي إحساس بالثقة والاحترافية */
  --secondary-color: #c0392b; /* أحمر داكن - يستخدم للتأكيد والعناصر المهمة */
  --accent-color: #f1c40f; /* ذهبي - يستخدم للتفاصيل الصغيرة */
  --text-color: #333333; /* لون النص الرئيسي */
  --light-bg: #f5f5f5; /* خلفية فاتحة للأقسام */
  --white: #ffffff; /* أبيض للخلفيات */
  --footer-bg: #1a252f; /* خلفية داكنة للتذييل */
}

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

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

/* الخطوط والعناوين */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Amiri', serif;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  position: relative;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background-color: var(--secondary-color);
}

p {
  margin-bottom: 1rem;
}

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

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

/* الحاوية الرئيسية */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* رأس الصفحة */
.header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 50px;
  margin-left: 10px;
}

.logo-text {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* القائمة الرئيسية */
.nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
}

.nav-item {
  margin-right: 1.5rem;
}

.nav-link {
  font-weight: 600;
  padding: 0.5rem;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

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

.active {
  color: var(--secondary-color);
}

.active::after {
  width: 100%;
}

/* زر القائمة للهواتف */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
}

/* القسم الرئيسي */
.main {
  margin-top: 80px;
  min-height: calc(100vh - 80px - 200px); /* ارتفاع الشاشة - ارتفاع الرأس - ارتفاع التذييل */
}

/* قسم البطاقة الرئيسية */
.hero {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/scales-of-justice.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #a93226;
  color: var(--white);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--white);
  margin-right: 1rem;
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary-color);
}

/* الأقسام */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-light {
  background-color: var(--light-bg);
}

/* قسم الخدمات */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.service-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* قسم المقالات */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.article-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.article-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
}

.article-date {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.article-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.article-excerpt {
  margin-bottom: 1.5rem;
}

.read-more {
  font-weight: 600;
}

/* قسم المكتبة */
.library-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-btn {
  padding: 0.5rem 1.5rem;
  margin: 0.5rem;
  background-color: var(--white);
  border: 1px solid var(--primary-color);
  border-radius: 30px;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn:hover, .category-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.book-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.book-cover {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.book-content {
  padding: 1.5rem;
}

.book-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.book-author {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.book-description {
  margin-bottom: 1.5rem;
}

/* قسم التواصل */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-left: 1rem;
}

.contact-text h4 {
  margin-bottom: 0.3rem;
}

.social-links {
  display: flex;
  margin-top: 2rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  margin-left: 1rem;
  transition: background-color 0.3s ease;
}

.social-link:hover {
  background-color: var(--secondary-color);
}

.contact-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

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

/* التذييل */
.footer {
  background-color: var(--footer-bg);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-about {
  margin-bottom: 1.5rem;
}

.footer-title {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 2px;
  background-color: var(--secondary-color);
}

.footer-links {
  list-style: none;
}

.footer-link {
  margin-bottom: 0.8rem;
}

.footer-link a {
  color: #bbb;
  transition: color 0.3s ease;
}

.footer-link a:hover {
  color: var(--white);
}

.footer-social {
  display: flex;
  margin-top: 1.5rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 50%;
  margin-left: 0.8rem;
  transition: background-color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* التصميم المتجاوب */
@media (max-width: 992px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 80%;
    height: calc(100vh - 80px);
    background-color: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    padding: 2rem;
  }

  .nav-item {
    margin-right: 0;
    margin-bottom: 1.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
  }

  .btn-outline {
    margin-right: 0;
  }

  .services-grid, .articles-grid, .books-grid {
    grid-template-columns: 1fr;
  }
}

/* تأثيرات التمرير */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* زر العودة للأعلى */
.back-to-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--secondary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-color);
}
