/*
 * رحلة تجهيز المنتجات وإرسالها — التنسيقات الرسمية داخل الإضافة الأساسية
 * [الميزة 2.2.0] يُحمَّل تلقائياً عند تفعيل الميزة (HWK_Prep_Journey::enqueue_assets)
 * يعتمد متغيرات نظام التصميم العام: --hwk-primary / --hwk-accent / --hwk-card / --hwk-border
 * يدعم RTL بالكامل (خصائص منطقية inset-inline) والتصميم المتجاوب.
 */

.hwk-prep-journey {
    --hwk-prep-ok: #16a34a;
    --hwk-prep-wait: #f59e0b;
    --hwk-prep-line: var(--hwk-border, #e5e7eb);
    --hwk-prep-primary: var(--hwk-primary, #1f3b57);
    --hwk-prep-accent: var(--hwk-accent, #ff9f1c);

    background: var(--hwk-card, #ffffff);
    border: 1px solid var(--hwk-prep-line);
    border-radius: var(--hwk-radius, 12px);
    box-shadow: var(--hwk-shadow, 0 4px 14px rgba(0, 0, 0, .06));
    padding: 22px;
    margin: 0 0 24px;
    font-family: 'Tajawal', system-ui, sans-serif;
    color: var(--hwk-text, #1f2937);
    position: relative;
    overflow: hidden;
}

.hwk-prep-journey::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hwk-prep-primary), var(--hwk-prep-accent));
}

/* ===== الترويسة ===== */
.hwk-prep-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.hwk-prep-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--hwk-prep-primary), var(--hwk-prep-accent));
    box-shadow: 0 6px 16px rgba(31, 59, 87, .22);
}

.hwk-prep-head-text { flex: 1 1 240px; min-width: 0; }

.hwk-prep-title {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
    color: var(--hwk-prep-primary);
    line-height: 1.4;
}

.hwk-prep-msg {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--hwk-text-dim, #6b7280);
}

.hwk-prep-progress-ring {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 8px 14px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.hwk-prep-progress-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--hwk-prep-primary);
    line-height: 1.2;
}

.hwk-prep-progress-lbl {
    font-size: 11px;
    color: #92400e;
    font-weight: 600;
}

/* ===== شريط التقدم ===== */
.hwk-prep-progressbar {
    height: 8px;
    border-radius: 99px;
    background: #f1f5f9;
    margin: 16px 0 6px;
    overflow: hidden;
}

.hwk-prep-progressbar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--hwk-prep-primary), var(--hwk-prep-accent));
    transition: width .5s ease;
}

/* ===== الشرائح الإحصائية ===== */
.hwk-prep-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.hwk-prep-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 99px;
}

.hwk-prep-chip-ok   { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.hwk-prep-chip-wait { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.hwk-prep-chip-draft{ background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== الخطوات ===== */
.hwk-prep-steps {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    position: relative;
}

.hwk-prep-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 0 0 22px 0;
}

/* الخط الرابط بين الخطوات */
.hwk-prep-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 44px;
    inset-inline-start: 19px;
    bottom: 2px;
    width: 2px;
    background: var(--hwk-prep-line);
}

.hwk-prep-step:last-child { padding-bottom: 4px; }

.hwk-prep-step-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid var(--hwk-prep-line);
    position: relative;
    z-index: 1;
    transition: all .25s ease;
}

/* علامة الإنجاز تظهر للخطوات المكتملة فقط */
.hwk-prep-tick { display: none; font-size: 11px; position: absolute; top: -6px; inset-inline-end: -6px; }

.hwk-prep-step-body { flex: 1 1 auto; min-width: 0; padding-top: 2px; }

.hwk-prep-step-title {
    margin: 0 0 3px;
    font-size: 14.5px;
    font-weight: 800;
    color: #64748b;
    line-height: 1.5;
}

.hwk-prep-step-desc {
    margin: 0;
    font-size: 12.5px;
    color: var(--hwk-text-dim, #6b7280);
    line-height: 1.7;
}

.hwk-prep-step-state {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid var(--hwk-prep-line);
    margin-top: 4px;
    min-width: 34px;
    text-align: center;
}

/* --- حالة: مكتملة --- */
.hwk-prep-done .hwk-prep-step-icon {
    background: #ecfdf5;
    color: var(--hwk-prep-ok);
    border-color: #a7f3d0;
}
.hwk-prep-done .hwk-prep-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--hwk-prep-ok);
    color: #fff;
}
.hwk-prep-done .hwk-prep-step-title { color: var(--hwk-prep-ok); }
.hwk-prep-done .hwk-prep-step-state {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.hwk-prep-done:not(:last-child)::before { background: #a7f3d0; }

/* --- حالة: الخطوة الحالية --- */
.hwk-prep-current .hwk-prep-step-icon {
    background: linear-gradient(135deg, var(--hwk-prep-primary), var(--hwk-prep-accent));
    color: #fff;
    border-color: var(--hwk-prep-accent);
    box-shadow: 0 0 0 5px #fff7ed;
}
.hwk-prep-current .hwk-prep-step-title { color: var(--hwk-prep-primary); }
.hwk-prep-current .hwk-prep-step-state {
    background: #fff7ed;
    color: #92400e;
    border-color: #fdba74;
}
.hwk-prep-current::after {
    content: "";
    position: absolute;
    inset: -8px -12px;
    border-radius: 12px;
    background: linear-gradient(90deg, #fff7ed 0%, rgba(255, 247, 237, 0) 60%);
    z-index: -1;
}

/* ===== أزرار الإجراءات ===== */
.hwk-prep-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--hwk-prep-line);
}

/* تنسيق مكتفٍ ذاتياً لأزرار المكوّن (يعمل أيضاً في معاينة لوحة الإدارة
   حيث لا تُحمّل frontend.css — القيم مطابقة لنظام التصميم فلا تعارض على الواجهة) */
.hwk-prep-actions .hwk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.hwk-prep-actions .hwk-btn-accent {
    background: var(--hwk-prep-accent);
    color: #1f2937;
}
.hwk-prep-actions .hwk-btn-accent:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.hwk-prep-actions .hwk-btn-outline {
    background: transparent;
    border: 2px solid var(--hwk-prep-accent);
    color: var(--hwk-prep-accent);
}
.hwk-prep-actions .hwk-btn-outline:hover {
    background: var(--hwk-prep-accent);
    color: #1f2937;
}

/* ===== شارة المعاينة (لوحة الإدارة فقط) ===== */
.hwk-prep-preview {
    max-width: 760px;
}
.hwk-prep-preview-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
    margin: 6px 0 16px;
}

/* ===== التجاوب ===== */
@media (max-width: 600px) {
    .hwk-prep-journey { padding: 16px; }
    .hwk-prep-icon { width: 44px; height: 44px; font-size: 18px; }
    .hwk-prep-title { font-size: 16.5px; }
    .hwk-prep-step { gap: 10px; }
    .hwk-prep-step:not(:last-child)::before {
        inset-inline-start: 16px;
        top: 40px;
    }
    .hwk-prep-step-icon { width: 34px; height: 34px; font-size: 13px; }
    .hwk-prep-step-state { display: none; }
    .hwk-prep-actions .hwk-btn { flex: 1 1 100%; }
}

/* احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .hwk-prep-journey * { transition: none !important; }
}
