/* إعدادات عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
  text-align: right;
}
body {
  background-color: #f8f9fa;
  direction: rtl;
  
}

/* ==================== الهيدر ==================== */
.main-header {
  background-color: #2c3e50;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.logo {
  display: flex;
  align-items: center;

}
.logo img {
  height: 50px;
  margin-left: 10px;
}
.logo-text {
  font-size: 24px;
  font-weight: 700;


}


/* شريط البحث */
.search-bar {
  flex-grow: 1;
  max-width: 700px;
  margin: 0 20px;
  position: relative;
}
.search-bar input {
  width: 100%;
  border-radius: 25px;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  transition: all 0.3s;
}
.search-bar input:focus {
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 2px #3498DB;
}
.search-bar button {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fdcb6e;
  cursor: pointer;
}

/* المستخدم */
.user-actions {
  display: flex;
  align-items: center;
}
.user-actions a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
  font-size: 14px;
  transition: color 0.3s;
}
.user-actions a:hover {
  color: #3498DB;
}
.user-profile {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 10px;
  border: 2px solid #3498DB;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 180px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  z-index: 100;
  padding: 10px 0;
}
.user-profile:hover .dropdown-menu,
.nav-item:hover .dropdown-menu {
  display: block;
}
.dropdown-menu a {
  color: #2C3E50 !important;
  display: block;
  padding: 8px 15px;
}
.dropdown-menu a:hover {
  background-color: #f5f5f5;
  color: #3498DB !important;
}

/* الأزرار */
.btn {
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s;
}
.btn-login {
  border: 1px solid white;
}
.btn-login:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.btn-register {
  background-color: #3498DB;
}
.btn-register:hover {
  background-color: #2980B9;
}
/* ====================  مسارات شريط التنقل ==================== */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

/* ==================== شريط التنقل ==================== */
.main-nav {
  background-color: #2c3e50;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.nav-links {
  display: flex;
  list-style: none;
}
.nav-links li {
  position: relative;
}
.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 25px;
  display: block;
  transition: all 0.3s;
}
.nav-links a:hover {
  background-color: #2C3E50;
}

/* ==================== الكروت ==================== */

/* ضبط عرض الكروت بشكل أفقي داخل كل تصنيف */
.featured-books .books-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.featured-books .books-row .card {
  display: block;
  width: 220px; /* عرض ثابت للكرت */
  height: auto;
  margin: 10px 15px;
  
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  border-radius: 8px;
  transition: transform 0.3s ease;
  background-color: #fff;
  cursor: pointer;
}
.featured-books .books-row .card:hover {
  transform: translateY(-5px);
}
.card-img-top {
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.card-body {
  padding: 15px 20px;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-text {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
  display: -webkit-box;
  
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== السكشن ==================== */
.featured-books {
  padding: 20px 0;
  background-color: #f9f9f9;
  margin-left: 10px;
}
.section-header {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  flex-direction: column;
}
.section-header h2 {
  font-size: 1.2rem;
  color: #2C3E50;
  margin-bottom: 10px;
}
.section-header p {
  color: #7f8c8d;
  font-size: 1.0rem;
}
.section-footer {
  text-align: center;
  margin-top: 40px;
}
.view-all-btn {
  display: inline-flex;
  align-items: center;
  background-color: #2C3E50;
  color: white;
  padding: 12px 25px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
}
.view-all-btn:hover {
  background-color: #3498DB;
}
.view-all-btn i {
  margin-right: 8px;
}

/* ==================== الفوتر ==================== */
.site-footer {
  background-color: #2C3E50;
  color: white;
  padding: 40px 20px;
  margin-top: 50px;
}
.footer-container {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  flex-wrap: wrap;
  text-align: right;
}
.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 30px;
  padding: 0 15px;
}
.footer-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}
.footer-section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: #3498DB;
}
.footer-section.links ul {
  list-style: none;
  padding: 0;
}
.footer-section.links li {
  margin-bottom: 10px;
}
.footer-section.links a {
  color: #BDC3C7;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-section.links a:hover {
  color: #3498DB;
}
.contact-info {
  list-style: none;
  padding: 0;
}
.contact-info li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.contact-info i {
  margin-left: 10px;
  color: #3498DB;
}

/* ==================== الاستجابة للهواتف ==================== */
@media (max-width: 576px) {
  body {
    font-size: 14px;
  }
  .main-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
  }
  .header-container {
    padding: 0 10px;
  }
  .logo-text {
    font-size: 18px;
  }
  .search-bar {
    max-width: 100%;
    margin: 0 5px;
  }
  .search-bar input {
    font-size: 12px;
  }
  .user-actions a {
    font-size: 12px;
    margin-left: 8px;
  }
  .nav-links {
    display: none;
  }
  /* زر القائمة للهواتف */
  .mobile-menu-btn {
    display: block;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
  }
  .featured-books .books-row {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .featured-books .books-row .card {
    width: 100%;
    margin: 10px 0;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .footer-section {
    margin-bottom: 20px;
    padding: 0;
  }
}

/* إخفاء زر القائمة افتراضيًا */
.mobile-menu-btn {
  display: none;
}

.table-responsive {
  max-width: calc(100% - 250px); /* نقصنا عرض السايدبار تقريبا */
  overflow-x: auto;
}

table.table {
  width: 100%;
  font-size: 0.9rem; /* تصغير حجم الخط شوية */
}

@media (max-width: 768px) {
  .table-responsive {
    max-width: 100%; /* على الشاشات الصغيرة نعطي الجدول العرض الكامل */
  }
}
