/* Motibha Foundation - Premium UI 2026
   Purpose: Modern, unique, high-contrast redesign applied site-wide
   Loaded LAST so it can override legacy/theme/redesign layers.
*/

:root {
  --mf-ui-bg: #f6f7fb;
  --mf-ui-surface: rgba(255, 255, 255, 0.82);
  --mf-ui-surface-solid: #ffffff;
  --mf-ui-border: rgba(15, 23, 42, 0.10);
  --mf-ui-text: rgba(2, 6, 23, 0.92);
  --mf-ui-muted: rgba(2, 6, 23, 0.64);

  --mf-ui-primary: #1d4ed8; /* blue */
  --mf-ui-secondary: #7c3aed; /* purple */
  --mf-ui-accent: #f59e0b; /* amber */

  --mf-ui-radius: 18px;
  --mf-ui-radius-sm: 14px;
  --mf-ui-shadow: 0 22px 60px rgba(2, 6, 23, 0.16);
  --mf-ui-shadow-sm: 0 10px 28px rgba(2, 6, 23, 0.10);

  --mf-ui-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html, body {
  background: var(--mf-ui-bg);
  color: var(--mf-ui-text);
}

/* -------------------------
   Premium Header
-------------------------- */
header {
  position: relative;
  z-index: 1100;
}

/* Topbar (optional markup in header.php) */
.mf-topbar {
  position: relative;
  z-index: 1101;
  background:
    radial-gradient(900px 320px at 8% 10%, rgba(124, 58, 237, 0.24), transparent 60%),
    radial-gradient(900px 320px at 92% 10%, rgba(29, 78, 216, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.96));
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.mf-topbar .mf-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.mf-topbar a {
  color: rgba(255, 255, 255, 0.92) !important;
  text-decoration: none;
}

.mf-topbar a:hover {
  color: #ffffff !important;
}

.mf-topbar .mf-topbar__meta {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.mf-topbar .mf-topbar__meta i {
  color: rgba(245, 158, 11, 0.95);
}

.mf-topbar .mf-topbar__social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mf-topbar .mf-topbar__social a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 180ms var(--mf-ui-ease), background 180ms var(--mf-ui-ease);
}

.mf-topbar .mf-topbar__social a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

/* Navbar surface */
.navbar-main {
  position: sticky;
  top: 0;
  z-index: 1100 !important;
  height: 84px;
  padding: 0;
  background:
    radial-gradient(900px 420px at 12% -30%, rgba(124, 58, 237, 0.26), transparent 62%),
    radial-gradient(900px 420px at 88% -30%, rgba(29, 78, 216, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.10);
  transition: box-shadow 220ms var(--mf-ui-ease), background 220ms var(--mf-ui-ease);
}

.navbar-main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(29, 78, 216, 0),
    rgba(29, 78, 216, 0.75),
    rgba(124, 58, 237, 0.78),
    rgba(245, 158, 11, 0.82),
    rgba(29, 78, 216, 0)
  );
  opacity: 0.95;
  pointer-events: none;
}

.navbar-main.mf-scrolled {
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.16);
  background:
    radial-gradient(900px 420px at 12% -30%, rgba(124, 58, 237, 0.30), transparent 62%),
    radial-gradient(900px 420px at 88% -30%, rgba(29, 78, 216, 0.26), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.90)) !important;
}

/* Brand */
.navbar-main .navbar-brand {
  gap: 12px;
  padding: 0;
}

.navbar-main .brand-mark {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(circle at 28% 22%, rgba(245, 158, 11, 0.22), transparent 60%),
    radial-gradient(circle at 70% 30%, rgba(124, 58, 237, 0.18), transparent 60%),
    #ffffff;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.10);
}

.navbar-main .brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

@media (max-width: 576px) {
  .navbar-main .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .navbar-main .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }
}

/* Home About image: remove any bg/border behind image */
#about .about-img::before,
#about .about-img::after {
  display: none !important;
  content: none !important;
}

#about .about-img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

#about .about-img img {
  width: 100%;
  height: clamp(280px, 44vh, 520px);
  object-fit: cover;
  object-position: center;
  background: transparent !important;
  border-radius: 18px;
}

.navbar-main .brand-top {
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(2, 6, 23, 0.92) !important;
}

.navbar-main .brand-bottom {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(2, 6, 23, 0.50) !important;
}

