:root {
  color-scheme: dark;
}

html,
body {
  background: #1e2535 !important;
  color: #ffffff !important;
}

/* روابط على الخلفية الداكنة: أبيض للوضوح */
a,
a:visited {
  color: #ffffff !important;
}

a:hover,
a:focus {
  color: #f0f4ff !important;
  text-decoration: underline;
}

a:active {
  color: #e2e8f0 !important;
}

/* القائمة الجانبية والتذييل — خلفية داكنة */
.site-menubar a,
.site-menubar a:visited,
.site-footer a,
.site-footer a:visited,
.site-menubar-footer > a,
.site-menubar-footer > a:visited {
  color: #ffffff !important;
}

.site-menubar a:hover,
.site-menubar a:focus,
.site-footer a:hover,
.site-footer a:focus,
.site-menubar-footer > a:hover,
.site-menubar-footer > a:focus {
  color: #f0f4ff !important;
}

/* روابط بألوان Bootstrap دلالية — تبقى ملوّنة للتمييز */
a.text-danger,
a.text-danger:visited {
  color: #f87171 !important;
}
a.text-warning,
a.text-warning:visited {
  color: #fbbf24 !important;
}
a.text-success,
a.text-success:visited {
  color: #86efac !important;
}
a.text-info,
a.text-info:visited {
  color: #7dd3fc !important;
}

/* روابط على شكل زر (مجموعات المواضيع + بكالوريا/بيام btn-item-annale) */
body.ar .btn-group.item > a.btn,
body.ar .btn-group.item > a.btn:visited,
body.ar .page-content .btn-group.item > a.btn,
body.ar .page-content .btn-group.item > a.btn:visited,
.btn-group a.btn,
.btn-group a.btn:visited,
.btn-group.header a.btn,
.btn-group.header a.btn:visited,
.btn-group.item a.btn,
.btn-group.item a.btn:visited,
a.btn.btn-group-content,
a.btn.btn-group-content:visited,
a.btn.btn-group-sol,
a.btn.btn-group-sol:visited,
a.btn.btn-item-sujet,
a.btn.btn-item-sujet:visited,
a.btn.btn-item-annale,
a.btn.btn-item-annale:visited {
  color: #ffffff !important;
}

/* تصحيح / روابط المجموعة غير عنوان الملف */
body.ar .btn-group.item > a.btn.btn-group-sol:hover,
body.ar .btn-group.item > a.btn.btn-group-sol:focus,
body.ar .page-content .btn-group.item > a.btn.btn-group-sol:hover,
body.ar .page-content .btn-group.item > a.btn.btn-group-sol:focus,
.btn-group.header a.btn:hover,
.btn-group.header a.btn:focus,
.btn-group a.btn:not(.btn-group-content):hover,
.btn-group a.btn:not(.btn-group-content):focus,
.btn-group.item a.btn.btn-group-sol:hover,
.btn-group.item a.btn.btn-group-sol:focus,
a.btn.btn-group-sol:hover,
a.btn.btn-group-sol:focus {
  color: #f0f4ff !important;
  text-decoration: none !important;
}

/* عنوان الملف (المحتوى): hover / focus أصفر */
a.btn.btn-group-content.btn-item-sujet:hover,
a.btn.btn-group-content.btn-item-sujet:focus,
a.btn.btn-group-content.btn-item-annale:hover,
a.btn.btn-group-content.btn-item-annale:focus,
body.ar .btn-group.item > a.btn.btn-group-content:hover,
body.ar .btn-group.item > a.btn.btn-group-content:focus,
body.ar .page-content .btn-group.item > a.btn.btn-group-content:hover,
body.ar .page-content .btn-group.item > a.btn.btn-group-content:focus,
.btn-group.item a.btn.btn-group-content:hover,
.btn-group.item a.btn.btn-group-content:focus {
  color: #ffeb3b !important;
  text-decoration: none !important;
}

a.btn.btn-group-content.btn-item-sujet:active,
a.btn.btn-group-content.btn-item-annale:active,
body.ar .btn-group.item > a.btn.btn-group-content:active,
body.ar .page-content .btn-group.item > a.btn.btn-group-content:active,
.btn-group.item a.btn.btn-group-content:active {
  color: #fdd835 !important;
  text-decoration: none !important;
}

body.ar .btn-group.item > a.btn.btn-group-sol:active,
body.ar .page-content .btn-group.item > a.btn.btn-group-sol:active,
.btn-group.item a.btn.btn-group-sol:active,
a.btn.btn-group-sol:active {
  color: #e2e8f0 !important;
  text-decoration: none !important;
}

.dz-title-doc-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-inline-end: 0.35em;
}

.dz-title-doc-icon i {
  font-size: 1.15em;
  line-height: 1;
}

