﻿/* ===== Action Status Bar ===== */
.action-status-bar {
    background: linear-gradient(180deg, #1e293b, #0f172a);
    border: 1.5px solid #334155;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    color: #f8fafc;
    padding: 10px 12px;
    margin: 10px 0 16px;
    position: sticky;
    top: 70px;
    z-index: 40;
}

    /* Single-line flex layout */
    .action-status-bar .bar {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* Left section */
    .action-status-bar .left {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    /* Center section - stretch */
    .action-status-bar .center {
        flex: 1 1 auto;
        min-width: 160px;
        max-width: 100%;
    }

    .action-status-bar .progress {
        height: 8px;
        background: rgba(255,255,255,.06);
        border: 1px solid #475569;
        border-radius: 999px;
        overflow: hidden;
        width: 100%;
    }

    .action-status-bar .progress-bar {
        background: linear-gradient(90deg, #22d3ee, #0ea5e9, #3b82f6);
    }

    /* Right section: Stop button */
    .action-status-bar .actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 0 0 auto;
        white-space: nowrap;
    }

        .action-status-bar .actions form {
            display: inline-block;
            margin: 0;
        }

    /* Text & badges */
    .action-status-bar .fw-semibold.small.text-uppercase {
        color: #94a3b8 !important;
        letter-spacing: .06em;
    }

    .action-status-bar .badge.bg-primary {
        background: #38bdf8 !important;
        color: #0f172a !important;
        font-weight: 800;
        border-radius: 999px;
        padding: 4px 10px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
    }

    /* Buttons */
    .action-status-bar .btn {
        font-weight: 700;
        border-radius: 10px;
        padding: 6px 12px;
        line-height: 1.2;
    }

        .action-status-bar .btn.btn-outline-danger {
            color: #f87171;
            background: transparent;
            border: 1.5px solid #b91c1c;
        }

            .action-status-bar .btn.btn-outline-danger:hover {
                background: #f87171;
                color: #0f172a;
                border-color: #f87171;
                box-shadow: 0 0 0 3px rgba(248,113,113,.25);
            }

    /* Ellipsis for long text */
    .action-status-bar .text-body {
        display: inline-flex;
        align-items: center;
        max-width: 50ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Mobile-friendly */
@media (max-width: 720px) {
    .action-status-bar .center {
        min-width: 120px;
    }

    .action-status-bar .text-body {
        max-width: 18ch;
    }
}

/* Outer track */
.action-status-bar .progress {
    height: 8px; /* you already have this */
    background: rgba(255,255,255,.06);
    border: 1px solid #475569;
    border-radius: 999px;
    overflow: hidden;
    width: 100%;
}

/* Inner fill */
.action-status-bar .progress-bar {
    display: block; /* ensure it’s block-level */
    height: 100%; /* <-- key line */
    width: 0; /* will be overridden by inline style="width:NN%" */
    background: linear-gradient(90deg, #22d3ee, #0ea5e9, #3b82f6);
    transition: width .3s ease; /* optional: animate changes */
}

/* Right-align the progress bar and make it fixed width */
.action-status-bar .center {
    flex: 0 0 auto; /* stop stretching */
    width: 220px; /* ← set your fixed width */
    margin-left: auto; /* push to the right edge */
    max-width: none;
}

.action-status-bar .progress {
    width: 100%; /* fill the fixed .center width */
}

@media (max-width: 720px) {
    .action-status-bar .center {
        width: 160px;
    }
}

/* Allow .text-body to fill available space between badge and progress bar */
.action-status-bar .left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto; /* allow it to grow */
    min-width: 0; /* prevent overflow in flex layouts */
}

.action-status-bar .text-body {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto; /* take remaining space */
    min-width: 0; /* critical for text-overflow to work */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: none; /* remove fixed 28ch/18ch restriction */
}

.paste-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111;
    font-weight: 500;
    cursor: pointer;
}

/* clean down arrow icon */
.arrow-icon {
    display: inline-block;
    position: relative;
    width: 2px; /* shaft width */
    height: 10px; /* shaft height */
    background-color: #111; /* arrow color */
    margin-top: 1px;
}

    /* arrowhead */
    .arrow-icon::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 6px;
        height: 6px;
        border-right: 2px solid #111;
        border-bottom: 2px solid #111;
    }

/* Greyed-out look when disabled */
.stop-btn:disabled,
.stop-btn[disabled] {
    border-color: #6c757d !important; /* Bootstrap secondary */
    color: #6c757d !important;
    background-color: transparent !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

    /* Prevent hover/focus turning red when disabled */
    .stop-btn:disabled:hover,
    .stop-btn:disabled:focus,
    .stop-btn[disabled]:hover,
    .stop-btn[disabled]:focus {
        border-color: #6c757d !important;
        color: #6c757d !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

/* Optional: slightly darker red on hover only when enabled */
.stop-btn.btn-outline-danger:not(:disabled):hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}