/* Nav links */
.navbar-main .navbar-nav .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 14px !important;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgba(2, 6, 23, 0.78) !important;
  background: transparent;
  transition: transform 160ms var(--mf-ui-ease), background 160ms var(--mf-ui-ease), color 160ms var(--mf-ui-ease);
}

.navbar-main .navbar-nav .nav-link:hover {
  background: rgba(29, 78, 216, 0.08);
  color: rgba(2, 6, 23, 0.92) !important;
}

.navbar-main .navbar-nav .nav-link.active {
  background: rgba(124, 58, 237, 0.10);
  color: rgba(2, 6, 23, 0.95) !important;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.18);
}

/* Premium underline indicator */
.navbar-main .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform 220ms var(--mf-ui-ease);
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.85), rgba(124, 58, 237, 0.85), rgba(245, 158, 11, 0.85));
  opacity: 0.9;
}

.navbar-main .navbar-nav .nav-link:hover::after,
.navbar-main .navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}

/* Dropdowns (including mega menu) */
.navbar-main .dropdown-menu {
  border-radius: 20px !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 34px 90px rgba(2, 6, 23, 0.18) !important;
  padding: 18px !important;

@media (min-width: 992px) {
  .navbar-main .dropdown-menu {
    margin-top: 0 !important;
  }
}
}

/* Hover bridge: prevents menu from disappearing when moving mouse from link to menu */
@media (min-width: 992px) {
  .navbar-main .dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
    background: transparent;
  }
}

/* Desktop: dropdowns are animated and only visible via .show (no hover-open) */
@media (min-width: 992px) {
  .navbar-main .dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.985);
    transform-origin: 50% 0;
    pointer-events: none;
    transition: opacity 180ms var(--mf-ui-ease), transform 220ms var(--mf-ui-ease), visibility 180ms var(--mf-ui-ease);
  }

  .navbar-main .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* Hard-disable any remaining legacy hover-open rules (but don't hide real .show dropdowns) */
  .navbar-main .nav-item.dropdown:hover > .dropdown-menu:not(.show) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Ensure dropdowns render above hero/sections */
  .navbar-main .dropdown-menu {
    z-index: 2000;
  }
}

/* Mega menu: centered "drawer" feel */
@media (min-width: 992px) {
  /* Bootstrap's .position-static breaks absolute anchoring for mega menu on some layouts */
  .navbar-main .nav-item.dropdown.position-static {
    position: relative !important;
  }

  .navbar-main .nav-item.position-static > .dropdown-menu.mega-menu {
    top: calc(100% + 4px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(10px) scale(0.985) !important;
    width: min(1100px, calc(100vw - 48px)) !important;
    max-width: min(1100px, calc(100vw - 48px)) !important;
    padding: 22px !important;
    border-radius: 22px !important;
    background:
      radial-gradient(900px 380px at 18% 18%, rgba(124, 58, 237, 0.10), transparent 60%),
      radial-gradient(900px 380px at 88% 20%, rgba(29, 78, 216, 0.08), transparent 62%),
      rgba(255, 255, 255, 0.98) !important;
  }

  .navbar-main .nav-item.position-static > .dropdown-menu.mega-menu.show {
    transform: translateX(-50%) translateY(0) scale(1) !important;
  }
}

.navbar-main .dropdown-menu .menu-heading {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.navbar-main .dropdown-menu .menu-item,
.navbar-main .dropdown-menu .dropdown-item {
  border-radius: 14px !important;
  padding: 10px 12px !important;
}

.navbar-main .dropdown-menu .menu-item:hover,
.navbar-main .dropdown-menu .dropdown-item:hover {
  background: rgba(245, 158, 11, 0.12) !important;
}

/* Donate CTA */
.btn-donate-header {
  border-radius: 999px !important;
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  color: rgba(11, 11, 16, 0.96) !important;
  border: 0;
  box-shadow: 0 16px 45px rgba(245, 158, 11, 0.26);
  padding: 12px 18px !important;
  font-size: 0.95rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms var(--mf-ui-ease), box-shadow 220ms var(--mf-ui-ease), filter 180ms var(--mf-ui-ease);
}

.btn-donate-header:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 22px 60px rgba(245, 158, 11, 0.32);
}

/* Ensure desktop donate button is actually visible */
@media (min-width: 992px) {
  .navbar-donate-outside {
    display: inline-flex !important;
    margin-left: 14px;
    white-space: nowrap;
  }
}

/* Header branding: force visible logo growth (2x) */
@media (min-width: 992px) {
  .navbar-main .brand-mark {
    width: 96px !important;
    height: 96px !important;
    border-radius: 20px !important;
  }

  .navbar-main .brand-logo {
    width: 88px !important;
    height: 88px !important;
    border-radius: 18px !important;
  }

  .navbar-main .brand-top {
    font-size: 28px !important;
  }

  .navbar-main .brand-bottom {
    font-size: 14px !important;
    letter-spacing: 0.22em !important;
  }
}

@media (max-width: 991.98px) {
  .navbar-main .brand-mark {
    width: 72px !important;
    height: 72px !important;
    border-radius: 18px !important;
  }

  .navbar-main .brand-logo {
    width: 64px !important;
    height: 64px !important;
    border-radius: 16px !important;
  }
}

/* Mobile collapse panel feel */
@media (max-width: 991.98px) {
  .navbar-main .navbar-collapse {
    margin-top: 12px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.16);
  }

  .navbar-main .navbar-nav .nav-link {
    width: 100%;
    justify-content: flex-start;
  }

  /* Mobile-first dropdowns become inline accordions (handled by js/navbar-v3.js) */
  .navbar-main .dropdown-menu {
    position: static !important;
    float: none !important;
    width: 100% !important;
    margin: 6px 0 10px !important;
    padding: 8px !important;
    border-radius: 18px !important;
    box-shadow: none !important;
    display: none;
  }

  .navbar-main .dropdown-menu.show {
    display: block;
  }

  .navbar-main .dropdown-menu .menu-item,
  .navbar-main .dropdown-menu .dropdown-item {
    width: 100%;
    white-space: normal;
  }
}

