:root {
  --primary-gold: #d4af37;
  --dark-brown: #5c4033;
  --light-brown: #8b6f47;
  --cream: #f5e6d3;
  --bg-light: #faf7f2;
  --text-dark: #3e2723;
  --gold-hover: #c19a2e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Tajawal", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  direction: rtl;
  line-height: 1.8;
}

/* التخطيط الرئيسي للتطبيق - نستخدم block layout بدل flex
   لأن الـ sidebar أصلاً position:fixed فما نحتاج flex */
.app-container {
  display: block;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* المنطقة الرئيسية للمحتوى */
.main-content-area {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  transition: padding-right 0.3s;
}

/* عند تفعيل السايدبار في الديسكتوب — نستخدم padding بدل margin
   لأن padding لا يمدد العنصر خارج الـ container */
.sidebar-active-margin {
  padding-right: 250px !important;
  margin-right: 0 !important;
}

#page-content-wrapper {
  width: 100%;
  max-width: 100%;
}

/* ضمان عدم تجاوز أي قسم للعرض */
#dashboard-content,
.page-content,
.features-section,
.container,
.container-fluid {
  max-width: 100%;
}

/* شريط التنقل */
.navbar {
  background: linear-gradient(
    135deg,
    var(--dark-brown) 0%,
    var(--light-brown) 100%
  );
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-gold) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--dark-brown);
  font-weight: bold;
}

.nav-link {
  color: var(--cream) !important;
  font-weight: 500;
  margin: 0 0.5rem;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--primary-gold) !important;
}

/* الأزرار */
.btn-gold {
  background-color: var(--primary-gold);
  color: var(--dark-brown);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-gold:hover {
  background-color: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-outline-gold {
  border: 2px solid var(--primary-gold);
  color: var(--primary-gold);
  background: transparent;
  padding: 0.6rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-outline-gold:hover {
  background-color: var(--primary-gold);
  color: var(--dark-brown);
  transform: translateY(-2px);
}

/* الأقسام العامة */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--dark-brown) 0%,
    var(--light-brown) 50%,
    var(--primary-gold) 100%
  );
  padding: 7rem 0;
  color: white;
  position: relative;
  overflow: hidden;
}


.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,122.7C1248,107,1344,85,1392,74.7L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>')
    no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

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

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.hero-section p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.features-section {
  padding: 4rem 0;
  background-color: white;
}

.section-title {
  text-align: center !important;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 3rem;
  position: relative;
  padding: 2rem 0 1rem 0;
}
.contact-section {
  padding-bottom: 2rem;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-gold), var(--light-brown));
  border-radius: 2px;
}

/* بطاقات Features */
.feature-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border: 2px solid var(--cream);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
  border-color: var(--primary-gold);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-gold), var(--gold-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
}

.feature-card h3 {
  color: var(--dark-brown);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.feature-card p {
  color: var(--text-dark);
  opacity: 0.8;
}

/* قسم الحلقات */
.halaqat-section {
  padding: 4rem 0;
  background-color: var(--bg-light);
}

/* بطاقة الحلقة */
.halqa-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border: 2px solid transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.halqa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
  border-color: var(--primary-gold);
}

.halqa-header {
  background: linear-gradient(135deg, var(--dark-brown), var(--light-brown));
  padding: 1.5rem;
  color: white;
}

.halqa-header h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.4rem;
}

.halqa-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.halqa-info {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

.halqa-info i {
  color: var(--primary-gold);
  margin-left: 0.5rem;
  font-size: 1.1rem;
}

.halqa-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cream);
  margin-top: auto;
}

.badge-custom {
  background-color: var(--primary-gold);
  color: var(--dark-brown);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}
.text-md-start {
  text-align: center !important;
}

/* قسم المصادقة */
.auth-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--cream) 100%);
}

.auth-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 450px;
  width: 100%;
}

.auth-header {
  background: linear-gradient(135deg, var(--dark-brown), var(--light-brown));
  padding: 2rem;
  text-align: center;
  color: white;
}

