/* Additions for the demo of the FlexStaff app (site/snippets/demo-app/document.php): the bar above
   the app and the note for controls that are switched off. The app itself is styled by flexstaff.css. */

:root {
  --demo-bar: 44px;
}

/* bar above the app; the app's sticky top bar and side menu move down by its height */
.demo-bar {
  position: sticky;
  top: 0;
  z-index: 1032;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--demo-bar);
  padding: 0 20px;
  background: var(--tm-inverse-surface, #1a1a1a);
  color: #fff;
  font-family: 'Instrument Sans', 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.3;
}

.demo-bar__text {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
}

.demo-bar__long {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-bar__text strong {
  flex: none;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffcc00;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-bar__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
}

.demo-bar__switch {
  display: flex;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.demo-bar__option {
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
}

.demo-bar__option.is-active {
  background: #fff;
  color: #1a1a1a;
}

.demo-bar__link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-bar__cta {
  padding: 6px 12px;
  border-radius: 8px;
  background: #2b5d9d;
  color: #fff;
  font-weight: 600;
}

.demo-bar a:hover,
.demo-bar a:focus {
  color: #fff;
  text-decoration: none;
}

.demo-bar__option.is-active:hover,
.demo-bar__option.is-active:focus {
  color: #1a1a1a;
}

.demo-bar a:focus-visible {
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}

body.tm-shell .tm-topbar {
  top: var(--demo-bar);
}

body.tm-shell .tm-shell__body {
  min-height: calc(100vh - 64px - var(--demo-bar));
}

body.tm-shell .tm-sidebar {
  top: calc(64px + var(--demo-bar));
  min-height: calc(100vh - 64px - var(--demo-bar));
}

body.tm-shell .tm-sidebar-backdrop {
  top: calc(64px + var(--demo-bar));
}

@media (min-width: 720px) {
  body.tm-shell .tm-sidebar {
    height: calc(100vh - 64px - var(--demo-bar));
  }
}

/* the drawer on small screens has a fixed height in the app, it ends at the lower edge of the screen */
@media (max-width: 719px) {
  body.tm-shell .tm-shell__body > .tm-sidebar {
    height: calc(100vh - 64px - var(--demo-bar));
    height: calc(100dvh - 64px - var(--demo-bar));
  }
}

.demo-bar__cta-short {
  display: none;
}

@media (max-width: 899px) {
  .demo-bar__long,
  .demo-bar__link {
    display: none;
  }
}

@media (max-width: 479px) {
  .demo-bar {
    gap: 8px;
    padding: 0 12px;
  }

  .demo-bar__actions {
    gap: 8px;
  }

  .demo-bar__cta {
    padding: 6px 10px;
  }

  .demo-bar__cta-long {
    display: none;
  }

  .demo-bar__cta-short {
    display: inline;
  }
}

/* links of the demo that stand in for the app's own */
.tm-design-switch > button {
  width: 100%;
}

/* note for controls that are switched off */
.demo-modal[hidden] {
  display: none;
}

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: 'Instrument Sans', 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.demo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
}

.demo-modal__box {
  position: relative;
  width: min(100%, 480px);
  padding: 28px;
  border: 1px solid var(--tm-border);
  border-radius: 16px;
  background: var(--tm-surface);
  box-shadow: 0 24px 60px rgba(26, 26, 26, 0.18);
  color: var(--tm-text);
}

.demo-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tm-muted);
  cursor: pointer;
}

.demo-modal__close:hover,
.demo-modal__close:focus-visible {
  background: var(--tm-surface-muted, rgba(127, 127, 127, 0.14));
  color: var(--tm-heading);
}

.demo-modal__close:focus-visible {
  outline: 2px solid var(--tm-primary, #2b5d9d);
  outline-offset: 2px;
}

.demo-modal__eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffcc00;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-modal__title {
  margin: 0 0 10px;
  color: var(--tm-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.demo-modal__text {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
}

.demo-modal__note {
  margin: 0 0 22px;
  color: var(--tm-muted);
  font-size: 14px;
  line-height: 1.45;
}

.demo-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* the website's trial form above the app (site/snippets/demo-app/form-frame.php); dimmed until the form has loaded */
.demo-form[hidden] {
  display: none;
}

.demo-form {
  position: fixed;
  inset: 0;
  z-index: 2100;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(9, 52, 106, 0.35);
}

.demo-form.is-ready {
  background: transparent;
}