/* -------------------------
   Global Sections & Visibility
-------------------------- */

/* Consistent vertical rhythm (avoids cramped/hidden sections) */
section {
  position: relative;
}

/* Existing section containers used across home/pages */
.section-crisp-white,
.section-crisp-gray,
.section,
.section-light,
.section-dark {
  padding: clamp(56px, 7vw, 96px) 0 !important;
}

.section-crisp-white,
.section-light {
  background:
    radial-gradient(900px 380px at 10% 10%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(900px 380px at 92% 10%, rgba(29, 78, 216, 0.08), transparent 62%),
    #ffffff !important;
}

.section-crisp-gray,
.section-dark {
  background:
    radial-gradient(900px 380px at 10% 10%, rgba(245, 158, 11, 0.08), transparent 60%),
    radial-gradient(900px 380px at 92% 10%, rgba(124, 58, 237, 0.08), transparent 62%),
    #f8fafc !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.section-title-wrapper {
  margin-bottom: clamp(28px, 4vw, 56px) !important;
  text-align: center;
  display: block !important;
}

.section-title-wrapper .section-subtitle {
  display: inline-flex !important;
}

.section-title-wrapper .section-title {
  display: block !important;
}

.section-title-wrapper .section-subtitle {
  margin-bottom: 14px;
}

.section-title-wrapper .section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  line-height: 1.12;
  margin-top: 6px;
}

.section-title-wrapper p,
.section-title-wrapper .lead {
  margin-top: 12px;
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

.section-title-wrapper::after {
  content: "";
  display: block;
  width: 92px;
  height: 3px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.80), rgba(124, 58, 237, 0.80), rgba(245, 158, 11, 0.80));
  opacity: 0.85;
}

.mf-section {
  padding: clamp(56px, 7vw, 96px) 0;
}

.mf-section--muted {
  background:
    radial-gradient(900px 360px at 12% 10%, rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(900px 360px at 92% 10%, rgba(29, 78, 216, 0.10), transparent 62%),
    #ffffff;
}

.mf-section__kicker,
.section-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(2, 6, 23, 0.72);
  background: rgba(29, 78, 216, 0.06);
  border: 1px solid rgba(29, 78, 216, 0.10);
}

/* Remove legacy "line" decoration (style.css) that breaks subtitle pills */
.section-subtitle {
  padding-left: 14px !important;
  margin-bottom: 14px;
}

.section-subtitle::before,
.section-subtitle::after {
  content: none !important;
  display: none !important;
}

.mf-section__title,
.section-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(2, 6, 23, 0.94);
}

/* About section: make image + text feel premium */
.about-img img {
  border-radius: 26px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}

.about-text-content .lead {
  color: rgba(2, 6, 23, 0.68) !important;
  line-height: 1.75;
}

