/*
 * Shared UI for the recruitment workflow: the "next required action" glow and the what-to-do-next card.
 * (The loading-button / spinner / skeleton styles are appended to this file by the global loading system.)
 *
 * Rule of use: ONLY the single most important action that genuinely needs attention gets .cw-next-action.
 * It is removed automatically because the pages render it from live data: when the action is done, the class is gone.
 */

/* ---- highlighted next action ---------------------------------------------------------------- */
.cw-next-action {
    position: relative;
    animation: cwNextPulse 2.4s ease-out infinite;
}

@keyframes cwNextPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, .50); }
    70%  { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* No motion for people who ask for none: a steady ring keeps the emphasis. */
@media (prefers-reduced-motion: reduce) {
    .cw-next-action {
        animation: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .35);
    }
}

/* ---- "What to do next" card ----------------------------------------------------------------- */
.cw-na {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    padding: .9rem 1.1rem;
    margin-bottom: 1.1rem;
}

.cw-na-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: .5rem;
}

.cw-na-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .55rem;
}

.cw-na-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    background: #f8fafc;
}

.cw-na-item.is-top {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 600;
}

.cw-na-item.is-waiting {
    color: #64748b;
    background: transparent;
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.cw-na-text {
    flex: 1 1 280px;
}

/* ---- recruitment journey strip ---------------------------------------------------------------- */
.cw-journey {
    list-style: none;
    margin: .5rem 0 .25rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
}

.cw-journey-step {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: #94a3b8;
}

.cw-journey-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    font-size: .68rem;
    font-weight: 700;
    background: #fff;
}

.cw-journey-step.is-done { color: #15803d; }
.cw-journey-step.is-done .cw-journey-dot { background: #16a34a; border-color: #16a34a; color: #fff; }

.cw-journey-step.is-current { color: #1d4ed8; font-weight: 700; }
.cw-journey-step.is-current .cw-journey-dot { background: #2563eb; border-color: #2563eb; color: #fff; }

.cw-journey-now { color: #475569; margin-bottom: .5rem; }

/* ---- loading: spinner, loading buttons, upload status, overlay, skeletons ---------------------- */
.cw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cw-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: .45em;
    vertical-align: -.125em;
    border: .16em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cwSpin .7s linear infinite;
    flex: 0 0 auto;
}

.cw-spinner-sm { width: .85em; height: .85em; }
.cw-spinner-lg { width: 2.4rem; height: 2.4rem; margin: 0 0 .75rem; border-width: .24rem; color: #2563eb; }

@keyframes cwSpin { to { transform: rotate(360deg); } }

/* The button keeps its size (set inline by the script); the label changes in place. */
.cw-loading {
    cursor: progress !important;
    opacity: .85;
    pointer-events: none;
    white-space: nowrap;
}

.cw-loading .cw-loading-label { vertical-align: middle; }

.cw-upload-status {
    margin-top: .6rem;
    font-size: .85rem;
    color: #475569;
}

.cw-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .45);
}

.cw-overlay.is-open { display: flex; }

.cw-overlay-box {
    min-width: 220px;
    padding: 1.6rem 2rem;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
}

.cw-overlay-text { font-weight: 600; color: #0f172a; }

/* Skeleton blocks for content-heavy sections that load after the page. */
.cw-skeleton {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
    background-size: 400% 100%;
    animation: cwShimmer 1.4s ease infinite;
    min-height: 1em;
}

.cw-skeleton-line { height: .9rem; margin-bottom: .55rem; }
.cw-skeleton-line.is-short { width: 55%; }
.cw-skeleton-block { height: 5.5rem; }

@keyframes cwShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* A real upload percentage, only where the browser reports one (CWLoading.upload). */
.cw-progress {
    height: .5rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.cw-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: #2563eb;
    transition: width .15s linear;
}

@media (prefers-reduced-motion: reduce) {
    .cw-spinner { animation: none; border-right-color: currentColor; border-bottom-color: transparent; }
    .cw-skeleton { animation: none; background: #e2e8f0; }
    .cw-progress > span { transition: none; }
}
