/* =====================================================
   static/css/dark-mode.css — cleaned & de-duplicated
   Keeps behavior intact; only removed repeated / overlapping rules
   ===================================================== */

/* Smooth transitions for toggling */
:root { --transition-fast: 160ms; }

body,
body * {
  transition: color var(--transition-fast) ease,
              background-color var(--transition-fast) ease,
              border-color var(--transition-fast) ease;
}

/* -----------------------------------------------------
   GLOBAL DARK MODE
   ----------------------------------------------------- */

body.dark-mode {
  background-color: #0f1113 !important;
  color: #e6eef6 !important;
}

/* Headings */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #ffffff !important;
}

/* Links */
body.dark-mode a { color: #89b7ff !important; }
body.dark-mode a:hover { color: #bcd9ff !important; }

/* Navbar / topbar */
body.dark-mode .navbar,
body.dark-mode .navbar-default,
body.dark-mode header,
body.dark-mode #top {
  background-color: #0b0c0d !important;
  border-color: #1b1c1d !important;
}

/* Breadcrumb / page header */
body.dark-mode #heading-breadcrumbs {
  background-color: #101214 !important;
  border-bottom: 1px solid #222 !important;
}

/* Footer */
body.dark-mode #footer,
body.dark-mode #copyright {
  background-color: #0b0c0d !important;
  color: #cfcfcf !important;
}

/* Images */
body.dark-mode img {
  filter: brightness(.95) contrast(1.02);
}

/* Dropdown menu (Bootstrap) */
body.dark-mode .dropdown-menu {
  background-color: #101214 !important;
  border-color: #222 !important;
}
body.dark-mode .dropdown-menu > li > a {
  color: #d9e6f8 !important;
}

/* Buttons & forms */
body.dark-mode .btn,
body.dark-mode .btn-template-main {
  background-color: #1a73ff !important;
  color: #fff !important;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background-color: #0f1113 !important;
  color: #e6eef6 !important;
  border-color: #2a2d30 !important;
}

/* Theme toggle */
.theme-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  color: inherit;
}
.theme-toggle .fa { font-size: 18px; }
.theme-toggle:hover { background-color: rgba(255,255,255,0.04); }

@media (max-width: 480px) {
  .theme-toggle { width: 36px; height: 36px; }
  .theme-toggle .fa { font-size: 16px; }
}

/* -----------------------------------------------------
   LIGHT SECTIONS (SERVICES / HERO) — STAY LIGHT
   These should remain readable (white background areas)
   ----------------------------------------------------- */

/* Keep light-section backgrounds/light text */
body.dark-mode .bar.background-white,
body.dark-mode .bar.background-gray,
body.dark-mode .background-white,
body.dark-mode .background-gray,
body.dark-mode #content .bar.background-white,
body.dark-mode #content .bar.background-gray,
body.dark-mode #content .background-white,
body.dark-mode #content .background-gray {
  background-color: #ffffff !important;
  color: #222222 !important;
}

/* Ensure text inside those light sections inherits the light theme */
body.dark-mode .bar.background-white *,
body.dark-mode .bar.background-gray *,
body.dark-mode .background-white *,
body.dark-mode .background-gray *,
body.dark-mode #content .bar.background-white *,
body.dark-mode #content .bar.background-gray *,
body.dark-mode #content .background-white *,
body.dark-mode #content .background-gray * {
  color: inherit !important;
}

/* Page titles on light backgrounds (History, VISA, breadcrumbs) */
body.dark-mode #heading-breadcrumbs,
body.dark-mode #heading-breadcrumbs h1,
body.dark-mode #heading-breadcrumbs p,
body.dark-mode #heading-breadcrumbs .breadcrumb,
body.dark-mode #heading-breadcrumbs .lead {
  background-color: inherit !important;
  color: #111111 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #111111 !important;
  text-shadow: none !important;
}

