/* EZ Support Hub (SUPPORTHUB): one button holding Accessibility + Contact us.
   Accessibility opens the EZ Accessability menu (js/ez-accessability.js), which shows no
   button of its own while the hub is on the page. The contact button (#fw-trigger-btn) is
   hidden, not removed, and the hub triggers it. The hiding rule applies only once the hub
   has mounted (html.ez-sh-on). */

html.ez-sh-on body #fw-trigger-btn { display: none !important; }

.ez-sh {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 9999;
  font-family: inherit;
}
html:not([dir="rtl"]) .ez-sh { left: auto; right: 20px; }

.ez-sh-btn {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--notification-color, #016ce4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(1, 108, 228, .4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ez-sh-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(1, 108, 228, .5); }
.ez-sh-btn:active { transform: scale(.95); }
.ez-sh-btn:focus-visible,
.ez-sh-opt:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--notification-color, #016ce4); }

/* chat-bubble badge on the corner: tells at a glance that contact lives here too */
.ez-sh-badge {
  position: absolute;
  bottom: -3px;
  inset-inline-end: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: var(--notification-color, #016ce4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: opacity .15s ease;
}

.ez-sh-x { display: none; }
.ez-sh-open .ez-sh-btn .ez-sh-person,
.ez-sh-open .ez-sh-badge { display: none; }
.ez-sh-open .ez-sh-btn .ez-sh-x { display: block; }

/* options: stacked above the button, aligned to the button's side */
.ez-sh-menu {
  position: absolute;
  bottom: 58px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end; /* cross-end = the hub's own edge, in both directions */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
html:not([dir="rtl"]) .ez-sh-menu { left: auto; right: 0; }
.ez-sh-open .ez-sh-menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .18s ease, transform .18s ease;
}
/* keeps the pointer inside the hub while it travels from the button to an option */
.ez-sh-menu::after { content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; }

.ez-sh-opt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 6px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ez-sh-opt[hidden] { display: none; }
.ez-sh-opt:hover { transform: translateX(2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .25); }
html:not([dir="rtl"]) .ez-sh-opt { padding: 0 6px 0 14px; }
html:not([dir="rtl"]) .ez-sh-opt:hover { transform: translateX(-2px); }
.ez-sh-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--notification-color, #016ce4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ez-sh-ic svg { width: 18px; height: 18px; }

/* SUPPORTHUBMOBILE - Phones: docked tab. Smaller, faded and tucked into the screen edge so it never sits on
   lesson content; a tap brings it fully in and opens the two options. */
@media (max-width: 768px) {
  .ez-sh { bottom: 16px; left: 0; }
  html:not([dir="rtl"]) .ez-sh { left: auto; right: 0; }
  .ez-sh-btn,
  .ez-sh-btn:hover,
  .ez-sh-btn:active {
    width: 40px;
    height: 40px;
    padding-left: 14px;
    opacity: .75;
    transform: translateX(-35%);
    box-shadow: 0 2px 8px rgba(1, 108, 228, .35);
  }
  html:not([dir="rtl"]) .ez-sh-btn,
  html:not([dir="rtl"]) .ez-sh-btn:hover,
  html:not([dir="rtl"]) .ez-sh-btn:active {
    padding-left: 0;
    padding-right: 14px;
    transform: translateX(35%);
  }
  .ez-sh-open .ez-sh-btn,
  .ez-sh-open .ez-sh-btn:hover,
  .ez-sh-btn:focus-visible {
    padding: 0;
    opacity: 1;
    transform: none;
  }
  .ez-sh-person { width: 20px; height: 20px; }
  .ez-sh-badge { inset-inline-end: auto; inset-inline-start: -3px; width: 16px; height: 16px; }
  .ez-sh-badge svg { width: 10px; height: 10px; }
  .ez-sh-menu { bottom: 50px; left: 10px; }
  html:not([dir="rtl"]) .ez-sh-menu { left: auto; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ez-sh-btn, .ez-sh-menu, .ez-sh-opt { transition: none; }
}
@media print { .ez-sh { display: none !important; } }
