﻿/*
===========================================
 Theme Name: Maarifa Theme — Unified CSS
 Author: Youness Jalal
 Description: Unified CSS for Navbar, Footer, Cards, Articles, and Events Page
 Version: 1.0
 Text Domain: maarifa
===========================================
*/

/* ===========================================
   1) Navbar
=========================================== */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Cairo", sans-serif;
}

body > .site-footer {
  margin-top: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body.home {
  background-color: #f7faf8;
  overflow-x: clip;
}

.home-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nav-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.3rem;
}

/* Header nav separators مثل الفوتر */
.navbar-nav.nav-center > li {
  position: relative;
}

.navbar-nav.nav-center > li + li::before {
  content: "|";
  color: #6c757d;
  position: absolute;
  right: -0.7rem;
  top: 50%;
  transform: translateY(-50%);
  user-select: none;
  pointer-events: none;
}

.navbar-nav > li > a {
  font-weight: 600;
  color: #333 !important;
  transition: 0.3s;
  white-space: nowrap;
}

.navbar-nav > li > a:hover {
  color: #166b43 !important;
}

.current-menu-item > a {
  color: #166b43 !important;
  border-bottom: 3px solid #166b43;
  padding-bottom: 3px;
}

.account-btn {
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 50px;
  transition: 0.3s;
}

.account-btn:hover {
  background: #f8f9fa;
}

/* RTL Dropdown */
.dropdown-menu {
  text-align: right;
}

.dropdown-menu-start {
  right: 0;
  left: auto;
}

/* ===========================================
   2) Footer
=========================================== */
footer,
footer a,
footer .text-muted {
  color: #352e2e !important;
  text-decoration: none;
}

footer .divider {
  margin: 0 8px;
  user-select: none;
}

.site-footer .social-icons {
  display: flex;
  gap: 18px;
}

.site-footer .social-icons a {
  font-size: 1.2rem;
  color: #333 !important;
  transition: 0.3s;
}

.site-footer .social-icons a:hover {
  color: var(--primary-color, #166b43) !important;
}

@media (max-width: 767px) {
  .site-footer {
    padding-top: 1rem !important;
    padding-bottom: 0.75rem !important;
  }

  footer .d-flex {
    flex-direction: column !important;
    gap: 0.5rem;
  }
  footer .divider {
    display: none;
  }
}

/* ===========================================
   3) General Cards
=========================================== */
.section-page-title {
  font-family: "Cairo", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  color: #1f2937;
}

.user-empty-state {
  font-family: "Cairo", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  font-style: normal;
  line-height: 1.8;
}

@media (max-width: 767px) {
  .section-page-title {
    font-size: 1.55rem;
  }
}

.adsense-slot {
  width: 100%;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}

.adsense-slot .ad-note {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
}

.adsense-slot--leaderboard { min-height: 96px; }
.adsense-slot--infeed { min-height: 120px; }
.adsense-slot--rectangle { min-height: 250px; }

.card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  transition: 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.card-img-top {
  height: 200px;
  width: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.card-img-top:hover {
  transform: scale(1.05);
}

.card-body h5 a {
  color: #333 !important;
  text-decoration: none;
  transition: 0.3s;
}

.card-body h5 a:hover {
  color: #166b43 !important;
}

.card-body p.text-muted {
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.92rem;
  color: #6c757d;
  line-height: 1.6;
}

.card-body .btn-primary {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  transition: 0.3s;
}

.card-body .btn-primary:hover {
  background-color: #166b43;
  transform: translateY(-2px);
}

.scientific-releases-page .release-filters-card,
.scientific-releases-archive-page .release-filters-card,
.events-page .shared-filters-card,
.events-archive-page .shared-filters-card,
.opportunities-page .shared-filters-card,
.opportunities-archive-page .shared-filters-card,
#my-events-filters,
#my-opportunities-filters {
  background: #fff;
  border: 1px solid #e6efe9 !important;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.06);
}

.scientific-releases-page .release-filters-card .form-select,
.scientific-releases-page .release-filters-card .form-control,
.scientific-releases-archive-page .release-filters-card .form-select,
.scientific-releases-archive-page .release-filters-card .form-control,
.events-page .shared-filters-card .form-select,
.events-page .shared-filters-card .form-control,
.events-archive-page .shared-filters-card .form-select,
.events-archive-page .shared-filters-card .form-control,
.opportunities-page .shared-filters-card .form-select,
.opportunities-page .shared-filters-card .form-control,
.opportunities-archive-page .shared-filters-card .form-select,
.opportunities-archive-page .shared-filters-card .form-control,
#my-events-filters .form-select,
#my-events-filters .form-control,
#my-opportunities-filters .form-select,
#my-opportunities-filters .form-control {
  min-height: 48px;
  border-radius: 14px !important;
  border: 1px solid #dbe6df;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.05);
  font-weight: 600;
}

.scientific-releases-page .release-filters-card .form-select:focus,
.scientific-releases-page .release-filters-card .form-control:focus,
.scientific-releases-archive-page .release-filters-card .form-select:focus,
.scientific-releases-archive-page .release-filters-card .form-control:focus,
.events-page .shared-filters-card .form-select:focus,
.events-page .shared-filters-card .form-control:focus,
.events-archive-page .shared-filters-card .form-select:focus,
.events-archive-page .shared-filters-card .form-control:focus,
.opportunities-page .shared-filters-card .form-select:focus,
.opportunities-page .shared-filters-card .form-control:focus,
.opportunities-archive-page .shared-filters-card .form-select:focus,
.opportunities-archive-page .shared-filters-card .form-control:focus,
#my-events-filters .form-select:focus,
#my-events-filters .form-control:focus,
#my-opportunities-filters .form-select:focus,
#my-opportunities-filters .form-control:focus {
  border-color: #9fcfb6;
  box-shadow: 0 0 0 0.2rem rgba(22, 107, 67, 0.12), 0 8px 20px rgba(22, 107, 67, 0.1);
}

