/* ==========================================================
   salesSATHI - Language switcher + Light / Dark theme
   Same controls as the Dayal Group website.
   Load this file AFTER the page's own <style> block.
   ========================================================== */

/* ---------- Colours of the language / theme controls ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --dg-accent: #5ecf7a;
  --tool-bg: rgba(19, 31, 20, .85);
  --tool-ink: #e8f5e9;
  --tool-muted: #8ab89a;
  --tool-line: rgba(46, 168, 79, .4);
  --tool-hover: rgba(46, 168, 79, .16);
  --tool-active: rgba(46, 168, 79, .26);
  --panel-bg: #131f14;
  --panel-shadow: 0 18px 48px rgba(0, 0, 0, .6);
}
html[data-theme="light"] {
  color-scheme: light;
  --dg-accent: #1a7a35;
  --tool-bg: #ffffff;
  --tool-ink: #13261a;
  --tool-muted: #4f6b58;
  --tool-line: rgba(26, 122, 53, .25);
  --tool-hover: rgba(46, 168, 79, .1);
  --tool-active: rgba(46, 168, 79, .18);
  --panel-bg: #ffffff;
  --panel-shadow: 0 18px 48px rgba(10, 30, 15, .18);
}

/* ---------- Placement in the salesSATHI navbar ---------- */
#navbar { justify-content: flex-start; }
#navbar .nav-links { margin-left: auto; align-items: center; }
#navbar .nav-tools { margin-left: 1.5rem; }
#navbar .hamburger { margin-left: .75rem; }
#navbar .tool-btn { font-family: 'Nunito', sans-serif; }
@media (max-width: 991px) {
  #navbar .nav-tools { margin-left: auto; margin-block: 0; flex-wrap: nowrap; }
  #navbar .lang-wrap { flex: 0 0 auto; }
  /* the dropdown opens as a full-width panel below the navbar */
  #navbar .lang-panel {
    position: fixed;
    top: 74px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 96px);
    margin: 0;
    box-shadow: var(--panel-shadow);
  }
}
@media (max-width: 575px) {
  #navbar { padding: 0 1rem; }
  #navbar .lang-current { display: none; }   /* small phones: icon only */
  #navbar .nav-tools { gap: .4rem; }
}

/* ---------- Navbar tools (language + theme) ---------- */
.nav-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-inline: .5rem;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: .3rem .85rem;
  border: 1px solid var(--tool-line);
  border-radius: 999px;
  background: var(--tool-bg);
  color: var(--tool-ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease;
}
.tool-btn:hover { background: var(--tool-hover); border-color: var(--dg-accent); }
.tool-btn:focus-visible,
.lang-opt:focus-visible,
.lang-search:focus-visible {
  outline: 2px solid var(--dg-accent);
  outline-offset: 2px;
}
.tool-btn.icon-only { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 1rem; }

/* Perfect centring: Bootstrap Icons pushes every glyph down by .125em,
   so inside these buttons the icons are boxed and reset */
.tool-btn > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}
.tool-btn > i::before { display: block; line-height: 1; vertical-align: 0; }
.tool-btn.icon-only > i { font-size: 1.05rem; }
.tool-caret { font-size: .7rem; transition: transform .2s ease; }
.lang-btn[aria-expanded="true"] .tool-caret { transform: rotate(180deg); }
/* Show the full language name - never truncate it; one tight line box
   so flexbox centres the letters themselves */
.lang-current { display: block; overflow: visible; line-height: 1.2; }
/* Fine-tuning per script: each script's letters sit differently in their line,
   so the label is nudged by a measured amount to look truly centred */
.lang-current { transform: translateY(var(--lang-nudge, 0px)); }
html:is([lang="hi"], [lang="mr"], [lang="ne"], [lang="sa"], [lang="mai"], [lang="doi"], [lang="brx"], [lang="kok"]) { --lang-nudge: 1.5px; }
html:is([lang="bn"], [lang="as"], [lang="mni"]) { --lang-nudge: 1px; }
html[lang="pa"] { --lang-nudge: 2.8px; }
html[lang="gu"] { --lang-nudge: 1.2px; }
html[lang="ta"] { --lang-nudge: .7px; }
html[lang="te"] { --lang-nudge: 2.6px; }
html[lang="kn"] { --lang-nudge: 1.5px; }
html[lang="ks"] { --lang-nudge: 2.4px; }
html[lang="sd"] { --lang-nudge: -1.3px; }
html[lang="ar"] { --lang-nudge: .9px; }
html:is([lang="zh"], [lang="ja"], [lang="ko"]) { --lang-nudge: -1.1px; }
html[lang="ur"] { --lang-nudge: -2px; }
html[lang="ur"] .lang-current { line-height: 1.9; }