/* Headings inside light/background blocks */
body.dark-mode #content .bar.background-white h1,
body.dark-mode #content .bar.background-white h2,
body.dark-mode #content .bar.background-white h3,
body.dark-mode #content .bar.background-white h4,
body.dark-mode #content .bar.background-white h5,
body.dark-mode #content .bar.background-white h6,
body.dark-mode #content .bar.background-gray h1,
body.dark-mode #content .bar.background-gray h2,
body.dark-mode #content .bar.background-gray h3,
body.dark-mode #content .bar.background-gray h4,
body.dark-mode .background-white h1,
body.dark-mode .background-white h2,
body.dark-mode .background-white h3,
body.dark-mode .background-gray h1,
body.dark-mode .background-gray h2,
body.dark-mode .background-gray h3 {
  color: #111111 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #111111 !important;
  text-shadow: none !important;
}

/* Subtitle / lead lines inside those blocks */
body.dark-mode #content .bar.background-white p,
body.dark-mode #content .bar.background-white .lead,
body.dark-mode .bar.background-white p,
body.dark-mode .bar.background-white .lead,
body.dark-mode .background-white p,
body.dark-mode .background-white .lead {
  color: #555555 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #555555 !important;
  text-shadow: none !important;
}

/* Icons inside light blocks */
body.dark-mode #content .bar.background-white i,
body.dark-mode #content .bar.background-white svg,
body.dark-mode .bar.background-white i,
body.dark-mode .bar.background-white svg,
body.dark-mode .background-white i,
body.dark-mode .background-white svg {
  color: #1a73e8 !important;
  fill: #1a73e8 !important;
  opacity: 1 !important;
}

/* Remove pseudo overlay that could dim these sections */
body.dark-mode #content .bar.background-white::before,
body.dark-mode #content .bar.background-white::after,
body.dark-mode .background-white::before,
body.dark-mode .background-white::after {
  display: none !important;
  content: none !important;
  opacity: 1 !important;
}

/* -----------------------------------------------------
   FEATURE / ICON BOXES — FORCE DARK (even inside light sections)
   ----------------------------------------------------- */

body.dark-mode .box-simple,
body.dark-mode .box-image-text,
body.dark-mode .panel,
body.dark-mode .card,
body.dark-mode .background-white .box-simple,
body.dark-mode .background-white .box-image-text,
body.dark-mode #content .bar.background-white .box-simple,
body.dark-mode #content .bar.background-white .box-image-text {
  background-color: #0f1113 !important;
  background-image: none !important;
  border-color: #1f2225 !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 20px rgba(0,0,0,0.35) !important;
  -webkit-backface-visibility: visible !important;
  mix-blend-mode: normal !important;
}

