/*
 * Non-blocking messages, and the busy indicator, for both front ends.
 *
 * Replaces the Bootstrap modal / jQuery UI dialog / SweetAlert pop-ups that every fncShowMsg call
 * used to raise. Dependency-free, so the WebForms and the MVC app share one file. The busy
 * indicator lives in jsIDFToolV2.js instead, which injects its own styles - blockUI renders it
 * into arbitrary pages, so it must not depend on this file being linked.
 *
 * Follows the tool's palette - light blue accents, near-white ground, Roboto - rather than
 * introducing a second visual language.
 */

/* ============================================================== toasts ==== */

#idfccToasts {
    position: fixed;
    top: 88px;                  /* clear of the fixed navbar */
    right: 20px;
    z-index: 20000;             /* above modals (1050) and blockUI (1010) */
    width: 404px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;       /* the page stays clickable between toasts */
}

.idfcc-toast {
    --accent: #0b84c4;
    --tint: #eaf5fb;

    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 15px 15px 16px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    color: #16242c;
    box-shadow:
        0 0 0 1px rgba(16, 40, 56, .07),
        0 10px 28px -10px rgba(16, 40, 56, .35),
        0 2px 6px -2px rgba(16, 40, 56, .16);
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    animation: idfcc-toast-in .24s cubic-bezier(.16, .84, .32, 1);
}

.idfcc-toast--success { --accent: #1e874b; --tint: #e8f6ee; }
.idfcc-toast--error   { --accent: #c9372c; --tint: #fdecea; }
.idfcc-toast--info    { --accent: #0b84c4; --tint: #eaf5fb; }

/* A tinted chip carrying the glyph: colour without shouting, and it anchors the text block. */
.idfcc-toast__icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--tint);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    font-style: normal;
}

.idfcc-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    padding-right: 30px;        /* keeps text clear of the close button */
    padding-top: 2px;
}

.idfcc-toast__title {
    display: block;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .015em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 3px;
}

.idfcc-toast__title + span { color: #3d4f59; }

/* Repeat count: the same message arriving again bumps this instead of stacking another card. */
.idfcc-toast__count {
    display: inline-block;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 9px;
    background: var(--tint);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    vertical-align: 1px;
}

.idfcc-toast__close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: none;
    padding: 0;
    font-size: 22px;
    line-height: 28px;
    color: #8095a1;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.idfcc-toast__close:hover { background: rgba(16, 40, 56, .08); color: #16242c; }
.idfcc-toast__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Time remaining before an auto-dismissing message goes. Errors have no timer and no bar. */
.idfcc-toast__timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--accent);
    opacity: .28;
    transform-origin: left center;
    animation: idfcc-toast-timer linear forwards;
}

.idfcc-toast:hover .idfcc-toast__timer { animation-play-state: paused; }

.idfcc-toast--leaving { animation: idfcc-toast-out .18s ease-in forwards; }

/* A repeat pulses the existing card, so a message arriving again is still noticed. */
.idfcc-toast--bumped { animation: idfcc-toast-bump .3s ease-out; }

@keyframes idfcc-toast-in {
    from { opacity: 0; transform: translate3d(16px, -6px, 0) scale(.97); }
    to   { opacity: 1; transform: none; }
}

@keyframes idfcc-toast-out {
    from { opacity: 1; transform: none; max-height: 220px; margin-bottom: 0; }
    to   { opacity: 0; transform: translate3d(16px, 0, 0); max-height: 0; margin-bottom: -12px; }
}

@keyframes idfcc-toast-bump {
    0%   { transform: none; }
    35%  { transform: scale(1.025); }
    100% { transform: none; }
}

@keyframes idfcc-toast-timer {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .idfcc-toast,
    .idfcc-toast--leaving,
    .idfcc-toast--bumped { animation: none; }
    .idfcc-toast__timer { display: none; }
}

@media (max-width: 480px) {
    #idfccToasts {
        top: 72px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}

/* ==================================================== release-notes list ==== */

/*
 * The feature list used by the "New version" announcement (Home) and the matching entry on
 * the What's new page - one definition so the two stay visually identical, the way their
 * text is already kept identical.
 *
 * The rail-and-tick down the left edge echoes the axis tick marks on the IDF curves this tool
 * draws, rather than a generic icon or card per row - one structural device carries the whole
 * list instead of decorating each item.
 */
.idfcc-updates {
    position: relative;
    margin: 10px 0 18px 2px;
    padding-left: 22px;
    border-left: 2px solid rgba(11, 132, 196, .18);
}

.idfcc-update-item {
    position: relative;
    padding: 1px 0 22px 0;
}

.idfcc-update-item:last-child {
    padding-bottom: 1px;
}

.idfcc-update-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 9px;
    width: 14px;
    height: 2px;
    background: #0b84c4;
}

.idfcc-update-item strong {
    display: block;
    color: #16303e;
    font-size: 15px;
    margin-bottom: 4px;
}

.idfcc-update-item span {
    display: block;
    max-width: 68ch;
    color: #4a5d68;
    font-size: 14px;
    line-height: 1.55;
}