.lang-wrap { position: relative; }
.lang-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1100;
  width: min(480px, 94vw);
  max-height: min(72vh, 520px);
  overflow-y: auto;
  padding: .6rem;
  border: 1px solid var(--tool-line);
  border-radius: 14px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}
.lang-panel[hidden] { display: none; }

.lang-search {
  width: 100%;
  height: 40px;
  margin-bottom: .5rem;
  padding: 0 .8rem;
  border: 1px solid var(--tool-line);
  border-radius: 10px;
  background: transparent;
  color: var(--tool-ink);
  font: inherit;
  font-size: .9rem;
}
.lang-search::placeholder { color: var(--tool-muted); }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}
.lang-group {
  grid-column: 1 / -1;
  margin: .6rem .75rem .2rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--tool-line);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--tool-muted);
}
.lang-group[hidden] { display: none; }

.lang-opt {
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: .5rem .75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tool-ink);
  text-align: start;
  cursor: pointer;
}
.lang-opt:hover { background: var(--tool-hover); }
.lang-opt[aria-current="true"] { background: var(--tool-active); }
.lang-opt[aria-current="true"] .native::after { content: "  \2713"; color: var(--dg-accent); }
.lang-opt .native,
.lang-opt .eng {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-align: left;
}
.lang-opt .native { font-size: 1rem; font-weight: 600; line-height: 1.7; }
/* Nastaliq (Urdu) has very tall letters, give it extra room so nothing is clipped */
.lang-opt[data-lang="ur"] .native { line-height: 2.3; }
.lang-opt .eng { font-size: .75rem; color: var(--tool-muted); }
.lang-opt[hidden] { display: none; }
.lang-empty { margin: .5rem .25rem; font-size: .85rem; color: var(--tool-muted); }

/* The language menu keeps a neutral UI font whatever language the page is in;
   only each native name uses its own script font. */
