/* =========================
   ATID GLOBAL THEME (RESPONSIVE)
   HEADER + FOOTER + EXCEPTION MODAL
   ========================= */

/* ---------- Variables ---------- */
:root{
  --atid-blue:#2E456B;

  /* Desktop defaults (lg+) */
  --atid-bar-h: 80px;
  --atid-under-h: 92px;
  --atid-logo: 118px;

  --atid-logo-left: 50px;
  --atid-logo-up: 0px;

  --atid-border: 4px;
  --atid-pad: 12px;

  /* Help button */
  --atid-help-top: 18px;
  --atid-help-right: 26px;
  --atid-help-size: 25px;

  /* Footer width like old CSS */
  --atid-footer-max: 980px;
}

/* =========================
   HEADER (GLOBAL)
   ========================= */
[role="banner"]{
  position: relative !important;
  overflow: visible !important;
  background: var(--atid-blue) !important;
}

[role="banner"].navbar{
  min-height: var(--atid-bar-h) !important;
}

[role="banner"] .container,
[role="banner"] .container-fluid{
  min-height: var(--atid-bar-h) !important;
  position: relative !important;
}

.atid-header-underbar{
  position: absolute !important;
  top: var(--atid-bar-h) !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--atid-under-h) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  z-index: 10 !important;
}

[role="banner"] .atid-logo-wrap{
  position: absolute !important;
  left: var(--atid-logo-left) !important;
  top: var(--atid-bar-h) !important;
  transform: translateY(calc(var(--atid-logo) / -2 - var(--atid-logo-up))) !important;
  z-index: 1000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

[role="banner"] .navbar-brand,
[role="banner"] .navbar-brand img{
  max-height: none !important;
  height: auto !important;
}

[role="banner"] img.atid-logo{
  width: var(--atid-logo) !important;
  height: var(--atid-logo) !important;
  max-width: none !important;
  max-height: none !important;
  min-width: var(--atid-logo) !important;
  min-height: var(--atid-logo) !important;

  background: #fff !important;
  border-radius: 999px !important;
  border: var(--atid-border) solid var(--atid-blue) !important;
  padding: var(--atid-pad) !important;

  object-fit: contain !important;
  display: block !important;
}

/* Hide portal menus if not needed */
[role="banner"] #navbar,
[role="banner"] nav.menu-bar{
  display: none !important;
}
[role="banner"] .navbar-toggler{
  display: none !important;
}

main, #mainContent{
  padding-top: calc(var(--atid-bar-h) + var(--atid-under-h) - 10px) !important;
}

/* Help button */
.atid-help{
  position: absolute !important;
  right: var(--atid-help-right) !important;
  left: auto !important;
  top: var(--atid-help-top) !important;
  z-index: 2000 !important;
  font-size: var(--atid-help-size) !important;
  color: #707070 !important;
  line-height: 1.85 !important;
  font-weight: 700 !important;
}
.atid-help,
.atid-help:hover,
.atid-help:focus,
.atid-help:active{
  text-decoration: none !important;
}

/* =========================
   HOME PAGE OVERRIDE
   ========================= */
#atidHome{ direction: rtl; }
#atidHome, #atidHome *{ box-sizing: border-box; }

#mainContent:has(#atidHome),
main:has(#atidHome){
  padding-top: 0 !important;
}
body.atid-home main,
body.atid-home #mainContent{
  padding-top: 0 !important;
}

/* =========================
   FOOTER (GLOBAL)
   ========================= */
/* Sticky footer layout */
html, body{ height: 100%; }
body{ min-height: 100%; display: flex; flex-direction: column; }
main{ flex: 1 0 auto; }
.atid-footer{ flex-shrink: 0; }

#atidFooter.atid-footer{
  background: #ffffff !important;
  border-top: 1px solid #e6e6e6 !important;
}

#atidFooter .atid-footer-inner{
  max-width: var(--atid-footer-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 6px 12px !important;
  box-sizing: border-box !important;

  direction: rtl !important;
  text-align: right !important;

  color: #2f2f2f !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

/* base row */
#atidFooter .atid-footer-row{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

/**/
#atidFooter .atid-footer-row.atid-footer-bottom{
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: max-content !important;
  justify-content: center !important;
  justify-items: center !important;
  align-items: center !important;
  gap: 10px !important;
  direction: rtl !important;
}

#atidFooter .atid-footer-item{
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

#atidFooter .atid-footer-link{
  color: inherit !important;
  text-decoration: none !important;
}
#atidFooter .atid-footer-link:hover{
  text-decoration: underline !important;
}

#atidFooter .atid-icon{
  width: 18px !important;
  height: 18px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* desktop separators "•" */
#atidFooter .atid-footer-sep{
  position: relative !important;
  padding-left: 14px !important;
}
#atidFooter .atid-footer-sep::after{
  content: "•" !important;
  position: absolute !important;
  left: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #5f5f5f !important;
  font-weight: 700 !important;
}
#atidFooter .atid-footer-copyright{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#atidFooter .atid-footer-copy-icon{
  font-weight: 700;
  color: #5f5f5f;
  font-size: 18px; 
  line-height: 1;
}

/* =========================
   EXCEPTION MODAL
   ========================= */
#atidExcModal{
  direction: rtl;
  text-align: right;
}

#atidExcModal .atid-exc-dialog{
  width: auto !important;
  max-width: none !important;
  padding: 0 14px !important;
  margin: 0 auto !important;
}

#atidExcModal .atid-exc-card{
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15,23,42,0.08);
  overflow: hidden;

  width: fit-content !important;
  max-width: min(92vw, 760px) !important;
  min-width: min(92vw, 520px) !important;
  margin: 0 auto !important;
}