.scientific-releases-page .release-filters-card .form-control,
.scientific-releases-archive-page .release-filters-card .form-control,
.events-page .shared-filters-card .form-control,
.events-archive-page .shared-filters-card .form-control,
.opportunities-page .shared-filters-card .form-control,
.opportunities-archive-page .shared-filters-card .form-control,
#my-events-filters .form-control,
#my-opportunities-filters .form-control {
  text-align: center;
}

@media (max-width: 767px) {
  .card-img-top {
    height: 180px;
  }
}

/* ===========================================

   Home Modern (index.php)
   ========================================= */
.home-modern {
  background: #f8fafb;
}
.home-modern .section-heading {
  text-align: center;
  margin-bottom: 32px;
}
.home-modern .section-heading h2 {
  font-weight: 800;
  font-size: clamp(1.4rem, 2vw, 2rem);
  color: #0f172a;
}
.home-modern .section-heading p {
  color: #475569;
  margin: 8px auto 0;
  max-width: 720px;
}

/* Hero */
.home-hero-modern {
  padding: 64px 0 40px;
  background: #ffffff;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  background: #e8f3ee;
  color: #166b43;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 12px;
}
.hero-desc {
  color: #475569;
  font-size: 1rem;
  margin-bottom: 20px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  background: #f8fafb;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: 14px;
}
.stat-title {
  font-weight: 700;
  color: #0f172a;
  display: block;
}
.stat-sub {
  color: #64748b;
  font-size: 0.9rem;
}
.hero-image-wrap {
  background: #ffffff;
  border-radius: 22px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.hero-image-wrap img {
  width: 100%;
  border-radius: 16px;
  display: block;
  object-fit: cover;
}

/* Trust Bar */
.home-trust-bar {
  background: #f1f5f9;
  padding: 20px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
  color: #334155;
  font-weight: 600;
}
.trust-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
}

/* Sections */
.home-sections-modern {
  padding: 60px 0;
}
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.section-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}
.section-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.section-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-card p {
  color: #64748b;
  margin-bottom: 12px;
}
.section-link {
  color: #166b43;
  font-weight: 700;
}

/* Latest sections */
.home-latest {
  padding: 60px 0;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.modern-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modern-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.modern-card p {
  color: #64748b;
  margin: 0;
}
.card-tag {
  align-self: flex-start;
  background: #eef6f1;
  color: #166b43;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.card-link {
  color: #166b43;
  font-weight: 700;
  margin-top: auto;
}

/* Community cards */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.community-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}
.community-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.community-card p {
  color: #64748b;
}
.community-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: #64748b;
  font-size: 0.9rem;
}
.community-meta a {
  color: #166b43;
  font-weight: 700;
}

/* App section */
.home-app {
  padding: 60px 0;
}
.app-card {
  background: #0f172a;
  color: #ffffff;
  border-radius: 22px;
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.app-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.app-card p {
  color: #cbd5f5;
  margin: 0;
}
.app-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.store-badge img {
  height: 46px;
  width: auto;
  display: block;
}

/* Final CTA */
.home-cta {
  padding: 50px 0 70px;
}
.cta-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 32px;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}
.cta-card h2 {
  font-weight: 800;
  margin-bottom: 10px;
}
.cta-card p {
  color: #64748b;
  margin-bottom: 18px;
}

@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .sections-grid,
  .cards-grid,
  .community-grid,
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .sections-grid,
  .cards-grid,
  .community-grid,
  .trust-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .home-hero-modern {
    padding-top: 44px;
  }
  .app-card {
    padding: 24px;
  }
}

/* App download CTA (home only) */
.app-download-home {
  text-align: center;
}
.app-download-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}
.app-download-desc {
  color: #475569;
  margin-bottom: 20px;
}
.app-download-badges {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.app-badge img {
  height: 44px;
  display: block;
}


#toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  width: auto;
  max-width: 90%;
  pointer-events: none;
}

#toast-container .toast {
  pointer-events: auto;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  font-weight: 600;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===============================
   اللون الأساسي للموقع
   =============================== */

/* النصوص والروابط */
a,
.text-primary {
    color: var(--primary-color) !important;
}