html .lang-panel :is(.lang-search, .eng, .lang-empty),
html .lang-opt:not([data-script-font]) .native,
html .lang-btn .lang-current:lang(en) {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
html[data-script] .lang-panel :is(.lang-search, .eng, .lang-empty),
html[data-script] .lang-opt:not([data-script-font]) .native {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
/* Native names always render in their own script font */
.lang-opt[data-script-font] .native { font-family: var(--opt-font), system-ui, sans-serif; }

@media (max-width: 991.98px) {
  .nav-tools { margin: .75rem 0; flex-wrap: wrap; }

  .lang-wrap { flex: 1 1 auto; }
  .lang-panel {
    position: static;
    width: 100%;
    max-height: 55vh;
    margin-top: .5rem;
    box-shadow: none;
  }
}
@media (max-width: 380px) {
  .lang-grid { grid-template-columns: 1fr; }
}

/* ---------- Script fonts for Indian languages ---------- */
html[data-script] body,
html[data-script] :is(h1, h2, h3, h4, h5, h6, p, a, span, li, small, em, button, input, label, .nav-link, .dropdown-item, .btn-dg, .btn-ghost, .stat-label) {
  font-family: var(--script-font), "Segoe UI", system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
/* Indic scripts need a little more vertical room for matras and conjuncts */
html[data-script] :is(h1, h2, h3) { line-height: 1.4; }
html[data-script] p { line-height: 1.75; }

/* Urdu, Kashmiri, Sindhi: the words read right-to-left (needed for correct
   letter and punctuation order) but every block KEEPS the same alignment as
   the English page. The JS pins each element's original alignment inline. */
html[data-dir="rtl"] :is([data-i18n], [data-i18n-html]) { direction: rtl; unicode-bidi: isolate; }
/* Arabic, Urdu, Kashmiri, Sindhi all follow the same rule above. */
html[lang="ur"] [data-i18n] { line-height: 2.1; }

/* ==========================================================
   LIGHT THEME (the original dark design stays the default)
   ========================================================== */
html[data-theme="light"] {
  --green-light: #1f8a3f;
  --orange-light: #e0601f;
  --black: #f5faf6;
  --dark: #e9f4ec;
  --card-bg: #ffffff;
  --text: #13261a;
  --muted: #4f6b58;
  --glow: 0 0 28px rgba(46, 168, 79, .22);
}
html[data-theme="light"] ::-webkit-scrollbar-track { background: #e9f4ec; }

/* Navbar: light text over the dark hero, dark text once it turns white */
html[data-theme="light"] #navbar.scrolled { background: rgba(255, 255, 255, .95); box-shadow: 0 2px 24px rgba(10, 30, 15, .12); }
html[data-theme="light"] #navbar:not(.scrolled) .nav-links a:not(.nav-cta) { color: #ffffff; }
html[data-theme="light"] #navbar:not(.scrolled) .hamburger { color: #5ecf7a; }
html[data-theme="light"] .mobile-nav { background: rgba(255, 255, 255, .98); border-bottom-color: rgba(26, 122, 53, .15); }

/* Hero keeps its dark photo, so its text stays light */
html[data-theme="light"] #hero {
  --text: #e8f5e9;
  --muted: #b9d6c2;
  --green-light: #5ecf7a;
  --orange-light: #ff7a3d;
  color: var(--text);
}

/* Cards and panels */
html[data-theme="light"] :is(.feature-card, .module-card, .how-visual, .cta-action-card) {
  border-color: rgba(26, 122, 53, .18);
  box-shadow: 0 4px 18px rgba(10, 30, 15, .06);
}
html[data-theme="light"] .about-pill { background: #e3f4e8; border-color: rgba(26, 122, 53, .25); }
html[data-theme="light"] .metric-bar-wrap { background: #dcebdf; }
html[data-theme="light"] .step-num { box-shadow: 0 0 16px rgba(46, 168, 79, .25); }

/* Call-to-action section */
html[data-theme="light"] #cta { background: linear-gradient(135deg, #dff2e5, #eef6e2); }
html[data-theme="light"] #cta .section-title { color: var(--text); }
html[data-theme="light"] .cta-box { background: rgba(255, 255, 255, .72); border-color: rgba(26, 122, 53, .25); }
html[data-theme="light"] .cta-badge { background: rgba(46, 168, 79, .1); }
html[data-theme="light"] #cta .cta-action-card { background: #ffffff !important; }

/* Footer */
html[data-theme="light"] #footer { background: #e6f1e9; border-top-color: rgba(26, 122, 53, .18); }
html[data-theme="light"] .footer-divider { border-color: rgba(26, 122, 53, .2); }
html[data-theme="light"] .social-icon { border-color: rgba(26, 122, 53, .25); }

/* Back-to-top button: green on the light page */
html[data-theme="light"] #backToTop { background: var(--green); color: #ffffff; }

/* Smooth colour change only when the visitor flips the theme (not on page load) */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-anim *, .tool-btn, .tool-caret { transition: none !important; }
}

/* ---------- Automatic translation: hide Google's own toolbar, tooltips and highlights ---------- */
body > .skiptranslate,
iframe.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
#dg-gt { display: none !important; }
html.dg-auto body { top: 0 !important; position: static !important; }
.goog-text-highlight,
html.dg-auto font { background: none !important; box-shadow: none !important; }
/* Google flips the page right-to-left for Urdu/Arabic/Sindhi; keep the layout as designed */
html.translated-rtl body { direction: ltr; }

/* ---------- No English flash while a language is being applied ---------- */
html.dg-pending body { visibility: hidden; }
html.dg-auto-wait body > *:not(#loader) { visibility: hidden; }

/* Wide letter-spacing pulls Indian-script letters apart: switch it off in those languages */
html[data-script] :is(.section-label, .hero-badge, .footer-heading, .nav-links a, .cta-badge, .about-pill, .mobile-nav a) {
  letter-spacing: normal;
  font-family: var(--script-font), "Segoe UI", system-ui, sans-serif;
}

/* ---------- Hover: keep the button solid so its text never disappears over the hero photo ---------- */
#navbar .tool-btn:hover,
#navbar .lang-btn[aria-expanded="true"] {
  background: linear-gradient(var(--tool-hover), var(--tool-hover)), var(--tool-bg);
  color: var(--tool-ink);
}

/* ---------- Responsive navbar ----------
   Menu links never break onto two lines. When they do not fit (smaller
   laptops, longer languages) the script adds .nav-compact and the
   navbar switches to the menu button, exactly like on mobile. */
#navbar .nav-links a { white-space: nowrap; }
#navbar.nav-compact .nav-links { display: none; }
#navbar.nav-compact .hamburger { display: block; }
#navbar.nav-compact .nav-tools { margin-left: auto; }

/* ---------- Long words never push the page wider than the screen ---------- */
:is(.hero-title, .section-title, .hero-sub, .section-sub, .feature-card, .module-card, .step-content, .cta-action-card) {
  overflow-wrap: anywhere;
}
html[data-script] .hero-title { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.25; }