/* ===========================
   Mateen Academic Program — Home Page
   Responsive rewrite with Bootstrap 5 RTL
   =========================== */

:root {
  --green-dark:  #5c3d2e;
  --green-mid:   #8a5e3c;
  --green-light: #b8966e;
  --gold:        #c9a227;
  --gold-light:  #e8c96a;
  --beige:       #f7efe3;
  --beige2:      #ede0cc;
  --beige3:      #d6c4a8;
  --white:       #fff;
  --text-dark:   #2c1a0e;
  --text-mid:    #8a6a52;
  --border:      rgba(184,150,110,0.27);
  --sidebar-w:   260px;
}

/* ===== FOUC PREVENTION ===== */
html {
  overflow-x: hidden;
  visibility: hidden;   /* Hide until html.ready — CSS fallback unhides if JS is late */
  animation: foucFallback 0s 0.2s forwards;
}

html.ready {
  visibility: visible;
  animation: pageReveal 0.25s ease forwards;
}

@keyframes foucFallback {
  to { visibility: visible; }
}

@keyframes pageReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  font-family: "Noto Naskh Arabic", serif;
  direction: rtl;
  background: var(--beige);
  color: var(--text-dark);
  font-size: 14px;
}

/* ===== BASMALA ===== */
.basmala-bar {
  background: var(--green-dark);
  color: var(--gold-light);
  text-align: center;
  padding: 7px 16px;
  font-family: Amiri, serif;
  font-size: 15px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.bsm-ornament { color: var(--gold); font-size: 13px; }

/* ===== NAVBAR ===== */
.main-nav {
  background: var(--green-dark);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 20px;
  gap: 12px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  overflow: hidden;
  flex-shrink: 0;
  background: #1a4a2e;
  box-shadow: 0 0 0 1px rgba(201,162,39,0.25);
}
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Logo needs light background (logo is semi-transparent)
   ولا يظهر بوضوح على Background الdarkة Userة لشعار متين */
.logo-circle-shuraka {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,162,39,0.3), 0 2px 8px rgba(0,0,0,0.15);
}
.logo-circle-shuraka img {
  object-fit: contain;
  padding: 5px;
  filter: contrast(1.2) saturate(1.1);
}

.nav-brand {
  font-family: Amiri, serif;
  color: var(--gold-light);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.nav-tagline { color: rgba(255,255,255,0.5); font-size: 11px; }

/* Account button — part of navbar */
.sidebar-fab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(201,162,39,0.5);
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
  flex-shrink: 0;
}
.sidebar-fab:hover {
  background: rgba(201,162,39,0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}
.sidebar-fab i { font-size: 16px; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;
}
.nav-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-light); }

.nav-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.btn-outline {
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}
.btn-outline:hover { background: rgba(201,162,39,0.1); }

/* ===== NAVBAR PROFILE ===== */
.nav-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-msg-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(201,162,39,0.5);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  transition: background 0.2s;
}
.nav-msg-btn:hover { background: rgba(201,162,39,0.1); color: var(--gold-light); }
.nav-msg-btn i { font-size: 17px; }
.nav-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--beige);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: box-shadow 0.2s;
  cursor: pointer;
}
.nav-profile-avatar:hover {
  box-shadow: 0 0 0 3px rgba(201,162,39,0.35);
}


.nav-msg-btn {
  position: relative;
  text-decoration: none;
}
.nav-msg-badge {
  min-width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: #d9534f;
  border: 2px solid var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0;
}
.nav-msg-btn .nav-msg-badge {
  position: absolute;
  top: -3px;
  right: -3px;
}
.sidebar-nav a .nav-msg-badge {
  margin-inline-start: auto;
  min-width: 10px;
  height: 10px;
}
@media (min-width: 992px) {
  .nav-msg-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 12.5px;
    margin-inline-end: 8px;
  }
  .nav-msg-btn:hover { background: rgba(201,162,39,0.1); }
}

.btn-solid {
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-solid:hover { opacity: 0.88; }

.nav-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--green-dark);
  border-top: 2px solid var(--gold);
  padding: 10px 16px 16px;
  position: absolute;
  top: 100%;
  right: 0; left: 0;
  z-index: 490;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.mobile-menu.open { display: flex; }

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: color 0.15s, background 0.15s;
}
.mobile-menu ul li a:hover { color: var(--gold-light); background: rgba(201,162,39,0.1); }

