/*
 * Styles for the CMSX background-task progress widget (classic UI).
 * Markup is generated by background-task.js.
 */
#cmsx-bgtask {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    width: 300px;
    max-width: 90vw;
    font-family: sans-serif;
    font-size: 13px;
    background: #fff;
    border: 1px solid #c9c9d4;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    padding: 10px 12px;
    color: #333;
}
#cmsx-bgtask.ok { border-left: 4px solid #2e7d32; }
#cmsx-bgtask.failed { border-left: 4px solid #c62828; }
#cmsx-bgtask.running { border-left: 4px solid #646686; }
/* The finished card is dismissed by clicking anywhere on it. */
#cmsx-bgtask.done { cursor: pointer; }

/* Temporarily out of contact with the server (a poll failed; the widget is still retrying). */
#cmsx-bgtask.cmsx-bgtask-stale { opacity: .6; }
#cmsx-bgtask.cmsx-bgtask-stale::after {
    content: "Reconnecting…";
    display: block;
    margin-top: 6px;
    color: #777;
    font-size: 12px;
    font-style: italic;
}

.cmsx-bgtask-title {
    font-weight: bold;
    margin-bottom: 6px;
    padding-right: 18px; /* clear the × */
}
.cmsx-bgtask-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}
.cmsx-bgtask-bar > span {
    display: block;
    height: 100%;
    background: #646686;
    width: 0;
    transition: width .3s;
}
.cmsx-bgtask-bar.indeterminate > span {
    width: 40%;
    animation: cmsx-bgtask-slide 1.1s infinite ease-in-out;
}
@keyframes cmsx-bgtask-slide {
    0% { margin-left: -40%; }
    100% { margin-left: 100%; }
}
.cmsx-bgtask-sub {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

.cmsx-bgtask-done-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    padding-right: 18px; /* clear the × */
}
.cmsx-bgtask-icon { font-weight: bold; }
#cmsx-bgtask.ok .cmsx-bgtask-icon { color: #2e7d32; }
#cmsx-bgtask.failed .cmsx-bgtask-icon { color: #c62828; }

.cmsx-bgtask-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: #999;
}

.cmsx-bgtask-failures {
    margin: 6px 0 0;
    padding-left: 18px;
    max-height: 140px;
    overflow: auto;
    cursor: auto; /* reads as text, not as part of the click-to-dismiss surface */
    color: #c62828;
}