/* Reach/map section: make it feel more premium */
.home-reach-section .reach-map-card {
  border-radius: 22px;
}

.home-reach-section .reach-points {
  border-radius: 22px;
}

.home-reach-section .reach-points__title {
  font-size: 1.05rem;
  color: rgba(2, 6, 23, 0.90);
}

/* Size only heading tags (avoid affecting small label-style .section-title div/h6 usage) */
h1.section-title,
h2.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  line-height: 1.12;
}

h3.section-title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.18;
}

.mf-section__lead {
  color: rgba(2, 6, 23, 0.64);
  max-width: 70ch;
}

/* Cards: consistent modern look */
.card,
.modern-card,
.glass-card {
  border-radius: var(--mf-ui-radius) !important;
}

.glass-card {
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: var(--mf-ui-shadow-sm) !important;
}

/* Better default readability */
p {
  color: rgba(2, 6, 23, 0.70);
}

/* Home/card content: ensure headings + paragraphs stay readable even if legacy CSS sets light text */
.modern-card,
.news-card,
.yt-link-card,
.cert-image-card,
.reach-map-card,
.glass-card {
  color: rgba(2, 6, 23, 0.86);
}

.modern-card h1, .modern-card h2, .modern-card h3, .modern-card h4, .modern-card h5,
.news-card h1, .news-card h2, .news-card h3, .news-card h4, .news-card h5,
.reach-map-card h1, .reach-map-card h2, .reach-map-card h3, .reach-map-card h4,
.cert-image-card h1, .cert-image-card h2, .cert-image-card h3, .cert-image-card h4, .cert-image-card h5 {
  color: rgba(2, 6, 23, 0.94) !important;
}

.modern-card p,
.news-card p,
.reach-map-card p,
.cert-image-card p {
  color: rgba(2, 6, 23, 0.70) !important;
}

.text-muted {
  color: rgba(2, 6, 23, 0.56) !important;
}

/* Buttons: consistent premium feel */
.btn {
  border-radius: 14px !important;
  font-weight: 800;
}

.btn-outline-dark {
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: rgba(2, 6, 23, 0.86) !important;
}

.btn-outline-dark:hover {
  background: rgba(2, 6, 23, 0.06) !important;
  color: rgba(2, 6, 23, 0.92) !important;
}

/* Smooth focus ring */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.22rem rgba(29, 78, 216, 0.22), 0 0 0 0.42rem rgba(124, 58, 237, 0.12) !important;
}

/* -------------------------
   Premium Footer polish
-------------------------- */
.footer .btn.btn-link:hover,
.footer .btn-link:hover {
  color: rgba(15, 23, 42, 0.92) !important;
}

.mf-footer-thumb-link {
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.mf-footer-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transform: scale(1);
  transition: transform 240ms var(--mf-ui-ease), filter 240ms var(--mf-ui-ease);
}

@media (hover: hover) and (pointer: fine) {
  .mf-footer-thumb-link:hover .mf-footer-thumb {
    transform: scale(1.06);
    filter: saturate(1.02) contrast(1.02);
  }
}

/* Impact stats: enforce contrast even if theme variables are missing */
.impact-stats-section {
  color: #ffffff !important;
}

.impact-stats-section .impact-number {
  color: #ffffff !important;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.impact-stats-section .impact-label {
  color: rgba(255, 255, 255, 0.86) !important;
}

.impact-stats-section .impact-stat-item {
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

.impact-stats-section .impact-stat-item:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* Footer logo: force 3x visibility + stop invert filter */
.footer .footer-logo {
  width: 180px !important;
  height: 180px !important;
  max-width: none !important;
  filter: none !important;
}

@media (max-width: 575.98px) {
  .footer .footer-logo {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Footer social icons: proper hover + platform feel */
.footer .btn.btn-square {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.78);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  transition: transform 180ms var(--mf-ui-ease), box-shadow 220ms var(--mf-ui-ease), background 220ms var(--mf-ui-ease), color 220ms var(--mf-ui-ease);
}

.footer .btn.btn-square:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(29, 78, 216, 1), rgba(124, 58, 237, 1));
  color: #fff;
  box-shadow: 0 18px 44px rgba(29, 78, 216, 0.22);
}

.footer .btn.btn-square i {
  color: currentColor !important;
  font-size: 18px;
  line-height: 1;
}

/* Contact page map iframe polish */
.map-section iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  .mf-footer-thumb {
    transition: none !important;
  }
}
