/*
    کاوه کویر — ظاهر پنجرهٔ خروجی مرحله‌ای
    توضیح سازوکار در assets/app/core/export.js
*/

.kv-export-dialog {
    max-width: 460px;
}

.kv-export-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(19, 25, 51, .18);
    overflow: hidden;
}

/* ----------------------------------------------------- نشان بالای پنجره */

.kv-export-badge {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(105, 108, 255, .10);
    color: #696cff;
    transition: background-color .25s ease, color .25s ease;
}

.kv-export-badge i {
    font-size: 34px;
    line-height: 1;
    z-index: 1;
}

/* حلقهٔ چرخان — فقط تا وقتی کار در جریان است دیده می‌شود */
.kv-export-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(105, 108, 255, .18);
    border-top-color: #696cff;
    animation: kvExportSpin 1.1s linear infinite;
}

.kv-export-badge.is-success,
.kv-export-badge.is-error {
    animation: kvExportPop .32s ease-out;
}

.kv-export-badge.is-success {
    background: rgba(40, 199, 111, .12);
    color: #28c76f;
}

.kv-export-badge.is-error {
    background: rgba(255, 62, 29, .10);
    color: #ff3e1d;
}

.kv-export-badge.is-success .kv-export-ring,
.kv-export-badge.is-error .kv-export-ring {
    display: none;
}

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

@keyframes kvExportPop {
    0%   { transform: scale(.7); opacity: .4; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

/* -------------------------------------------------------- نوار پیشرفت */

.kv-export-track {
    height: 8px;
    border-radius: 99px;
    background: rgba(105, 108, 255, .12);
    overflow: hidden;
}

.kv-export-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #696cff, #8f91ff);
    transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

/* پایان موفق: رنگ نوار با رنگ نشان هماهنگ می‌شود */
.kv-export-fill.is-success {
    background: linear-gradient(90deg, #28c76f, #48da89);
}

/* حالت نامعیّن: وقتی سرور نمی‌تواند درصد دقیق بدهد */
.kv-export-fill.is-indeterminate {
    background: linear-gradient(90deg,
        rgba(105, 108, 255, .15) 0%,
        #696cff 40%,
        #8f91ff 60%,
        rgba(105, 108, 255, .15) 100%);
    background-size: 220% 100%;
    animation: kvExportSlide 1.25s linear infinite;
    transition: none;
}

@keyframes kvExportSlide {
    from { background-position: 120% 0; }
    to   { background-position: -120% 0; }
}

/* ------------------------------------------------------------- مرحله‌ها */

.kv-export-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.kv-export-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    color: #a5a3ae;
    transition: color .25s ease;
}

.kv-export-step small {
    font-size: .72rem;
    white-space: nowrap;
}

.kv-export-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: block;
    position: relative;
    transition: background-color .25s ease, border-color .25s ease;
}

.kv-export-line {
    flex: 1 1 auto;
    height: 2px;
    border-radius: 2px;
    background: #e7e7f0;
    margin-bottom: 18px;
}

.kv-export-step.is-active {
    color: #696cff;
}

.kv-export-step.is-active .kv-export-dot {
    box-shadow: 0 0 0 4px rgba(105, 108, 255, .14);
}

.kv-export-step.is-done {
    color: #28c76f;
}

.kv-export-step.is-done .kv-export-dot {
    background: #28c76f;
    border-color: #28c76f;
}

/* تیکِ داخل دایرهٔ مرحلهٔ تمام‌شده */
.kv-export-step.is-done .kv-export-dot::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.kv-export-step.is-error {
    color: #ff3e1d;
}

.kv-export-step.is-error .kv-export-dot {
    background: #ff3e1d;
    border-color: #ff3e1d;
}

/* --------------------------------------------------------- حالت تاریک */

html[data-style="dark"] .kv-export-card,
html.dark-style .kv-export-card {
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

html[data-style="dark"] .kv-export-line,
html.dark-style .kv-export-line {
    background: #3a3e5b;
}

/* ------------------------------------------------------ صفحه‌های کوچک */

@media (max-width: 575.98px) {

    .kv-export-steps small {
        font-size: .66rem;
    }

    .kv-export-badge {
        width: 68px;
        height: 68px;
    }

    .kv-export-badge i {
        font-size: 28px;
    }
}