.auth-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-body {
  padding: 2.5rem;
}

.form-label {
  color: var(--dark-brown);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control {
  border: 2px solid var(--cream);
  border-radius: 10px;
  padding: 0.8rem;
  transition: all 0.3s;
}

.form-control:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
}

/* الإحصائيات */
.stats-section {
  background: linear-gradient(135deg, var(--dark-brown), var(--light-brown));
  padding: 3rem 0;
  color: white;
  text-align: center;
}

.stat-item h3 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-gold);
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* التذييل (Footer) */
footer {
  background-color: var(--dark-brown);
  color: var(--cream);
  padding: 2rem 0;
  text-align: center;
  width: 100%;
  margin-top: auto;
}

footer p {
  margin: 0;
  opacity: 0.9;
}

/* فلاتر الحلقات */
.filter-section {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.filter-section select {
  border: 2px solid var(--cream);
  border-radius: 10px;
  padding: 0.8rem;
}

/* الشريط الجانبي (Sidebar) */
.sidebar {
  width: 250px;
  background-color: var(--dark-brown);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 0;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  z-index: 1030;
  overflow-y: auto;
  transition: right 0.3s ease-in-out;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE / Edge */
}
.sidebar::-webkit-scrollbar {
  display: none;               /* Chrome / Safari / Opera */
}

.sidebar .list-group-item {
  color: var(--cream);
  background-color: var(--dark-brown);
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
  background-color: var(--light-brown);
  color: var(--primary-gold) !important;
}

.sidebar .list-group-item i {
  color: var(--primary-gold);
  transition: color 0.2s;
}

.sidebar h5 {
  color: var(--primary-gold) !important;
  border-bottom: 1px solid var(--light-brown);
  padding: 0 1rem 1rem 1rem;
  margin-bottom: 1rem;
}

/* زر قائمة الجوال (Hamburger Icon) */
.navbar-toggler-sidebar {
  display: none;
  border: none;
  color: var(--dark-brown);
  font-size: 2rem;
  padding: 0.5rem;
  background: white;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1040;
  cursor: pointer;
}

/* حاوية التعتيم (Backdrop) */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1029;
  display: none;
  cursor: pointer;
}

.sidebar-backdrop.show {
  display: block;
}

/* النمط الخاص برسالة "قيد التطوير" */
.under-development {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 30vh;
  text-align: center;
  color: var(--light-brown);
  font-size: 1.5rem;
  padding: 2rem;
}

/* Utility Class */
.hidden {
  display: none !important;
}

/* =======================================
   قواعد التجاوب (Mobile First)
   ======================================= */

/* الشاشات التي عرضها 991px أو أقل (الأجهزة اللوحية والجوالات) */
@media (max-width: 991px) {
  /* 1. إظهار زر قائمة الجوال وتثبيته في الزاوية اليسرى */
  .navbar-toggler-sidebar {
    display: block !important;
    position: fixed;
    top: 1rem;
    left: 1rem;
  }

  /* 2. نقل الشريط الجانبي خارج الشاشة */
  .sidebar {
    right: -250px;
  }

  /* 3. إظهار الشريط الجانبي عند تفعيل كلاس 'sidebar-show' */
  .sidebar.sidebar-show {
    right: 0;
  }

  /* 4. إزالة الهامش الثابت على المحتوى الرئيسي */
  .main-content-area {
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .sidebar-active-margin {
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 5. إخفاء قوائم Bootstrap Navbar الأصلية على الجوال */
  .navbar-collapse:not(.show) {
    display: none !important;
  }
}
@media (max-width: 991px) {
  /* إجبار الهيدر على البقاء في سطر واحد */
  .navbar .container-fluid {
    flex-wrap: nowrap !important;
    align-items: center;
  }

  /* تصغير الشعار والنص */
  .navbar-brand {
    font-size: 1.1rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navbar-brand img {
    width: 35px !important;
    height: 35px !important;
  }

  /* تصغير زر الهامبرغر قليلاً ليناسب المساحة */
  .navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
  }
}