/* الأزرار */
.btn-primary,
button.primary,
input[type="submit"] {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* hover للأزرار */
.btn-primary:hover,
button.primary:hover {
    opacity: 0.9;
}

/* القائمة (الـ Navbar) */
.navbar,
.main-navbar {
    border-bottom: 2px solid var(--primary-color);
}

.navbar a:hover,
.navbar .active {
    color: var(--primary-color) !important;
}

/* العناوين */
h1 span,
h2 span,
.section-title {
    color: var(--primary-color);
}

/* عدد الردود / العدادات */
.badge-primary,
.counter {
    background-color: var(--primary-color) !important;
    color: #fff;
}

/* أي خلفية عامة */
.bg-primary {
    background-color: var(--primary-color) !important;
}

/*:root {
  --secondary-color: #f39c12;
}


/* ===============================
   إزالة underline من قائمة الهيدر
   =============================== */

.navbar-nav a,
.navbar-nav .nav-link {
    text-decoration: none !important;
}

/* إزالة أي border سفلي */
.navbar-nav a,
.navbar-nav .nav-link,
.navbar-nav li {
    border-bottom: none !important;
}

/* إزالة أي ::after عامة */
.navbar-nav a::after,
.navbar-nav .nav-link::after {
    display: none !important;
    content: none !important;
}


/* ===============================
   تغيير Hover + Active في قائمة الهيدر
   =============================== */

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:active,
.navbar-nav .nav-link:visited {
    color: var(--primary-color) !important;
    background: transparent !important;
}

.navbar-nav .nav-link:active,
.navbar-nav .nav-link:focus {
    background-color: transparent !important;
}


/* ===============================
   تكبير حجم نص قائمة الهيدر
   =============================== */

.navbar-nav .nav-link {
    font-size: 1.15rem;
    font-weight: 600;
}


/* ===============================
   إعادة خط تحت القسم المختار في الهيدر
   =============================== */

.navbar-nav .current-menu-item > a {
    position: relative;
    color: var(--primary-color) !important;
}

.navbar-nav .current-menu-item > a::after {
    display: block !important;
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

/* دعم كل حالات العنصر النشط في ووردبريس */
.navbar-nav .current_page_item > a,
.navbar-nav .current-menu-ancestor > a,
.navbar-nav .current_page_parent > a {
    position: relative;
    color: var(--primary-color) !important;
}

.navbar-nav .current_page_item > a::after,
.navbar-nav .current-menu-ancestor > a::after,
.navbar-nav .current_page_parent > a::after {
    display: block !important;
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.btn {
    font-weight: 600;
}

.dropdown-menu .dropdown-item {
    font-weight: 600; 
}


/* زر تسجيل الدخول */
.open-auth {
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    background-color: transparent !important;
}

/* Hover */
.open-auth:hover,
.open-auth:focus {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}


/* زر إنشاء حساب */
.navbar .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Hover زر إنشاء حساب */
.navbar .btn-primary:hover,
.navbar .btn-primary:focus {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    opacity: 0.95;
}



/* ===============================
   Navbar Mobile Layout (≤ 991px)
   =============================== */
@media (max-width: 991px) {

  /* زر القائمة: بدون إطار سميك */
  .navbar-toggler {
      border: 0 !important;
      box-shadow: none !important;
      padding: .25rem .5rem;
  }
  .navbar-toggler:focus,
  .navbar-toggler:active {
      box-shadow: none !important;
      outline: none !important;
  }

  /* فاصل تحت الشعار */
  .navbar-collapse {
      margin-top: 8px;
      padding-top: 6px;
      border-top: 1px solid rgba(0,0,0,0.06);
  }

  /* القائمة */
  .navbar-collapse .navbar-nav {
      padding-bottom: 4px;
      margin-bottom: 4px;
      border-bottom: 1px solid rgba(0,0,0,0.08);
      text-align: center;
  }

  /* عناصر القائمة */
  .navbar-nav .nav-link {
      font-size: 0.96rem;
      padding: 3px 0;
  }

  /* حاوية زر الحساب */
  .navbar-collapse > .d-flex {
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
      width: 100%;
      margin-top: 6px;
  }

  /* زر الحساب نفسه */
  .account-btn {
      margin-inline: auto !important;
      text-align: center;
  }

  /* اجعل جرس الإشعارات بجانب أيقونة المستخدم في الهاتف */
  body.logged-in .navbar-actions {
      flex-direction: row !important;
      justify-content: center !important;
      gap: 8px !important;
  }

  /* منع اقتطاع قائمة الإشعارات في الهاتف */
  .navbar,
  .navbar .container {
      overflow: visible !important;
  }

  .navbar-collapse {
      overflow: hidden !important;
  }

.notifications-dropdown {
  margin-inline-start: 12px;
}


  .notifications-dropdown .dropdown-menu {
      top: 100%;
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      margin-top: 6px;
  }
}

/* ===============================
   Navbar Desktop Centering (>= 992px)
   =============================== */
@media (min-width: 992px) {
  .navbar .navbar-brand {
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
  }

  .navbar-collapse {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    flex: 1 1 auto;
  }

  .navbar-nav.nav-center {
    flex: 1 1 auto;
    justify-content: center;
    margin: 0 auto;
  }

  .navbar-actions {
    flex: 0 0 auto;
    margin: 0;
    margin-inline-start: auto;
    margin-inline-end: 8px;
  }
}

/* تغيير لون hover لزر إنشاء حساب */
.btn-primary:hover,
.btn-primary:focus {
    background-color: #24e082;   /* اختر اللون الذي تريد */
    border-color: #24e082;
}


/* توحيد حجم أزرار الدخول */
.navbar .btn {
    padding: 8px 18px;
    min-height: 40px;
    font-size: 0.95rem;
}

.auth-btn {
    min-width: 128px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
    transition: all .2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.auth-btn.btn-outline-primary {
    background: #fff;
    border-width: 2px;
}

.auth-btn.btn-outline-primary:hover,
.auth-btn.btn-outline-primary:focus {
    background: #f3f9f5;
    border-color: #1f7a51;
    color: #1f7a51;
    transform: translateY(-1px);
}


/* ====== NAVBAR PROFESSIONAL ====== */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    min-height: 72px;
    position: relative;
    z-index: 1200;
    transition: all 0.3s ease;
}

/* عند السكروول */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* ====== LOGO ====== */
.navbar-brand img {
    max-height: 44px;
}

.navbar-brand {
    font-weight: bold;
    font-size: 20px;
}

/* ====== NAV LINKS ====== */
.navbar-nav .nav-link {
    font-weight: 500;
    color: #333 !important;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background: #f5f7fa;
    color: #166b43 !important;
}

/* ====== ACTIONS (BUTTONS AREA) ====== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

body:not(.logged-in) .navbar-actions {
    margin-inline-start: 18px;
}

/* زر تسجيل الدخول و إنشاء الحساب */
.auth-btn {
    height: 40px;
    display: flex;
    align-items: center;
    border-radius: 10px !important;
    transition: all 0.2s ease;
}

/* outline button */
.btn-outline-primary {
    border: 1.5px solid #166b43;
    color: #166b43;
}

.btn-outline-primary:hover {
    background: #166b43;
    color: #fff;
}

/* primary button */
.btn-primary {
    background: #166b43;
    border: none;
}

.btn-primary:hover {
    background: #125c38;
    transform: translateY(-1px);
}

/* ====== NOTIFICATIONS ====== */
.notifications-bell-btn {
    border-radius: 10px;
    transition: all 0.2s ease;
}

.notifications-bell-btn:hover {
  background: #f5f7fa;
}

.resend-activation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 12px;
  font-weight: 700;
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #fff;
}

.resend-activation-btn .resend-activation-icon {
  color: var(--primary-color);
  font-size: 1.05em;
  line-height: 1;
}

.resend-activation-btn:hover,
.resend-activation-btn:focus,
.resend-activation-btn:active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.resend-activation-btn:hover .resend-activation-icon,
.resend-activation-btn:focus .resend-activation-icon,
.resend-activation-btn:active .resend-activation-icon {
  color: #fff;
}

/* ====== ACCOUNT BUTTON ====== */
.account-btn {
    border-radius: 12px;
    padding: 5px 10px;
    transition: all 0.2s ease;
}

.account-btn:hover {
    background: #f5f7fa;
}

/* ====== AVATAR SEPARATOR ====== */
.avatar-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 6px;
}

/* ====== ALIGN FIX ====== */
.navbar .container {
    align-items: center;
}

/* ====== MOBILE ====== */
@media (max-width: 991px) {

    .navbar-collapse {
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .navbar-collapse .navbar-nav.nav-center {
        width: 100%;
        margin: 0;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .navbar-collapse .navbar-nav.nav-center > li {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .navbar-collapse .navbar-nav.nav-center > li > a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .navbar-actions {
        flex-direction: column;
        width: 100%;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .navbar-collapse .navbar-nav .nav-link {
        padding: 5px 10px;
    }

    body:not(.logged-in) .navbar-actions {
        margin-top: 10px;
    }

    .auth-btn {
        width: 100%;
        justify-content: center;
    }

    body:not(.logged-in) .auth-btn {
        width: min(82%, 220px);
        margin-inline: auto;
    }

    .navbar-actions .dropdown,
    .navbar-actions .notifications-dropdown,
    .navbar-actions .account-btn {
        width: 100%;
        justify-content: center;
    }
}

.btn:focus,
.btn:active {
    box-shadow: none !important;
}

.specialties-icon,
.bi-columns-gap {
    color: #166b43; /* لون أيقونة عمود التخصصات */
}

.section-title {
    border-bottom: 2px solid #198754;
}

/* Notifications Bell */
.notifications-bell-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid #e9ecef;
    color: #166b43 !important;
}

.notifications-bell-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.notifications-bell-glyph {
    font-size: 18px;
    line-height: 1;
    color: currentColor;
}

.notifications-bell-btn:hover,
.notifications-bell-btn:focus,
.notifications-bell-btn:active {
    color: #125437 !important;
    border-color: #166b43 !important;
    background: #f3fbf7 !important;
    box-shadow: none !important;
}

.notifications-unread-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    font-size: 11px;
}

.notifications-menu {
    width: min(92vw, 360px);
    max-height: 70vh;
    overflow: hidden;
}

.notifications-menu-header {
    gap: 8px;
}

.notifications-menu-header strong {
    font-size: 14px;
    font-weight: 800;
    color: #1f2937;
}

.notifications-menu-header a {
    font-size: 12px;
    font-weight: 700;
    color: #166b43 !important;
}

.notifications-list {
    max-height: calc(70vh - 56px);
    overflow-y: auto;
}

.notification-empty {
    padding: 12px;
}

.notification-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    color: #222;
    font-weight: 600;
}

.notification-item:hover {
    background: #f8f9fa;
    color: #111;
}

.notification-item.unread {
    background: #eef5ff;
}

.notification-item-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.notification-item-message {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 2px;
}

.notification-item-time {
    font-size: 11px;
    color: #6c757d;
}

@media (max-width: 991px) {
  .navbar-nav.nav-center > li + li::before {
    content: none;
  }

  .navbar-collapse {
    overflow: hidden;
  }

  #mainNavbar.show,
  #mainNavbar.show .navbar-actions,
  #mainNavbar.show .dropdown,
  #mainNavbar.show .dropdown-menu {
    overflow: visible;
  }

  .notifications-dropdown {
    position: relative;
  }

  .notifications-dropdown .dropdown-menu.notifications-menu {
    position: fixed;
    top: calc(72px + 1rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    margin-top: 0;
    z-index: 1080;
    width: min(94vw, 360px);
    max-height: min(70vh, calc(100vh - 96px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .account-dropdown {
    position: relative;
  }

  .account-dropdown .dropdown-menu {
    position: fixed;
    top: calc(72px + 1rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(94vw, 320px);
    max-height: min(70vh, calc(100vh - 96px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}


/* Global notice banner */
.global-notice-bar {
  width: 100%;
  padding: 12px 0;
  border-bottom: 0;
  font-size: 0.95rem;
  background: transparent;
}
.global-notice-bar .container {
  width: fit-content;
  max-width: min(92vw, 920px);
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
}
.global-notice-bar .global-notice-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.global-notice-bar .global-notice-title {
  font-weight: 700;
  display: block;
  width: auto;
  text-align: center;
}
.global-notice-bar .global-notice-link {
  margin-inline-start: 0;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}
.global-notice--warning .container {
  background: #fff3cd;
  color: #664d03;
}
.global-notice--warning .global-notice-link {
  color: #664d03;
}
.global-notice--info .container {
  background: #e7f1ff;
  color: #0b5ed7;
}
.global-notice--info .global-notice-link {
  color: #0b5ed7;
}
.global-notice--success .container {
  background: #e9f7ef;
  color: #14532d;
}
.global-notice--success .global-notice-link {
  color: #14532d;
}
@media (max-width: 767px) {
  .global-notice-bar .global-notice-link {
    margin-inline-start: 0;
  }
}

/* Modal header alignment for RTL: keep close button at opposite edge */
.maarifa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html[dir="rtl"] .maarifa-modal-header .modal-title {
  margin: 0;
}

html[dir="rtl"] .maarifa-modal-header .btn-close {
  margin: 0 !important;
  margin-inline-start: auto !important;
}

/* Ensure modals appear فوق الهيدر وتسمح بالتمرير داخل المحتوى */
.modal {
  z-index: 2000;
}
.modal-backdrop {
  z-index: 1990;
}
.modal-dialog-scrollable .modal-body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}


/* Main header section indicator (active page) */
.navbar .nav-center > li > a {
  position: relative;
  display: inline-block;
  padding-bottom: 0.45rem;
}

.navbar .nav-center > li > a::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -4px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-color);
  opacity: 0;
  transform: scaleX(0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar .nav-center > li.current-menu-item > a,
.navbar .nav-center > li.current_page_item > a,
.navbar .nav-center > li.current-menu-ancestor > a,
.navbar .nav-center > li.current_page_parent > a {
  color: var(--primary-color) !important;
}

.navbar .nav-center > li.current-menu-item > a::after,
.navbar .nav-center > li.current_page_item > a::after,
.navbar .nav-center > li.current-menu-ancestor > a::after,
.navbar .nav-center > li.current_page_parent > a::after {
  opacity: 1;
  transform: scaleX(1);
}


/* Register title condensed style */
.register-title-condensed {
  font-stretch: condensed;
  letter-spacing: -0.3px;
  display: inline-block;
  transform: scaleX(0.95);
  transform-origin: center;
}

/* Verification badge */
.maarifa-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f5ef;
  color: #166b43;
  border: 1px solid #bfe6d1;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.maarifa-verified-icon {
  font-size: 0.8rem;
  line-height: 1;
}
.maarifa-verified-text {
  font-size: 0.72rem;
}

@media (max-width: 576px) {
  .maarifa-verified-badge {
    padding: 2px 6px;
  }
  .maarifa-verified-text {
    font-size: 0.68rem;
  }
}


.release-card .btn {
  border-radius: 999px;
}

.release-card .social-share .btn-outline-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.social-share-menu {
  z-index: 1055;
}

/* Unified social share dropdown */
.social-share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.social-share-menu {
  min-width: 200px;
}
.social-share-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.social-share-menu .dropdown-item i {
  font-size: 1rem;
}
.social-share-menu .bi-whatsapp { color: #25D366; }
.social-share-menu .bi-facebook { color: #1877F2; }
.social-share-menu .bi-twitter-x { color: #111111; }
.social-share-menu .bi-linkedin { color: #0A66C2; }
.social-share-menu .bi-telegram { color: #229ED9; }

/* =========================
   Home layout (static)
========================= */
.home-hero {
  padding: 18px 0 8px;
  position: relative;
  z-index: 2;
}

.home-hero-media {
  margin-bottom: 14px;
}

.home-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #eef2f7;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  padding: 22px 20px;
  min-width: 0;
}

.home-hero-image {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  max-width: 100%;
}

.home-hero-image img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.home-hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(22,107,67,0.08), rgba(0,0,0,0));
  pointer-events: none;
}

.home-hero-content {
  max-width: 720px;
  min-width: 0;
}

.home-hero-content h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 10px;
  color: #0f172a;
}

.home-hero-content p {
  color: #1f2937;
  margin-bottom: 16px;
}

.home-hero-content .btn {
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transition: all .2s ease;
}

.home-hero-content .home-hero-join-btn {
  background-color: #2f8f5b !important;
  border-color: #2f8f5b !important;
  color: #ffffff !important;
}

.home-hero-content .home-hero-join-btn:hover,
.home-hero-content .home-hero-join-btn:focus {
  background-color: #287d50 !important;
  border-color: #287d50 !important;
  color: #ffffff !important;
}

.home-hero-content .btn:hover {
  transform: translateY(-1px);
}

/* Prevent homepage images from forcing horizontal overflow on mobile */
body.home img {
  max-width: 100%;
  height: auto;
}

.home-sections-strip {
  padding: 12px 0 10px;
}

.sections-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.section-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #eef2f7;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transition: all .2s ease;
  text-align: center;
  align-items: center;
}

.section-chip-title {
  font-weight: 800;
  color: #0f172a;
}

.section-chip-desc {
  font-size: 0.92rem;
  color: #1f2937;
}

.section-chip:hover {
  transform: translateY(-2px);
  border-color: #d6dde6;
}

.section-chip-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Why Bahithoun section */
.home-why {
  padding: 36px 0 10px;
  position: relative;
  z-index: 1;
}

.home-why-header {
  text-align: center;
  margin-bottom: 18px;
}

.home-why-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #000;
}

.home-why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

@media (min-width: 993px) {
  .home-why-grid > .why-card:last-child {
    grid-column: 2;
  }
}

.why-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon title"
    "text text";
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
  padding: 18px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #eef2f7;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  color: inherit;
  text-decoration: none;
  transition: all .2s ease;
  min-width: 0;
}

.why-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.why-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(22, 107, 67, 0.12);
  color: var(--primary-color);
  font-size: 1.25rem;
}

.why-icon--community {
  position: relative;
  background: rgba(22, 107, 67, 0.12);
}

.why-icon--community .why-icon__bubble {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--primary-color) !important;
  opacity: 0.98;
  filter: none;
}

.why-icon--community .why-icon__dots {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -20%);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--primary-color) !important;
  filter: none;
}

.why-card h3 {
  grid-area: title;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary-color);
  margin: 0;
  text-align: center;
}

