/* ============================================================
 * EKP Shipment Tracker (v1.0.0)
 * نفس متغيرات نظام التصميم المستخدم في ekp-calculators-pro، معزولة هنا
 * تحت .ekp-st-widget/.ekp-st-box عشان الملف يشتغل لوحده من غير أي اعتماد
 * على بلاجين تاني.
 * ============================================================ */

.ekp-st-widget,
.ekp-st-box {
    --ekp-ink: #0f172a;
    --ekp-muted: #64748b;
    --ekp-line: #e6e9f0;
    --ekp-surface: #ffffff;
    --ekp-bg-soft: #f6f8fb;
    --ekp-primary: #2563eb;
    --ekp-primary-dark: #1d4ed8;
    --ekp-success: #10b981;
    --ekp-success-bg: #ecfdf5;
    --ekp-warning: #f59e0b;
    --ekp-warning-bg: #fffbeb;
    --ekp-danger: #ef4444;
    --ekp-danger-bg: #fef2f2;
    --ekp-radius-lg: 16px;
    --ekp-radius-md: 12px;
    --ekp-shadow-panel: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.06);

    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    direction: rtl;
    color: var(--ekp-ink);
    box-sizing: border-box;
}
.ekp-st-widget *, .ekp-st-box * { box-sizing: border-box; }

.ekp-st-widget { max-width: 560px; }
.ekp-st-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }

/* ---------- Form ---------- */
.ekp-st-form {
    display: flex;
    gap: 8px;
}
.ekp-st-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--ekp-line);
    border-radius: var(--ekp-radius-md);
    background: var(--ekp-surface);
    color: var(--ekp-ink);
}
.ekp-st-input:focus {
    outline: none;
    border-color: var(--ekp-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.ekp-st-submit {
    flex-shrink: 0;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--ekp-primary);
    border: none;
    border-radius: var(--ekp-radius-md);
    cursor: pointer;
    transition: background .15s ease;
}
.ekp-st-submit:hover { background: var(--ekp-primary-dark); }
.ekp-st-submit:disabled { opacity: .6; cursor: default; }

/* ---------- Result box ---------- */
.ekp-st-result:empty { margin: 0; }
.ekp-st-result { margin-top: 16px; }

.ekp-st-box {
    background: var(--ekp-surface);
    border: 1px solid var(--ekp-line);
    border-radius: var(--ekp-radius-lg);
    box-shadow: var(--ekp-shadow-panel);
    padding: 20px;
}

.ekp-st-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--ekp-line);
}
.ekp-st-head-status { font-size: 16px; font-weight: 700; color: var(--ekp-success); }
.ekp-st-head-barcode {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--ekp-muted);
    direction: ltr;
    unicode-bidi: isolate;
}

/* ---------- Timeline ---------- */
.ekp-st-steps {
    list-style: none;
    margin: 14px 0 0;
    padding-inline-start: 6px;
}
.ekp-st-step {
    position: relative;
    padding-inline-start: 26px;
    padding-bottom: 20px;
}
.ekp-st-step:last-child { padding-bottom: 0; }

/* connecting rail: a vertical line running behind every dot except the last */
.ekp-st-step::after {
    content: "";
    position: absolute;
    inset-inline-start: 5px;
    top: 16px;
    bottom: -4px;
    width: 2px;
    background: var(--ekp-line);
}
.ekp-st-step:last-child::after { display: none; }

.ekp-st-dot {
    position: absolute;
    inset-inline-start: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ekp-success);
    box-shadow: 0 0 0 3px var(--ekp-success-bg);
}
.ekp-st-step.is-current .ekp-st-dot {
    width: 14px;
    height: 14px;
    top: 3px;
    inset-inline-start: -1px;
    background: var(--ekp-primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,.16);
}

.ekp-st-step-title { font-size: 14px; font-weight: 600; }
.ekp-st-step.is-current .ekp-st-step-title { color: var(--ekp-primary); }
.ekp-st-step-meta { margin-top: 2px; font-size: 12px; color: var(--ekp-muted); }

/* ---------- Error / empty message ---------- */
.ekp-st-message p { margin: 0; font-size: 14px; }
.ekp-st-message--error { background: var(--ekp-danger-bg); border-color: var(--ekp-danger); color: #991b1b; }
.ekp-st-message--empty { background: var(--ekp-warning-bg); border-color: var(--ekp-warning); color: #92400e; }
.ekp-st-message--pending { background: var(--ekp-bg-soft); border-color: var(--ekp-line); color: var(--ekp-muted); }

/* admin-only technical detail (see ekp_st_render_result_html) -- collapsed by
   default via the native <details> behavior, deliberately understated so it
   doesn't read as part of the customer-facing message */
.ekp-st-diagnostic { margin-top: 10px; font-size: 11px; opacity: .8; }
.ekp-st-diagnostic summary { cursor: pointer; }
.ekp-st-diagnostic code {
    display: block;
    margin-top: 6px;
    padding: 8px;
    background: rgba(0,0,0,.05);
    border-radius: 6px;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: pre-wrap;
    word-break: break-all;
}
