/* ===========================================================================
 * What every base template shows the same way - the sandbox banner, the toast
 * container, the Thesr Sync dialog, the old-browser warning - written here
 * rather than in a style="" attribute on each of them.
 *
 * Loaded by base.html, base_app.html, base_nostyle.html and sync/base_iframe.html.
 * An inline style attribute is what the Content Security Policy's
 * style-src-attr refuses, and these were most of the reports on every page
 * (22 September).
 * ======================================================================== */

/* Le rappel d'essai, en pastille plutôt qu'en bandeau.
 *
 * Il occupait toute la largeur, en jaune d'alerte, en permanence : le premier
 * mot que lisait un prospect était « limitée ». La phrase reste - une durée et
 * un quota se disent - mais posée en bas, discrète, et transparente aux clics
 * pour ne couvrir aucun bouton (23 septembre). */
.sandbox-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  padding: 0 1rem 0.75rem;
  pointer-events: none;
}
.sandbox-banner__pill {
  max-width: min(100%, 34rem);
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
}

.sync-modal__body {
  height: 80vh;
}
.sync-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Thesr Sync's list of categories to file into (sync/pending.html). */
.sync-cat-tree {
  width: 100%;
  max-height: 200px;
  overflow: auto;
  border: 1px solid #ccc;
  padding: 4px;
}

/* The old-browser warning: hidden until browser_check.js shows it (it sets
   display: flex itself); the <noscript> one is shown as soon as it exists. */
.unsupported-browser-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.97);
  z-index: 20000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}
.unsupported-browser-overlay--noscript {
  display: flex;
}

/* A progress bar whose width is data (data-progress, applied by
   page_actions.js through the CSSOM) starts empty rather than full. */
[data-progress] {
  width: 0;
}
.progress--thin {
  height: 6px;
}

/* What showAlert() puts on the screen (static/js/modules/utils.js).
 *
 * It was defined in style.css, which only the public pages load: in the
 * application the message was appended to the end of <body> with no position
 * at all, which put it exactly one pixel below the fold - a refusal nobody
 * could see. Clicking the bin on a category one may not delete therefore did
 * nothing at all, as far as the screen was concerned (reported 23 September).
 */
.custom-alert {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  min-width: 200px;
  max-width: 90%;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.97;
}

/* Le rappel laisse passer les clics, sauf son lien : la découverte se voit une
 * fois, puis l'application s'ouvre normalement, et il n'y avait plus aucun
 * moyen de la remontrer - ce qu'on fait pourtant devant quelqu'un. */
.sandbox-banner__pill a {
  pointer-events: auto;
  margin-left: 0.5rem;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(15, 23, 42, 0.15);
  color: var(--c-brand, #17356b);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.sandbox-banner__pill a:hover,
.sandbox-banner__pill a:focus-visible { text-decoration: underline; }
/* Sur un téléphone, la phrase entière tenait sur deux lignes et couvrait le
   bas de la page : la version courte, le reste au survol (title). */
.sandbox-banner__short { display: none; }
@media (max-width: 576px) {
  .sandbox-banner__long { display: none; }
  .sandbox-banner__short { display: inline; }
}

/* A tree's name ends in « … » when it does not fit. Where a label is a one-line
   flex row (toggle, icon, name), a bare text node in it was cut mid-letter
   instead - « Bibliothèque Cabinet Martin & Asso » in the search's filters
   (25 September). Here because trees are mounted under every base template:
   the application, the Organiser, Thesr Sync's pending page. The name keeps
   its label's white-space, so the trees whose labels wrap still wrap. */
.tree-with-checkbox .label-text .label-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The message after a deletion (utils.showTrashToast, 26 September): what
   went to the trash, « Annuler », and the way to the trash. Complete here,
   since the app's pages do not load the site's style.css. */
.trash-toast {
  min-width: 300px;
  max-width: 440px;
  margin-top: 10px;
  padding: 12px 14px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #0f1d33;
  color: #f1f5f9;
  box-shadow: 0 18px 40px -16px rgba(7, 15, 28, 0.6);
  font-size: 0.92rem;
}
.trash-toast .toast-body { padding: 0; gap: 14px; }
.trash-toast .fa-trash-can { color: #f2b544; }
.trash-toast__undo {
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f1d33;
  font-weight: 600;
  padding: 4px 12px;
}
.trash-toast__undo:hover { background: #e2e8f0; }
.trash-toast__link { color: rgba(241, 245, 249, 0.8); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 2px; }
.trash-toast__link:hover { color: #ffffff; }
.trash-toast .toast-progress {
  height: 3px;
  width: 0;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(242, 181, 68, 0.8);
}