a.btn.btn-group-content.btn-item-sujet .dz-title-doc-icon--pdf i,
a.btn.btn-group-content.btn-item-annale .dz-title-doc-icon--pdf i {
  color: #f87171 !important;
}

a.btn.btn-group-content.btn-item-sujet .dz-title-doc-icon--doc i,
a.btn.btn-group-content.btn-item-annale .dz-title-doc-icon--doc i {
  color: #60a5fa !important;
}

a.btn.btn-group-content.btn-item-sujet .dz-title-doc-icon--zip i,
a.btn.btn-group-content.btn-item-annale .dz-title-doc-icon--zip i {
  color: #cbd5e1 !important;
}

a.btn.btn-group-content.btn-item-sujet:hover .dz-title-doc-icon i,
a.btn.btn-group-content.btn-item-sujet:focus .dz-title-doc-icon i,
a.btn.btn-group-content.btn-item-annale:hover .dz-title-doc-icon i,
a.btn.btn-group-content.btn-item-annale:focus .dz-title-doc-icon i {
  color: #ffeb3b !important;
}

body.ar .btn-group.item > a.btn span,
body.ar .page-content .btn-group.item > a.btn span,
.btn-group a.btn span,
.btn-group.item a.btn span,
a.btn.btn-group-content span,
a.btn.btn-group-sol span,
a.btn.btn-item-sujet span,
a.btn.btn-item-annale span {
  color: inherit !important;
}

/* Core containers and cards */
.container,
.container-fluid,
.card,
.panel,
.well,
.box,
.content,
.content-wrapper,
.main-content,
.modal-content,
.dropdown-menu,
.list-group-item,
.breadcrumb-wrapper,
.stats-section,
.post-card,
.empty-state,
.pagination a,
.pagination span,
.page,
table,
thead,
tbody,
tfoot,
tr,
th,
td {
  background-color: #252e42 !important;
  color: #ffffff !important;
  border-color: #3d4f6b !important;
}

/* Bootstrap helpers */
.bg-light,
.bg-white,
.navbar,
.navbar-default,
.nav,
.pagination .disabled:hover {
  background-color: #252e42 !important;
  color: #ffffff !important;
}

.text-dark,
.text-muted,
.text-secondary,
small,
label,
.program-info,
.stat-label {
  color: #ffffff !important;
}

/* Page background */
.page {
  background: #1e2535 !important;
}

/* Forms */
input,
textarea,
select,
.form-control {
  background: #2a3347 !important;
  color: #ffffff !important;
  border-color: #4a5c78 !important;
}

input::placeholder,
textarea::placeholder {
  color: #7d92ad !important;
}

/* Buttons */
.btn-outline-primary,
.btn-outline-secondary,
.btn-secondary {
  border-color: #5a7199 !important;
  color: #ffffff !important;
}

/* Borders */
hr,
.border,
[class*="border-"] {
  border-color: #3d4f6b !important;
}

/* Navbar nav link text */
.site-navbar .nav-link .nav-text {
  color: #ffffff !important;
}

.site-navbar .navbar-container {
  background-color: #252e42 !important;
}

/* advice section (hardcoded white in app5.css) */
.advice {
  background-color: #2a3347 !important;
  color: #ffffff !important;
}

.advice strong,
.advice b {
  color: #ffffff !important;
}

/* article section */
.article {
  background: #2a3347 !important;
  color: #ffffff !important;
  border-color: #3d4f6b !important;
}

/* title-default */
.title-default {
  color: #ffffff !important;
  background-color: #2a3347 !important;
}

/* listSearch buttons */
.listSearch .input-group .btn-default {
  background-color: #2a3347 !important;
  color: #ffffff !important;
  border-color: #3d4f6b !important;
}

.listSearch .input-group .btn:hover {
  background-color: #344159 !important;
}

/* pub section */
.pub-v {
  background: #2a3347 !important;
  border-color: #90c4f9 !important;
}

/* site-footer */
.site-footer,
.site-menubar-footer > a {
  background-color: #252e42 !important;
  color: #ffffff !important;
}

/* Handle hardcoded white backgrounds from inline/style blocks */
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color:#fff"],
[style*="background-color: #fff"],
[style*="background:white"],
[style*="background: white"],
[style*="background-color:white"],
[style*="background-color: white"] {
  background: #252e42 !important;
  color: #ffffff !important;
}

/* Handle inline color:black or color:#000 on text */
[style*="color:black"],
[style*="color: black"],
[style*="color:#000"],
[style*="color: #000"],
[style*="color:#333"],
[style*="color: #333"],
[style*="color:#37474f"],
[style*="color: #37474f"],
[style*="color:#76838f"],
[style*="color: #76838f"] {
  color: #ffffff !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #1e2535;
}
::-webkit-scrollbar-thumb {
  background: #3d4f6b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4d6285;
}