.mobile-menu-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(201,162,39,0.3);
}

.mob-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(201,162,39,0.12);
  color: var(--gold-light);
  border: 1px solid rgba(201,162,39,0.4);
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.mob-reg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ===== PAGE LAYOUT ===== */
.page-layout {
  display: block;
  min-height: calc(100vh - 84px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Sidebar overlay on all screens — opens on top of content, not beside it */
/* (Doesn't exist / None sticky desktop sidebar — Content يملأ الWidth/Display كامل دايماً) */
/* Bootstrap offcanvas بيتحكم in the ـ position/transform بsame style —
   لا نضع width:0 أو position:fixed يدوياً Here Because هذا كان يمنع
   الـ offcanvas from the ظهور أصلاً حتى If فُتح بـ data-bs-toggle */

/* If guest — أخفي the sidebar خالص في كل الأحجام */
.page-layout.guest-layout > aside {
  display: none !important;
}

/* Width/Display Sidebar — كل الشاشات (Bootstrap الافتراضي 400px عريض جداً) */
#mainSidebar {
  width: 300px !important;
  max-width: 300px !important;
  /* تغطية كاملة إجبارية — تمنع أي جزء من Page إنه يبين من belowها */
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  z-index: 1055 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* ── Override Bootstrap offcanvas default dark background ── */
#mainSidebar,
#mainSidebar.offcanvas,
.sidebar-offcanvas {
  background-color: var(--white) !important;
  color: var(--text-dark) !important;
  width: 300px;
}
#mainSidebar .offcanvas-header {
  background: var(--green-dark) !important;
  border-bottom: 1px solid rgba(201,162,39,0.3) !important;
}
#mainSidebar .offcanvas-body {
  background: var(--beige) !important;
}
#mainSidebar .offcanvas-body,
#mainSidebar .offcanvas-body * {
  --bs-offcanvas-bg: var(--beige);
}
#sidebar-user,
#sidebar-user.show-user,
.sidebar-nav,
#notifBtnWrap,
.sidebar-footer {
  background: var(--beige) !important;
}
#mainSidebar .sidebar-nav {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
#mainSidebar .sidebar-footer {
  flex-shrink: 0;
}
#mainSidebar > * {
  width: 100%;
}

/* Mobile offcanvas — يملأ الـ panel كاملاً */
@media (max-width: 991px) {
  #installAppBtn span { display: none; }
  #installAppBtn { padding: 6px 8px; }
  .nav-toggle { flex-shrink: 0; order: 99; }
  #mainSidebar {
    width: 82% !important;
    max-width: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;     /* مش 100% — لازم viewport height كامل */
    max-height: 100vh !important;
    overflow: hidden !important;  /* العنصر الأب نفسه مايتسكرولش، الداخلي بس */
  }
  #mainSidebar .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;        /* أهم سطر — يخلي overflow-y:auto يشتغل صح جوه flex */
    overflow-y: auto;
  }
  #mainSidebar .sidebar-actions {
    padding: 12px 16px;
    flex-shrink: 0;        /* يمنعها تتقصّر أو تختفي */
  }
  #mainSidebar .sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    margin-top: 0;
    flex-shrink: 0;        /* زرار تسجيل الخروج هنا — يفضل ظاهر دايماً */
  }
  /* ملاحظة: Button الإغلاق موجود فعلياً داخل .offcanvas-header
     بتنسيق flex طبيعي (ms-auto) — لا حاجة لفرض position يدوياً
     Here، كان هذا يتعارض مع اتجاه فتح Sidebar from the Right */
}

.sidebar-guest-logo {
  text-align: center;
  padding: 20px 14px 14px;
}
.sidebar-logo-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: contain;
  border: 2px solid var(--gold);
  background: #1a4a2e;
  box-shadow: 0 0 0 1px rgba(201,162,39,0.25);
}

.sidebar-brand {
  font-family: Amiri, serif;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
}
.sidebar-sub { color: var(--text-mid); font-size: 11px; margin-top: 2px; }

