/**
 * Roadmap ERP - Minimal Bottom-Center Tutorial Suggestion Notification
 * Lightweight, non-intrusive, automatically triggered contextual assistance.
 * Appears ONLY on related ERP operational module pages (e.g. Inventory, Purchase, Sales).
 * Centered horizontally at the bottom of the screen.
 * WCAG 2.2 AA Compliant | Pure CSS & Hardware-Accelerated Transforms
 */

:root {
  --rm-tt-primary: #ff9e22;
  --rm-tt-primary-hover: #ea8b13;
  --rm-tt-primary-light: #fff7ed;
  --rm-tt-text-main: #0f172a;
  --rm-tt-text-muted: #64748b;
  --rm-tt-bg: #ffffff;
  --rm-tt-border: #e2e8f0;
  --rm-tt-border-hover: #cbd5e1;
  --rm-tt-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.9);
  --rm-tt-radius: 12px;
  --rm-tt-zindex: 99999;
  --rm-tt-progress-bg: rgba(255, 158, 34, 0.18);
  --rm-tt-progress-bar: #ff9e22;
}

/* Dark mode / ERP dark theme support */
[data-theme="dark"] .rm-tutorial-toast,
.dark .rm-tutorial-toast {
  --rm-tt-bg: #18222e;
  --rm-tt-text-main: #f8fafc;
  --rm-tt-text-muted: #94a3b8;
  --rm-tt-border: #334155;
  --rm-tt-border-hover: #475569;
  --rm-tt-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --rm-tt-primary-light: rgba(255, 158, 34, 0.14);
}

/* Strictly Center-Bottom Floating Toast Container */
.rm-tutorial-toast {
  position: fixed !important;
  bottom: 24px !important;
  left: 50% !important;
  right: auto !important;
  transform: translate(-50%, 18px) scale(0.98) !important;
  width: max-content !important;
  max-width: min(92vw, 480px) !important;
  background: var(--rm-tt-bg) !important;
  border-radius: var(--rm-tt-radius) !important;
  box-shadow: var(--rm-tt-shadow) !important;
  border: 1px solid var(--rm-tt-border) !important;
  z-index: var(--rm-tt-zindex) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 280ms !important;
}

.rm-tutorial-toast * {
  box-sizing: border-box;
}

/* Active Visible State: Floating slightly above bottom edge in center */
.rm-tutorial-toast.rm-active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, 0) scale(1) !important;
  pointer-events: auto !important;
}

/* Exit State: Smooth slide-down & fade-out */
.rm-tutorial-toast.rm-exiting {
  opacity: 0 !important;
  transform: translate(-50%, 14px) scale(0.98) !important;
  pointer-events: none !important;
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 220ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Subtle Animated Countdown Progress Bar at Top */
.rm-toast-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--rm-tt-progress-bg);
  overflow: hidden;
  z-index: 2;
}

.rm-toast-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--rm-tt-primary), #ff7a00);
  transform-origin: left center;
  transition: transform 100ms linear;
}

/* Minimal Notification Inner Row */
.rm-toast-body {
  padding: 10px 14px 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  line-height: 1;
}

/* Video / Tutorial Icon */
.rm-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--rm-tt-primary-light);
  color: var(--rm-tt-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rm-toast-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Short Contextual Message */
.rm-toast-message {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--rm-tt-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Clickable YouTube Tutorial Link */
.rm-toast-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rm-tt-primary) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--rm-tt-primary-light);
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
  flex-shrink: 0;
}

.rm-toast-link:hover {
  background: rgba(255, 158, 34, 0.22);
  color: var(--rm-tt-primary-hover) !important;
  transform: translateY(-1px);
}

.rm-toast-link:active {
  transform: translateY(0);
}

.rm-toast-link:focus-visible {
  outline: 2px solid var(--rm-tt-primary);
  outline-offset: 2px;
}

.rm-toast-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Close Icon (X) */
.rm-toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--rm-tt-text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: color 150ms ease, background-color 150ms ease;
}

.rm-toast-close-btn:hover,
.rm-toast-close-btn:focus-visible {
  color: var(--rm-tt-text-main);
  background-color: var(--rm-tt-border);
  outline: none;
}

.rm-toast-close-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Hard suppression of any legacy floating tutorials button */
#rm-tutorial-launcher,
.rm-tutorial-launcher {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .rm-tutorial-toast,
  .rm-tutorial-toast.rm-active,
  .rm-tutorial-toast.rm-exiting,
  .rm-toast-progress-fill {
    transition: none !important;
    animation: none !important;
    transform: translate(-50%, 0) !important;
  }
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 560px) {
  .rm-tutorial-toast {
    bottom: 16px !important;
    width: calc(100vw - 32px) !important;
    max-width: none !important;
  }

  .rm-toast-body {
    padding: 9px 12px;
    gap: 10px;
    justify-content: space-between;
  }

  .rm-toast-message {
    font-size: 13px;
  }

  .rm-toast-link {
    font-size: 12.5px;
    padding: 3px 6px;
  }
}

/* Optical vertical alignment for "Start Now" / CTA buttons with right-arrow icon */
.arrowTrail .bg-btn,
.arrowTrial .bg-btn,
.arrowtrial .bg-btn {
  display: inline-flex !important;
  align-items: center !important;
}

.arrowTrail .bg-btn > span,
.arrowTrial .bg-btn > span,
.arrowtrial .bg-btn > span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.arrowTrail .bg-btn svg,
.arrowTrial .bg-btn svg,
.arrowtrial .bg-btn svg {
  display: inline-block !important;
  position: relative !important;
  top: -3px !important;
  vertical-align: middle !important;
}