.why-card p {
  grid-area: text;
  color: #1f2937;
  margin: 0;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 992px) {
  .home-hero-content {
    text-align: center;
  }
  .home-hero {
    padding-bottom: 18px;
  }
  .home-why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .home-hero {
    padding-bottom: 24px;
  }

  .home-hero-image img {
    max-height: 300px;
  }

  .home-hero-card {
    margin-bottom: 10px;
  }

  .home-why {
    margin-top: 8px;
    padding-top: 22px;
  }

  .home-why-grid {
    grid-template-columns: 1fr;
  }

  .why-card {
    align-items: center;
    text-align: center;
  }
}
.social-share-menu .dropdown-item i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}
.social-share-menu .bi-whatsapp { color: #25D366; }
.social-share-menu .bi-facebook { color: #1877F2; }
.social-share-menu .bi-twitter-x { color: #111111; }
.social-share-menu .bi-linkedin { color: #0A66C2; }

.cookie-consent-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, 94%);
  background: #ffffff;
  border: 1px solid rgba(22, 107, 67, 0.18);
  box-shadow: 0 14px 32px rgba(0,0,0,0.12);
  border-radius: 16px;
  padding: 18px 20px;
  z-index: 9999;
}
.cookie-consent-inner {
  display: flex;
  gap: 16px 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cookie-consent-text {
  width: 100%;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.9;
  text-align: center;
}
.cookie-consent-link {
  display: inline-block;
  margin-inline-start: 8px;
  text-decoration: underline;
  color: #166b43;
  font-weight: 700;
}
.cookie-consent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.cookie-consent-actions .btn {
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 14px;
}
.cookie-consent-actions .btn.is-loading {
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none;
}
.cookie-consent-actions .btn-primary {
  background: #166b43;
  border-color: #166b43;
}
.cookie-consent-actions .btn-outline-secondary {
  border-color: rgba(22, 107, 67, 0.35);
  color: #166b43;
}
.cookie-consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10000;
}
.cookie-consent-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cookie-consent-modal__content {
  background: #ffffff;
  width: min(520px, 94%);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  padding: 22px 24px;
}
.cookie-consent-modal__content h3 {
  margin: 0 0 8px;
  font-weight: 800;
  color: #166b43;
}
.cookie-consent-modal__content p {
  margin: 0 0 14px;
  color: #4b5563;
  line-height: 1.8;
  font-size: 14px;
}
.cookie-consent-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.cookie-consent-options label {
  font-size: 14px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cookie-consent-option-desc {
  margin: -6px 0 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}
.cookie-consent-note {
  margin-top: 6px;
}
.cookie-consent-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #166b43;
}
.cookie-consent-modal .cookie-consent-actions {
  justify-content: flex-end;
  justify-content: center;
  width: 100%;
}
@media (max-width: 576px) {
  .cookie-consent-bar {
    bottom: 12px;
  }
  .cookie-consent-modal__content {
    padding: 18px;
  }
  .cookie-consent-modal .cookie-consent-actions {
    justify-content: center;
  }
}

/* Password strength meter */
.password-field .password-strength {
  display: grid;
  gap: 6px;
}

.password-strength-meter {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: #ef4444;
  transition: width .2s ease, background .2s ease;
}

.password-strength-text {
  font-size: 0.85rem;
  color: #64748b;
}

.password-field.strength-2 .password-strength-meter span {
  background: #f59e0b;
}

.password-field.strength-3 .password-strength-meter span {
  background: #22c55e;
}

.password-field.strength-4 .password-strength-meter span {
  background: #16a34a;
}

/* ===========================================
   Unified Interaction Polish
=========================================== */
:root {
  --maarifa-btn-radius: 999px;
  --maarifa-surface-radius: 18px;
  --maarifa-control-radius: 14px;
  --maarifa-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --maarifa-shadow-medium: 0 16px 40px rgba(15, 23, 42, 0.12);
  --maarifa-hover-bg: rgba(22, 107, 67, 0.08);
}

.navbar .btn,
.auth-btn,
.account-btn,
.notifications-bell-btn,
.release-card .btn,
.home-hero-content .btn,
.cookie-consent-actions .btn {
  border-radius: var(--maarifa-btn-radius);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

.navbar .btn:hover,
.auth-btn:hover,
.account-btn:hover,
.notifications-bell-btn:hover,
.release-card .btn:hover,
.home-hero-content .btn:hover,
.cookie-consent-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--maarifa-shadow-soft);
}

.navbar-nav .nav-link {
  border-radius: 12px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  background: var(--maarifa-hover-bg);
}

.dropdown-menu {
  min-width: 220px;
  padding: 0.5rem;
  background: #fbfcfb;
  border: 1px solid #e5e7eb;
  border-radius: var(--maarifa-surface-radius);
  box-shadow: var(--maarifa-shadow-medium);
  backdrop-filter: blur(10px);
}

.dropdown-menu .dropdown-item {
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.navbar .dropdown-menu {
  min-width: 190px;
  padding: 0.35rem;
  background: #fdfefe;
}

.navbar .dropdown-menu .dropdown-item {
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
  line-height: 1.2;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: var(--maarifa-hover-bg);
  color: var(--primary-color) !important;
  transform: translateX(-1px);
}

.account-btn,
.notifications-bell-btn,
.auth-btn {
  border: 1px solid #e5e7eb;
  box-shadow: var(--maarifa-shadow-soft);
}

.account-btn,
.notifications-bell-btn {
  background: #fff;
}

.auth-btn {
  min-width: 128px;
}

.btn-primary,
.btn-outline-primary,
.btn-outline-secondary {
  border-radius: var(--maarifa-btn-radius);
}

.btn-primary {
  box-shadow: 0 10px 22px rgba(22, 107, 67, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  box-shadow: 0 14px 26px rgba(22, 107, 67, 0.22);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  box-shadow: 0 10px 22px rgba(22, 107, 67, 0.12);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.notifications-menu {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.notifications-menu-header {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.notification-item {
  border-radius: 12px;
  margin: 4px 8px;
  border-bottom: 0;
}

.notification-item:hover {
  background: rgba(22, 107, 67, 0.06);
}

.notification-empty {
  padding: 18px;
  text-align: center;
}

.notifications-bell-glyph {
  color: #166b43;
}

.account-btn .avatar-separator {
  opacity: 0.65;
}

.account-btn .navbar-brand,
.account-btn .avatar-separator {
  transition: opacity .2s ease;
}

.account-btn:hover .avatar-separator {
  opacity: 1;
}

/* ===== Header balance override ===== */
header .navbar > .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

header .navbar-brand {
  flex: 0 0 auto;
  margin-inline: 0 !important;
}

header .header-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  text-align: center;
}

header .header-brand-stack .navbar-brand {
  padding: 0;
}

header .navbar-brand img,
header .custom-logo-link img,
header .custom-logo {
  display: block;
  width: auto;
  max-width: min(220px, 72vw);
  max-height: 64px;
  object-fit: contain;
}

header .header-app-promo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 100%);
  min-width: 0;
}

header .header-app-promo-text {
  margin: 0;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.6;
  font-weight: 600;
}

header .header-app-promo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

header .header-app-promo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

header .header-app-promo-badge img {
  height: 42px;
  width: auto;
  display: block;
}

header .navbar-collapse {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 992px) {
  header .navbar > .container {
    padding-inline-start: 0.75rem;
    padding-inline-end: 0.75rem;
    gap: 10px;
  }

  header .header-brand-stack {
    max-width: 205px;
    margin-inline-end: 10px;
  }

  header .navbar-collapse {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    overflow: visible;
  }

  header .nav-center {
    flex: 0 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 0.7rem;
    margin: 0;
    padding-inline: 6px;
    flex-wrap: nowrap;
  }

  header .nav-center > li > a {
    padding-inline: 0.34rem;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
  }

  header .navbar-actions {
    flex: 0 0 auto;
    margin-inline: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    padding-inline: 0;
    gap: 8px;
    white-space: nowrap;
  }

  header .navbar-actions .notifications-dropdown {
    margin-inline-start: 10px;
  }

  header .navbar-actions .auth-btn,
  header .navbar-actions .account-btn,
  header .navbar-actions .notifications-bell-btn {
    flex: 0 0 auto;
  }

  header .navbar-actions .auth-btn {
    min-width: 104px;
    height: 38px;
    min-height: 38px;
    padding-inline: 0.72rem;
    font-size: 0.84rem;
    white-space: nowrap;
  }
}

@media (max-width: 991px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  header .navbar > .container {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  header .header-brand-stack {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-inline: 8px;
  }

  header .navbar-brand {
    margin-inline: auto !important;
  }

  header .navbar-brand img,
  header .custom-logo-link img,
  header .custom-logo {
    max-width: min(190px, 68vw);
    max-height: 52px;
  }

  header .navbar-toggler {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  header .header-app-promo {
    max-width: 100%;
  }

  header .navbar-collapse {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f6faf7 100%);
    padding: max(18px, env(safe-area-inset-top)) 18px 24px;
    z-index: 1300;
    overflow-y: auto !important;
  }

  header .navbar-collapse:not(.show) {
    display: none !important;
  }

  header .navbar-collapse.show {
    display: block !important;
  }

  .mobile-nav-panel {
    width: 100%;
    min-height: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  header .navbar-collapse > .mobile-nav-section-title.d-lg-none:first-child {
    display: none;
  }

  .mobile-nav-panel__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    margin-bottom: 16px;
    min-height: 54px;
    padding-inline: 48px;
  }

  .mobile-nav-panel__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: min(190px, 68vw);
    margin-inline: auto;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
  }

  .mobile-nav-panel__brand img,
  .mobile-nav-panel__brand .custom-logo {
    display: block;
    width: auto;
    max-width: min(190px, 68vw);
    max-height: 52px;
    object-fit: contain;
  }

  .mobile-nav-panel__close {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #eef4f0;
    color: #0f172a;
    font-size: 1.7rem;
    line-height: 1;
  }

  .mobile-nav-section-title {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
  }

  .mobile-nav-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  .mobile-nav-shortcut {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid #dfebe2;
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
  }

  .mobile-nav-shortcut__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(22, 107, 67, 0.1);
    color: #166b43;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }

  .mobile-nav-shortcut__label {
    font-weight: 800;
    font-size: 0.92rem;
  }

  header .nav-center {
    margin: 0;
    padding: 0;
    gap: 10px;
  }

  header .nav-center > li {
    width: 100%;
    list-style: none;
  }

  header .nav-center > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e1e8e3;
    border-radius: 16px;
    background: #fff;
    color: #0f172a !important;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  }

  header .nav-center > li > a::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid #94a3b8;
    border-left: 2px solid #94a3b8;
    transform: rotate(-45deg);
    margin-inline-start: 8px;
  }

  header .navbar-actions {
    width: 100%;
    margin-top: 14px;
    padding-top: 6px;
    flex-wrap: wrap;
    justify-content: stretch !important;
  }

  body.logged-in header .navbar-actions {
    gap: 10px !important;
  }

  header .navbar-actions .notifications-dropdown,
  header .navbar-actions .account-dropdown,
  header .navbar-actions .auth-btn {
    width: 100%;
    margin: 0;
  }

  header .navbar-actions .notifications-bell-btn,
  header .navbar-actions .account-btn,
  header .navbar-actions .auth-btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    border-radius: 16px;
    box-shadow: none;
  }
}

@media (min-width: 992px) {
body:not(.logged-in) header .navbar-actions {
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    padding-inline-end: 0;
  }

  body:not(.logged-in) header .navbar-actions .auth-btn {
    min-width: 104px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  header .header-brand-stack {
    max-width: 145px;
    margin-inline-end: 6px;
  }

  header .navbar-brand img,
  header .custom-logo-link img,
  header .custom-logo {
    max-width: 130px;
    max-height: 48px;
  }

  header .navbar-collapse {
    gap: 10px;
  }

  header .nav-center {
    gap: 0.24rem;
    padding-inline: 0;
  }

  header .nav-center > li > a {
    padding-inline: 0.1rem;
    font-size: 0.8rem;
  }

  header .navbar-actions {
    gap: 6px;
    margin-inline-start: 0 !important;
  }

  header .navbar-actions .auth-btn {
    min-width: 86px;
    height: 34px;
    min-height: 34px;
    padding-inline: 0.48rem;
    font-size: 0.78rem;
  }
}

@media (min-width: 1200px) {
  header .navbar-collapse {
    gap: 34px;
  }

  header .header-brand-stack {
    max-width: 220px;
    margin-inline-end: 16px;
  }

  header .nav-center {
    gap: 0.85rem;
    padding-inline: 8px;
  }

  header .nav-center > li > a {
    padding-inline: 0.36rem;
    font-size: 0.98rem;
  }

  header .navbar-actions .auth-btn {
    min-width: 112px;
    height: 38px;
    min-height: 38px;
    padding-inline: 0.8rem;
    font-size: 0.86rem;
  }
}

/* ===== Mobile Header Icons ===== */
.mobile-top-nav {
    display: none;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e5eee8;
    border-radius: 16px;
    background: #f8fbf9;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 58px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    color: #1f2937;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.mobile-account-dropdown {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

.mobile-account-dropdown .mobile-nav-item {
    width: 100%;
}

.mobile-account-menu {
    width: min(260px, 88vw);
    max-height: min(70vh, 460px);
    overflow-y: auto;
    border: 1px solid #e5ebe7;
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.mobile-account-menu .dropdown-item {
    border-radius: 10px;
    font-weight: 700;
    padding: 0.55rem 0.7rem;
}

.mobile-nav-item i {
    font-size: 19px;
    margin-bottom: 3px;
    color: #166b43;
}

.mobile-nav-item span {
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* زر القائمة */
.mobile-menu-toggle {
    background: #fff;
    border: 0;
    color: #166b43;
}

.mobile-menu-toggle i {
    color: #166b43;
}

.mobile-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.mobile-nav-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #e1e8e3;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mobile-nav-list__icon {
    flex: 0 0 auto;
    line-height: 1;
}

/* إخفاء عناصر الحاسوب في الهاتف */
@media (max-width: 991px) {
    .mobile-top-nav {
        display: flex;
    }

    .navbar-collapse {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        height: 100%;
        background: #fff;
        z-index: 9999;
        overflow-y: auto;
        padding: 20px;
    }
}

/* إصلاح الحاسوب */
@media (min-width: 992px) {
    .mobile-top-nav {
        display: none !important;
    }
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
}

.navbar-collapse {
    z-index: 99999;
    position: relative;
}

body.mobile-nav-open {
    overflow: hidden;
}