.sidebar-actions {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.sidebar-login-btn:hover { background: var(--gold-light); }

.sidebar-reg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(201,162,39,0.1);
  border: 1px solid rgba(201,162,39,0.35);
  color: var(--gold);
  border-radius: 8px;
  padding: 10px;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.sidebar-reg-btn:hover { background: rgba(201,162,39,0.18); }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

.sidebar-nav {
  padding: 4px 0;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;   /* تكدّس above، not/don't توزيع بمسافات متساوية */
  gap: 0 !important;
}
.sidebar-nav a {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: #2c1a0e;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: 0.15s;
  border-right: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(138,94,60,0.07); color: var(--green-dark); }
.sidebar-nav a.active {
  background: rgba(201,162,39,0.09);
  color: var(--green-dark);
  border-right-color: var(--gold);
  font-weight: 600;
}
.sidebar-nav a i { font-size: 17px; width: 20px; text-align: center; color: var(--green-mid); }
.sidebar-nav a.active i { color: var(--gold); }

.sidebar-header {
  background: var(--green-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  font-size: 28px;
  width: 44px; height: 44px;
  background: rgba(201,162,39,0.15);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { color: white; font-size: 13px; font-weight: 600; }
.user-role { color: rgba(255,255,255,0.85); font-size: 11px; margin-top: 2px; }

.sidebar-logout-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 9px 12px;
  background: rgba(192,57,43,0.08);
  border: 1px solid rgba(192,57,43,0.22);
  color: #d97070; border-radius: 8px;
  font-family: "Noto Naskh Arabic", serif; font-size: 13px;
  cursor: pointer; transition: background 0.2s;
}
.sidebar-logout-btn:hover { background: rgba(192,57,43,0.18); }

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.sidebar-foot-img {
  width: 32px; height: 32px;
  border-radius: 50%; object-fit: contain;
  border: 1.5px solid var(--gold);
  background: #1a4a2e;
}

.sidebar-footer span {
  color: var(--green-dark);
  font-family: Amiri, serif;
  font-size: 14px;
  font-weight: 700;
}

/* ===== CONTENT AREA ===== */
.content-area {
  width: 100%;
  display: block;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  width: calc(100% - 48px);
  margin: 16px 24px;
  border-radius: 20px;
  overflow: hidden;
  background-color: var(--beige, #f7efe3);
  aspect-ratio: 16 / 7;
  box-shadow: 0 6px 32px rgba(92,61,46,0.13);
  border: 1px solid rgba(201,162,39,0.25);
}

/* Image covers the full hero section */
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* Text on right — overlay is transparent on the left (image visible)
   and increases toward the right (behind text) for readability */
.hero-overlay {
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(247,239,227,0.0)  0%,
    rgba(247,239,227,0.0) 35%,
    rgba(247,239,227,0.65) 58%,
    rgba(247,239,227,0.92) 72%,
    rgba(247,239,227,0.97) 100%
  );
}
.hero-text {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  max-width: 45%;
  width: 45%;
  padding: clamp(16px, 3vw, 50px) clamp(20px, 4vw, 64px);
  text-align: right;
}

.hero-logo-mobile {
  width: 76px; height: 76px;
  border-radius: 50%; object-fit: contain;
  border: 2px solid var(--gold);
  background: #2c1a0e;
  margin-bottom: 14px;
  display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* Logos side by side in hero */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.hero-logos .hero-logo-desktop {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: contain;
  border: 2px solid var(--gold);
  background: #2c1a0e;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.hero-ornament {
  color: var(--gold-light);
  font-size: 16px;
  letter-spacing: 8px;
  margin-bottom: 24px;
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.hero-text h1 {
  font-family: Amiri, serif;
  font-size: clamp(28px, 4vw, 54px);
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(247,239,227,0.9), 0 1px 4px rgba(247,239,227,0.7);
}
.hero-text p {
  color: var(--text-dark);
  font-size: clamp(12px, 1.2vw, 15px);
  margin-bottom: 22px;
  line-height: 1.7;
  text-shadow: 0 1px 6px rgba(247,239,227,0.8);
}
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }

.hero-btn-primary {
  background: var(--green-dark);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.2s;
}
.hero-btn-primary:hover { opacity: 0.88; color: white; }

.hero-btn-secondary {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid var(--border);
  color: var(--green-dark);
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s;
}
.hero-btn-secondary:hover { background: white; }

/* ===== SECTIONS ===== */
.page-section {
  padding: 28px 32px;
}
.bg-white { background: var(--white); }

.section-title {
  font-family: Amiri, serif;
  font-size: 21px;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.section-title::before, .section-title::after {
  content: "✦";
  color: var(--gold);
  font-size: 12px;
}

/* 5-col for xl+ */
.col-xl-2dot4 {
  flex: 0 0 auto;
  width: 20%;
}

/* ===== PATH CARDS ===== */
.path-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.path-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(201,162,39,0.15);
}
.path-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(201,162,39,0.1);
  border: 1px solid rgba(201,162,39,0.3);
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.path-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.path-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 10px;
  flex: 1;
}
.path-btn {
  border: 1px solid var(--green-mid);
  color: var(--green-mid);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11.5px;
  transition: 0.15s;
  width: 100%;
}
.path-btn:hover { background: var(--green-mid); color: white; }

/* ===== DIVIDER ===== */
.islamic-divider {
  text-align: center;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 6px;
  padding: 10px 0;
  opacity: 0.7;
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: var(--green-dark);
  padding: 24px 16px;
}
.stat-item {
  text-align: center;
  padding: 12px 16px;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.stat-item:last-child { border-left: none; }
.stat-num {
  font-family: Amiri, serif;
  font-size: 30px;
  color: var(--gold-light);
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  margin-top: 4px;
}
.stat-icon {
  font-size: 18px;
  margin-bottom: 6px;
  opacity: 0.75;
}

/* On mobile, remove dividers and use grid border-bottom instead */
@media (max-width: 767px) {
  .stat-item { border-left: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 14px; }
  .stat-item:nth-child(3), .stat-item:last-child { border-bottom: none; }
}

/* ===== ANNOUNCEMENTS ===== */
.ann-section { background: var(--beige); }

.ann-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s;
}
.ann-card:hover { box-shadow: 0 4px 14px rgba(92,61,46,0.1); }
.ann-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.ann-card p {
  font-size: 12.5px;
  color: #666;
  line-height: 1.7;
}
.ann-date {
  font-size: 11px;
  color: var(--gold);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.view-all-btn {
  border: 1px solid var(--green-mid);
  color: var(--green-mid);
  padding: 9px 20px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  text-align: center;
  transition: 0.15s;
}
.view-all-btn:hover { background: var(--green-mid); color: white; }

/* ===== CONTACT SECTION ===== */
.contact-section {
  background: var(--beige);
  border-top: 1px solid var(--border);
  padding: 64px 0;
}
.hero-badge {
  display: inline-block;
  background: rgba(201,162,39,0.12);
  color: var(--gold);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}
.contact-header h2 {
  font-family: Amiri, serif;
  font-size: 30px;
  color: var(--green-dark);
  margin: 8px 0;
}
.contact-header p { font-size: 14px; color: var(--text-mid); }

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s;
}
.contact-card:hover { box-shadow: 0 4px 14px rgba(92,61,46,0.09); }
.contact-card-gold {
  border-color: rgba(201,162,39,0.3);
  background: rgba(201,162,39,0.04);
}
.contact-icon {
  width: 44px; height: 44px;
  background: var(--green-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px; flex-shrink: 0;
}
.contact-icon-gold { background: rgba(201,162,39,0.15); }
.contact-icon-gold i { color: var(--gold); }
.contact-label { font-size: 11.5px; color: var(--text-mid); margin-bottom: 3px; }
.contact-val { font-size: 13.5px; color: var(--text-dark); text-decoration: none; font-weight: 600; }
.contact-val-gold { color: var(--gold); font-size: 13.5px; font-weight: 600; text-decoration: none; }

.contact-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.contact-form-title {
  font-family: Amiri, serif;
  font-size: 19px;
  color: var(--green-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.form-label-custom {
  display: block;
  font-size: 12.5px;
  color: var(--text-mid);
  font-weight: 600;
  margin-bottom: 6px;
}
.form-input {
  background: var(--beige);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-dark);
  width: 100%;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--green-mid); background: white; }
.form-textarea { min-height: 110px; resize: vertical; }
.contact-submit {
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.15s;
}
.contact-submit:hover { background: var(--green-mid); transform: translateY(-1px); }
.contact-submit:disabled { opacity: 0.7; cursor: default; transform: none; }
.success-msg {
  background: rgba(45,110,69,0.08);
  border: 1px solid rgba(45,110,69,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #2d6e45;
}

/* ===== AYA BANNER ===== */
.aya-banner {
  background: var(--green-dark);
  text-align: center;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.aya-text {
  font-family: Amiri, serif;
  font-size: 20px;
  color: var(--gold-light);
}
.aya-ref { color: rgba(255,255,255,0.55); font-size: 12px; }

/* ===== FOOTER ===== */
footer {
  background: var(--green-dark);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(201,162,39,0.2);
}
.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-logo span {
  color: rgba(255,255,255,0.8);
  font-family: Amiri, serif;
  font-size: 15px;
}
.footer-dua {
  color: rgba(255,255,255,0.72);
  font-size: 12.5px;
  flex: 1;
  text-align: center;
}
.footer-dua::before, .footer-dua::after { content: "✦"; color: var(--gold); margin: 0 6px; font-size: 10px; }
.footer-social { display: flex; gap: 14px; }
.footer-social a { color: rgba(255,255,255,0.6); font-size: 18px; text-decoration: none; transition: color 0.2s; }
.footer-social a:hover { color: var(--gold-light); }

/* ===== MODAL ===== */
.reg-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.reg-modal-overlay.open { display: flex; }
.reg-modal-box {
  background: var(--white);
  border-radius: 18px;
  padding: 32px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.reg-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.reg-modal-header h2 {
  font-family: Amiri, serif;
  font-size: 22px;
  color: var(--green-dark);
  margin: 0 0 4px;
}
.reg-modal-header p { font-size: 13px; color: var(--text-mid); margin: 0; }
.reg-close {
  background: var(--beige);
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-mid);
  flex-shrink: 0;
}
.reg-close:hover { background: #fde8e8; color: #c0392b; }

/* ===== RESPONSIVE — FLUID DESIGN ===== */

/* Typography — fluid at all sizes */
.hero-text h1 {
  font-size: clamp(22px, 4vw, 56px);
}
.hero-text p {
  font-size: clamp(12px, 1.4vw, 16px);
}
.section-title {
  font-size: clamp(16px, 2vw, 22px);
}

/* Sections — fluid padding */
.page-section {
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 40px);
}


/* Grid columns — removed incorrect clamp() rule
   (was min=50% and max=20%, a mathematical contradiction that broke layout)
   Base .col-xl-2dot4 defined above + media queries below */

/* Tablet (768–1199px) */
@media (max-width: 1199px) {
  .col-xl-2dot4 { width: 33.333%; }
}

/* Small tablet (≤ 991px) */
@media (max-width: 991px) {
  .page-layout { flex-direction: column; }
  .content-area { width: 100% !important; }
  .col-xl-2dot4 { width: 33.333%; }
  footer { padding: 14px 20px; }
  .hero-text { max-width: 420px; }
}

/* Laptop (768px — 1440px) */
/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero { aspect-ratio: 2 / 1; width: calc(100% - 32px); margin: 12px 16px; }
}

/* Laptop (1024px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
  .hero { aspect-ratio: 16 / 7; }
}

/* Large screens (> 1440px) */
@media (min-width: 1441px) {
  .hero { aspect-ratio: 16 / 7; }
}

/* Mobile (≤ 767px) */
@media (max-width: 767px) {
  .hero { justify-content: center; aspect-ratio: 3/2; width: calc(100% - 24px); margin: 10px 12px; border-radius: 14px; }
  .hero-text {
    position: absolute;
    right: 50%;
    transform: translate(50%, -50%);
    max-width: 90%;
    width: 90%;
    text-align: center;
    padding: clamp(20px, 6vw, 40px) 16px;
    top: 50%;
  }
  .hero-text h1 { text-shadow: 0 1px 8px rgba(255,255,255,0.9); }
  .hero-text p  { text-shadow: 0 1px 4px rgba(255,255,255,0.9); }
  .hero-overlay { background: rgba(247,239,227,0.55); }
  .hero-logos { justify-content: center; }
  .hero-btns { justify-content: center; }
  .hero-btn-primary, .hero-btn-secondary { padding: 9px 18px; font-size: 13px; }
  .col-xl-2dot4 { width: 50%; }
  .stats-bar { padding: 16px 12px; }
  .contact-section { padding: 40px 0; }
  .contact-form-wrap { padding: 20px; }
  .reg-modal-box { padding: 22px; }
  .reg-modal-header { flex-wrap: wrap; gap: 10px; }
  footer {
    padding: 14px 16px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .footer-dua { flex: none; }
  .footer-social { justify-content: center; }

  /* Mobile: hide program name, show logo clearly instead ofاً from the Text — يبقى جنب شعار متين only                       */
  .nav-logo .nav-brand,
  .nav-logo .nav-tagline {
    display: none;
  }
  .logo-circle-shuraka {
    width: 52px;
    height: 52px;
  }
}

/* Very small (≤ 420px) */
@media (max-width: 420px) {
  .col-xl-2dot4 { width: 50%; }
  .nav-brand { font-size: 13px; }
}


/* ════════════════════════════════════════════════════════════
   عناصر كانت inline styles في home.html
   ════════════════════════════════════════════════════════════ */

.nav-msg-badge-orange { background: #e65100; }

.sidebar-user-hidden {
  display: none;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}
#sidebar-user.show-user {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;   /* ياخد المساحة المتاحة بس، مش 100% من الأب بالكامل */
  min-height: 0;
  overflow: hidden !important;
}
#sidebar-user.show-user .sidebar-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;   /* أهم سطر — يسمح للـ overflow-y يشتغل صح جوه flex container */
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
#sidebar-user.show-user > .px-3.pb-3 {
  flex-shrink: 0 !important;
  margin-top: 0 !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--border) !important;
}

.sidebar-offcanvas .offcanvas-body {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
}

.form-input-readonly {
  background: #f5f5f5;
  cursor: not-allowed;
}

.footer-logo-img-dark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  border: 1.5px solid var(--gold);
  background: #1a4a2e;
}

.hero-badge-inline {
  display: inline-block;
  margin-bottom: 6px;
}

/* ── شعار Khayr Partners في شريط Basmala ─────────────────────── */
.basmala-bar { position: relative; }
@media (max-width: 480px) {
  
}






@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ══ إصلاح: منع d-none يتأثر بـ display:flex !important ══ */
.sidebar-nav a.d-none { display: none !important; }



/* الIfجو قابل للضغط للتثبيت */
.nav-logo:hover .logo-circle {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.3);
  transform: scale(1.05);
  transition: all 0.2s;
}
.logo-circle { transition: all 0.2s; }

/* ===== HERO ANIMATIONS ===== */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes heroScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-anim-logo   { opacity:0; animation: heroScaleIn 0.7s cubic-bezier(.22,.68,0,1.2) 0.1s forwards; }
.hero-anim-name   { opacity:0; animation: heroFadeUp  0.6s ease 0.35s forwards; }
.hero-anim-orn    { opacity:0; animation: heroFadeIn  0.5s ease 0.55s forwards; }
.hero-anim-h1     { opacity:0; animation: heroFadeUp  0.7s cubic-bezier(.22,.68,0,1.1) 0.7s forwards; }
.hero-anim-p      { opacity:0; animation: heroFadeUp  0.6s ease 0.95s forwards; }
.hero-anim-btns   { opacity:0; animation: heroFadeUp  0.6s ease 1.15s forwards; }


/* تأكد إن زرار القائمة دايماً ظاهر على الموبايل */
@media (max-width: 991px) {
  .nav-inner {
    flex-wrap: nowrap;
    overflow: visible;
  }
  .nav-toggle {
    min-width: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* على الموبايل: اسم البرنامج يختفي لتوفير مساحة */
@media (max-width: 575px) {
  .nav-logo .nav-brand,
  .nav-logo .nav-tagline {
    display: none;
  }

  /* قلل المسافات والـ padding بين كل أزرار الناف بار */
  .nav-inner {
    gap: 4px !important;
    padding: 0 8px !important;
  }
  .nav-user-actions {
    gap: 4px !important;
  }
  #installAppBtn,
  .sidebar-fab,
  button[onclick="startPageTour()"],
  .nav-msg-btn,
  .nav-logout-btn {
    padding: 5px 6px !important;
    font-size: 14px !important;
    min-width: unset !important;
  }
  .nav-profile-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
  }
  .logo-circle {
    width: 32px !important;
    height: 32px !important;
  }
  .nav-toggle {
    padding: 2px !important;
    font-size: 20px !important;
  }
}

/* Timeline للمواعيد المهمة */
.timeline { display: flex; flex-direction: column; gap: 16px; }
.tl-item { display: flex; align-items: flex-start; gap: 10px; }
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-mid);
  flex-shrink: 0;
  margin-top: 5px;
}
.tl-dot.gold { background: var(--gold); }
.tl-label { font-size: 13px; color: var(--text-dark); font-weight: 600; }
.tl-date  { font-size: 11.5px; color: var(--text-mid); margin-top: 2px; }
