/* ==========================================================================
   Stepwize Mobile Translation Helper
   Distinct namespace (.translation-helper-*) — does not reuse or collide
   with .contextual-guidance-wrapper / .guidance-* (a separate, untouched
   system defined in contextual_guidance.css).
   ========================================================================== */

.translation-helper-wrapper {
  display: none; /* desktop default: never shown, regardless of JS state */
}

@media (max-width: 768px) {
  .translation-helper-wrapper {
    display: block;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px); /* above the bottom nav, pwa_base.css §7b */
    z-index: 998; /* just under --guidance-z-floating (999) so the two never fight for the same layer if both happen to be visible at once */
    animation: translationHelperSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Leave the bottom-right corner to the 44px Need Help launcher (+ 8px gap),
     so the two sit side by side instead of the launcher stacking above a card
     whose height depends on the variant (need_help_launcher.css). */
  .pwa-root:has(.need-help-button) .translation-helper-wrapper {
    right: calc(12px + 44px + 8px);
  }

  /* While the card shows, content can scroll clear of it: 214px = nav 64 + 12 +
     the tallest variant (126px, standalone, measured at 390px) + 12.
     need_help_launcher.css repeats this so it also wins over its pill rule. */
  .pwa-root:has([data-mobile-nav]):has(.translation-helper-wrapper:not(.is-hidden)) .dashboard-main,
  .pwa-root:has([data-mobile-nav]):has(.translation-helper-wrapper:not(.is-hidden)) .employee-dashboard-main {
    padding-bottom: calc(214px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.translation-helper-wrapper.is-hidden {
  display: none !important;
}

.translation-helper-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #00008B;
  border-radius: 12px;
  padding: 0.75rem 2rem 0.75rem 0.875rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 139, 0.12), 0 8px 10px -6px rgba(0, 0, 139, 0.06);
}

.translation-helper-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.translation-helper-body {
  flex: 1;
  min-width: 0;
}

.translation-helper-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #334155;
}

.translation-helper-text strong:first-child {
  display: block;
  color: #00008B;
  font-size: 0.8125rem;
  margin-bottom: 0.125rem;
}

.translation-helper-dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.translation-helper-dismiss:hover {
  background: #f1f5f9;
  color: #334155;
}

@keyframes translationHelperSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .translation-helper-wrapper {
    animation: none;
  }
}
