/* ==========================================
   HI-RES DIGITAL MAPPING — DARK MODE
   ========================================== */

/* ---------- THEME TOKENS ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --brand: #0B3D91;
  --accent: #00B8A9;
  --accent-hover: #00A192;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12);
  --radius: 12px;
  --transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-alt: #111827;
  --bg-elevated: #1a2233;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --brand: #4F8FFF;
  --accent: #2DD4BF;
  --accent-hover: #5EEAD4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
}

/* ---------- BASE ---------- */
html, body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  transition: var(--transition);
}

body {
  background-color: var(--bg) !important;
}

section, .mbr-section {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  transition: var(--transition);
}

#content10-22,
#gallery2-6,
#content4-1q,
#form3-b,
#clients1-1u {
  background-color: var(--bg-alt) !important;
}

#header14-1j {
  background-color: var(--bg-alt) !important;
}

[data-theme="dark"] .mbr-overlay {
  background-color: rgba(0,0,0,.6) !important;
  opacity: 1 !important;
}

/* ---------- TEXT ---------- */
h1, h2, h3, h4, h5, h6,
.mbr-section-title,
.mbr-fonts-style {
  color: var(--text) !important;
}

p, .mbr-text, .mbr-section-subtitle {
  color: var(--text-muted) !important;
}

/* ---------- LINKS ---------- */
a { color: var(--accent); transition: color .2s ease; }
a:hover { color: var(--accent-hover); }

/* ---------- CARDS ---------- */
.item-wrapper,
.plan,
.features-image .item-wrapper {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, var(--transition);
}

.item-wrapper:hover,
.plan:hover,
.features-image .item-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ---------- NAVBAR ---------- */
.navbar, .navbar-dropdown {
  background: color-mix(in srgb, var(--bg) 92%, transparent) !important;
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar .navbar-caption,
.navbar .nav-link {
  color: var(--text) !important;
}

.navbar .nav-link:hover {
  color: var(--accent) !important;
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #06241f !important;
  font-weight: 600;
  border-radius: 8px;
  transition: transform .15s ease, background .2s ease;
}
.btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  transform: translateY(-1px);
}

.btn-success {
  background: transparent !important;
  border: 1.5px solid var(--accent) !important;
  color: var(--accent) !important;
  border-radius: 8px;
}
.btn-success:hover {
  background: var(--accent) !important;
  color: #06241f !important;
}

.btn-black {
  background: var(--brand) !important;
  color: #ffffff !important;
  border-radius: 8px;
}

/* ---------- FORMS ---------- */
.form-control {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
}
.form-control::placeholder { color: var(--text-muted); }

/* ---------- FOOTER ---------- */
.footer6, footer {
  background: var(--bg-alt) !important;
  border-top: 1px solid var(--border);
}

/* ==========================================
   THEME TOGGLE BUTTON (floating, bottom-right)
   ========================================== */
#theme-toggle {
  position: fixed;
  right: 22px;
  bottom: 96px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12),
              0 0 0 0 rgba(0, 184, 169, 0);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  z-index: 1050;
  transition: transform .25s cubic-bezier(.2,.8,.2,1),
              box-shadow .25s ease,
              background .3s ease,
              border-color .3s ease;
}

#theme-toggle:hover {
  transform: translateY(-3px) rotate(15deg) scale(1.06);
  box-shadow: 0 10px 30px rgba(0, 184, 169, 0.35),
              0 0 0 4px rgba(0, 184, 169, 0.12);
  border-color: var(--accent);
}

#theme-toggle:active {
  transform: translateY(-1px) scale(1.02);
}

#theme-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1),
              opacity .3s ease;
}

#theme-toggle .icon-sun { display: none; }

[data-theme="dark"] #theme-toggle .icon-sun {
  display: block;
  animation: iconPop .4s cubic-bezier(.4, 0, .2, 1);
}
[data-theme="dark"] #theme-toggle .icon-moon {
  display: none;
}
[data-theme="light"] #theme-toggle .icon-moon,
:root:not([data-theme="dark"]) #theme-toggle .icon-moon {
  display: block;
  animation: iconPop .4s cubic-bezier(.4, 0, .2, 1);
}

@keyframes iconPop {
  from { transform: rotate(-90deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(0deg) scale(1);      opacity: 1; }
}

#theme-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: var(--text);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

#theme-toggle:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (hover: none) {
  #theme-toggle::after { display: none; }
}

@media (max-width: 768px) {
  #theme-toggle {
    right: 16px;
    bottom: 80px;
    width: 44px;
    height: 44px;
  }
  #theme-toggle svg { width: 20px; height: 20px; }
}

/* ==========================================
   CONTRAST OVERRIDES
   Keeps text readable on always-dark sections
   ========================================== */

/* NAVBAR: always white text (sits over dark hero) */
.navbar .navbar-caption,
.navbar .navbar-caption-wrap a,
.navbar .nav-link,
.navbar .navbar-brand a {
  color: #ffffff !important;
}

.navbar .nav-link:hover {
  color: var(--accent) !important;
}

.navbar .hamburger span {
  background-color: #ffffff !important;
}

/* HERO: always white text */
#header14-1f,
#header14-1f h1,
#header14-1f h2,
#header14-1f p,
#header14-1f .mbr-text,
#header14-1f .mbr-section-title {
  color: #ffffff !important;
}

/* ABOUT US: white text (has dark overlay) */
#header14-1j .mbr-section-title,
#header14-1j .mbr-text,
#header14-1j p {
  color: #ffffff !important;
}

/* PROJECTS: white text (has dark overlay) */
#gallery4-9 .mbr-section-title,
#gallery4-9 .mbr-section-subtitle,
#gallery4-9 .mbr-item-subtitle,
#gallery4-9 p,
#gallery4-9 h3,
#gallery4-9 h4,
#gallery4-9 h6 {
  color: #ffffff !important;
}

/* CORE VALUES: white text (has dark overlay) */
#content4-1q .mbr-section-title,
#content4-1q .mbr-section-subtitle {
  color: #ffffff !important;
}

/* CONTACTS: overlay tuning for dark mode */
[data-theme="dark"] #contacts3-a .mbr-overlay {
  background-color: rgba(0, 0, 0, 0.6) !important;
}

/* ==========================================
   KILL ANIMATIONS ON THE TOGGLE BUTTON
   Animate.css classes were preventing clicks
   ========================================== */
#theme-toggle,
#theme-toggle.animate__animated,
#theme-toggle.animate__fadeInUp,
#theme-toggle[class*="animate__"] {
  animation: none !important;
  -webkit-animation: none !important;
  transform: none !important;
  -webkit-transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2147483647 !important;
}

/* Tooltip shouldn't block clicks */
#theme-toggle::after {
  pointer-events: none !important;
}

/* SVG shouldn't be the click target */
#theme-toggle > * {
  pointer-events: none !important;
}

/* Push scroll-to-top below the toggle */
.scrollToTop,
.mbr-arrow-up {
  z-index: 9990 !important;
}