
/* ACHEI_SEARCH_EXPERIENCE 1.0 */

#acheiSearchProgress[hidden] {
    display: none !important;
}

#acheiSearchProgress {
    box-sizing: border-box;
    width: 100%;
    padding: 14px 0 18px;
    color: inherit;
    opacity: 1;
    transition: opacity 240ms ease;
}

#acheiSearchProgress.sx-leave {
    opacity: 0;
}

#acheiSearchProgress:not([hidden]) + #statusMsg {
    display: none;
}

/* Contador de rate limit tem prioridade visual. */

#acheiSearchProgress:has(
    ~ #acheiRateClock:not([hidden])
) {
    display: none;
}

.sx-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.sx-message {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.sx-count {
    font-size: 13px;
    font-weight: 500;
    opacity: .82;
}

.sx-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(128, 138, 148, .16);
}

.sx-fill {
    position: relative;
    width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        #e66b28,
        #f68c46
    );
    transition: width 400ms ease,
                background 240ms ease;
}

.sx-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 20%,
        rgba(255, 255, 255, .48) 50%,
        transparent 80%
    );
    transform: translateX(-100%);
    animation: sx-shine 1.8s ease-in-out infinite;
}

.sx-spinner {
    display: inline-block;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    box-sizing: border-box;
    border: 2px solid rgba(230, 107, 40, .23);
    border-top-color: #e66b28;
    border-radius: 50%;
    animation: sx-spin .85s linear infinite;
}

.sx-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    opacity: .76;
    font-variant-numeric: tabular-nums;
}

#acheiSearchProgress[data-mode="indeterminate"]
.sx-fill {
    width: 30% !important;
    animation: sx-wait 1.8s ease-in-out infinite;
}

#acheiSearchProgress[data-mode="success"]
.sx-fill {
    background: #217951;
}

#acheiSearchProgress[data-mode="partial"]
.sx-fill {
    background: #d99a24;
}

#acheiSearchProgress[data-mode="success"]
.sx-spinner,

#acheiSearchProgress[data-mode="partial"]
.sx-spinner {
    display: none;
}

#acheiSearchProgress[data-mode="success"]
.sx-fill::after,

#acheiSearchProgress[data-mode="partial"]
.sx-fill::after {
    animation: none;
    opacity: 0;
}

@keyframes sx-spin {
    to { transform: rotate(360deg); }
}

@keyframes sx-shine {
    to { transform: translateX(100%); }
}

@keyframes sx-wait {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(340%); }
}

@media (max-width: 640px) {

    #acheiSearchProgress {
        padding: 11px 0 14px;
    }

    .sx-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 10px;
    }

    .sx-message {
        font-size: 13px;
    }

    .sx-count {
        font-size: 12px;
    }

    .sx-track {
        height: 6px;
    }

    .sx-footer {
        font-size: 11px;
        margin-top: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {

    #acheiSearchProgress,
    .sx-fill {
        transition: none !important;
    }

    .sx-spinner,
    .sx-fill,
    .sx-fill::after {
        animation: none !important;
    }
}