#atidExcModal .atid-exc-body{
  padding: 30px 34px 26px !important;
}

#atidExcModal .atid-exc-top{
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

#atidExcModal .atid-exc-badge{
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#atidExcModal .atid-exc-xicon{
  width: 46px !important;
  height: 46px !important;
  display: block !important;
}

#atidExcModal .atid-exc-text{
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

#atidExcModal #atidExcMsg{
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #3a3a3a !important;
  line-height: 1.45 !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

#atidExcModal .atid-exc-actions{
  display: flex !important;
  justify-content: center !important;
  margin-top: 18px !important;
}

#atidExcModal .atid-btn-primary{
  border: 0;
  border-radius: 12px;
  height: 44px;
  padding: 0 18px;
  background: #2E456B;
  color: #fff;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#atidExcModal .atid-btn-primary:hover{
  transform: translateY(-1px);
  background: #253a5c;
}

#atidExcModal .atid-btn-primary:active{
  transform: translateY(0);
}
/* ERROR (אדום) */
#atidExcModal .atid-exc-xicon circle[stroke],
#atidExcModal .atid-exc-xicon #atidExcIconMark{
  stroke:#E11D48 !important;
}

/* SUCCESS (ירוק) */
#atidExcModal.atid-success .atid-exc-xicon circle[stroke],
#atidExcModal.atid-success .atid-exc-xicon #atidExcIconMark{
  stroke:#16A34A !important;
}


/* =========================
   RESPONSIVE (Bootstrap breakpoints)
   ========================= */

/* xs (phones) */
@media (max-width: 575.98px){
  :root{
    --atid-bar-h: 64px;
    --atid-under-h: 66px;
    --atid-logo: 78px;

    --atid-logo-left: 14px;
    --atid-logo-up: 0px;

    --atid-border: 3px;
    --atid-pad: 9px;

    --atid-help-top: 8px;
    --atid-help-right: 14px;
    --atid-help-size: 20px;
    --atid-mobile-extra-top: 28px;
  }

  main, #mainContent{
    padding-top: calc(var(--atid-bar-h) + var(--atid-under-h) - 6px + var(--atid-mobile-extra-top)) !important;
  }

  /* Footer: mobile center + no separators */
  #atidFooter .atid-footer-sep{
    padding-left: 0 !important;
    display: block !important;
    max-width: 34ch !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }
  #atidFooter .atid-footer-sep::after{
    content: "" !important;
    display: none !important;
  }

  #atidFooter .atid-footer-inner{
    text-align: center !important;
    padding: 12px 14px !important;
    font-size: 12.5px !important;
  }

  #atidFooter .atid-footer-row.atid-footer-bottom{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
  }

  #atidFooter .atid-footer-item{
    justify-content: center !important;
    white-space: normal !important;
  }

  /* Exception modal responsive */
  #atidExcModal .atid-exc-card{
    min-width: min(92vw, 420px) !important;
    max-width: 92vw !important;
  }
  #atidExcModal .atid-exc-body{
    padding: 22px 20px 18px !important;
  }
  #atidExcModal .atid-exc-badge,
  #atidExcModal .atid-exc-xicon{
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
  }
  #atidExcModal #atidExcMsg{
    font-size: 16.5px !important;
  }
}

/* sm */
@media (min-width: 576px) and (max-width: 767.98px){
  :root{
    --atid-bar-h: 70px;
    --atid-under-h: 76px;
    --atid-logo: 92px;

    --atid-logo-left: 18px;

    --atid-help-top: 16px;
    --atid-help-right: 18px;
    --atid-help-size: 22px;
  }
}

/* md */
@media (min-width: 768px) and (max-width: 991.98px){
  :root{
    --atid-bar-h: 76px;
    --atid-under-h: 86px;
    --atid-logo: 104px;

    --atid-logo-left: 28px;

    --atid-help-top: 18px;
    --atid-help-right: 22px;
    --atid-help-size: 24px;
  }
}

html, body { height: 100%; }

body{
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

main, #mainContent{
  flex: 1 0 auto;
  display: block;
}

#atidFooter{
  flex-shrink: 0;
}

/* =========================
   HELP BUTTON
   ========================= */

/* בסיס: מיקום */
.atid-header-underbar a.atid-help{
  position: absolute;
  right: var(--atid-help-right);
  left: auto;
  top: var(--atid-help-top);
  z-index: 2000;

  /* keep link clean */
  text-decoration: none;
}

/* עיצוב: בועה עדינה כמו הכפתורים שלך */
.atid-header-underbar a.atid-help{
  --help-bg: rgba(238,242,247,0.85);
  --help-bg-hover: rgba(224,231,240,0.95);

  display: inline-flex;
  align-items: center;

  padding: 8px 14px;
  border-radius: 10px;     /* כמו הכפתורים שלך */
  border: 0;

  background: var(--help-bg);
  color: #334155;

  font-size: var(--atid-help-size);
  font-weight: 700;
  line-height: 1.2;

  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
  transition: background 120ms ease, box-shadow 120ms ease;
}

/* Hover ברור ועדין */
.atid-header-underbar a.atid-help:hover{
  background: var(--help-bg-hover);
  box-shadow: 0 6px 14px rgba(15,23,42,0.10);
}

/* Focus נגיש (מקלדת) */
.atid-header-underbar a.atid-help:focus-visible{
  outline: 3px solid rgba(46,69,107,0.28);
  outline-offset: 2px;
}

/* ביטול pseudo-icons אם הוגדרו בעבר */
.atid-header-underbar a.atid-help::before,
.atid-header-underbar a.atid-help::after{
  content: none;
}

/* הסתרה בעמוד הבית (אם יש לך body.atid-home) */
body.atid-home .atid-header-underbar a.atid-help{
  display: none;
}