body.dark-mode .box-simple *,
body.dark-mode .box-image-text *,
body.dark-mode .panel *,
body.dark-mode .card * {
  color: #e6eef6 !important;
  -webkit-text-fill-color: #e6eef6 !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Headings & icons inside boxes */
body.dark-mode .box-simple h1,
body.dark-mode .box-simple h2,
body.dark-mode .box-simple h3,
body.dark-mode .box-image-text h1,
body.dark-mode .box-image-text h2,
body.dark-mode .box-image-text h3,
body.dark-mode .panel h1,
body.dark-mode .panel h2,
body.dark-mode .panel h3,
body.dark-mode .card h1,
body.dark-mode .card h2,
body.dark-mode .card h3 {
  color: #ffffff !important;
  opacity: 1 !important;
}

body.dark-mode .box-simple i,
body.dark-mode .box-image-text i,
body.dark-mode .panel i,
body.dark-mode .card i,
body.dark-mode .box-simple svg,
body.dark-mode .box-image-text svg,
body.dark-mode .panel svg,
body.dark-mode .card svg {
  color: #8ab4f8 !important;
  fill: #8ab4f8 !important;
  opacity: 1 !important;
}

/* Remove pseudo elements on boxed items that may re-light them */
body.dark-mode .bar.background-white .box-simple::before,
body.dark-mode .bar.background-white .box-image-text::before,
body.dark-mode .background-white .box-simple::before,
body.dark-mode .background-white .box-image-text::before,
body.dark-mode .bar.background-white .box-simple::after,
body.dark-mode .bar.background-white .box-image-text::after,
body.dark-mode .background-white .box-simple::after,
body.dark-mode .background-white .box-image-text::after {
  display: none !important;
  content: none !important;
  opacity: 1 !important;
}

/* -----------------------------------------------------
   REGISTERED ORGANIZATIONS / CLIENTS (partners logos)
   section.bar.background-gray.no-mb  — exact target
   ----------------------------------------------------- */

body.dark-mode section.bar.background-gray.no-mb {
  background-color: #0f1113 !important;
  color: #e6eef6 !important;
}

body.dark-mode section.bar.background-gray.no-mb .container,
body.dark-mode section.bar.background-gray.no-mb .row,
body.dark-mode section.bar.background-gray.no-mb .col-md-12 {
  background-color: transparent !important;
}

body.dark-mode section.bar.background-gray.no-mb .lead {
  color: #e6eef6 !important;
  opacity: 1 !important;
}

/* Owl carousel / logos container */
body.dark-mode section.bar.background-gray.no-mb ul.owl-carousel.customers,
body.dark-mode section.bar.background-gray.no-mb .owl-wrapper,
body.dark-mode section.bar.background-gray.no-mb .owl-wrapper-outer,
body.dark-mode section.bar.background-gray.no-mb .owl-item {
  background-color: #0f1113 !important;
}

/* Logo base styling for dark background (visible) */
body.dark-mode section.bar.background-gray.no-mb ul.owl-carousel.customers img {
  max-width: 160px;
  max-height: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1) contrast(1.05);
  transition: transform .22s ease, box-shadow .22s ease, filter .18s ease;
  display: inline-block;
  padding: 4px 8px;
  margin: 0 auto;
}

/* Restore original colors on hover + hover lift */
body.dark-mode section.bar.background-gray.no-mb
  ul.owl-carousel.customers li.item:hover img,
body.dark-mode section.bar.background-gray.no-mb
  ul.owl-carousel.customers .owl-item:hover img {
  filter: none !important;
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.45) !important;
  cursor: pointer !important;
}

@media (max-width: 768px) {
  body.dark-mode section.bar.background-gray.no-mb ul.owl-carousel.customers img {
    max-width: 120px;
    max-height: 60px;
  }
}

/* Links inside partners section */
body.dark-mode section.bar.background-gray.no-mb a {
  color: #e6eef6 !important;
}

/* =====================================================
   HARD OVERRIDE: FEATURE BOX TEXT (FINAL FIX)
   This overrides the inherit rules above — guaranteed
   ===================================================== */

/* Target feature boxes INSIDE light sections */
body.dark-mode .bar.background-white .box-simple,
body.dark-mode .bar.background-gray .box-simple,
body.dark-mode .bar.background-white .box-image-text,
body.dark-mode .bar.background-gray .box-image-text {
  background-color: #0f1113 !important;
}

/* 🔥 Force ALL text inside those boxes to WHITE */
body.dark-mode .bar.background-white .box-simple *,
body.dark-mode .bar.background-gray .box-simple *,
body.dark-mode .bar.background-white .box-image-text *,
body.dark-mode .bar.background-gray .box-image-text * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Paragraphs & lists slightly softer */
body.dark-mode .bar.background-white .box-simple p,
body.dark-mode .bar.background-gray .box-simple p,
body.dark-mode .bar.background-white .box-simple li,
body.dark-mode .bar.background-gray .box-simple li {
  color: #e6eef6 !important;
}

/* Icons */
body.dark-mode .bar.background-white .box-simple i,
body.dark-mode .bar.background-gray .box-simple i,
body.dark-mode .bar.background-white .box-simple svg,
body.dark-mode .bar.background-gray .box-simple svg {
  color: #8ab4f8 !important;
  fill: #8ab4f8 !important;
}
