/* ================================
   Order Status Timeline - Full CSS
   Desktop (Horizontal) + Mobile (Vertical) + Animation
   ================================ */

:root {
    --ost-primary: #00B3BA;
    --ost-accent: #F9A61A;
    --ost-inactive: #C7DADB;
    --ost-bg: #FFFFFF;

    --ost-step-size: 48px;
    /* نمایش ظاهری آیکون (PNG ها 128x128 هستند) */
    --ost-line-width: 2px;
    --ost-animation-duration: 0.6s;
    --ost-animation-distance: 10px;
    /* فاصله حرکت در انیمیشن */
}

/* ریشه تایم‌لاین */
.ost-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: var(--ost-bg);
    direction: rtl;
    position: relative;
    overflow: hidden;
    /* برای انیمیشن تمیزتر */
}

/* هر مرحله (Step) – حالت افقی (دسکتاپ) پیش‌فرض */
.ost-step {
    text-align: center;
    position: relative;
    flex: 1;
    opacity: 0.35;
    /* انیمیشن ورود عمومی */
    animation: ostFadeSlideIn var(--ost-animation-duration) ease-out forwards;
}

/* تاخیر انیمیشن برای هر استپ (اختیاری؛ قابل حذف) */
.ost-step:nth-child(1) {
    animation-delay: 0s;
}

.ost-step:nth-child(2) {
    animation-delay: 0.1s;
}

.ost-step:nth-child(3) {
    animation-delay: 0.2s;
}

.ost-step:nth-child(4) {
    animation-delay: 0.3s;
}

.ost-step:nth-child(5) {
    animation-delay: 0.4s;
}

.ost-step:nth-child(6) {
    animation-delay: 0.5s;
}

.ost-step:nth-child(7) {
    animation-delay: 0.6s;
}

.ost-step:nth-child(8) {
    animation-delay: 0.7s;
}

.ost-step:nth-child(9) {
    animation-delay: 0.8s;
}

/* استپ فعال */
.ost-step.active {
    opacity: 1;
}

/* استپ‌هایی که مراحل قبل از active هستند (تکمیل‌شده) */
.ost-step.completed {
    opacity: 1;
}

/* آیکون هر استپ */
.ost-step img {
    width: var(--ost-step-size);
    height: var(--ost-step-size);
    margin-bottom: 8px;
    border-radius: 50%;
    background: #f5f8f8;
    position: relative;
    z-index: 1;
}

/* متن زیر آیکون */
.ost-step span {
    display: block;
    font-size: 13px;
    color: #444;
}

/* خط افقی بین استپ‌ها – دسکتاپ */
.ost-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(var(--ost-step-size) / 2);
    right: 50%;
    width: 100%;
    height: var(--ost-line-width);
    background: var(--ost-inactive);
    z-index: 0;
}

/* رنگ خط برای استپ فعال */
.ost-step.active::after {
    background: var(--ost-primary);
}

/* رنگ خط برای استپ‌های تکمیل‌شده */
.ost-step.completed::after {
    background: var(--ost-primary);
}

/* ================================
   حالت موبایل – Vertical Timeline
   ================================ */

@media (max-width: 768px) {

    .ost-timeline {
        flex-direction: column;
        padding-right: 32px;
        align-items: stretch;
    }

    .ost-step {
        display: flex;
        align-items: flex-start;
        text-align: right;
        margin-bottom: 20px;
        opacity: 0.35;
        animation: ostFadeSlideInMobile var(--ost-animation-duration) ease-out forwards;
    }

    /* توالی انیمیشن روی موبایل هم نگه‌داشته می‌شود */
    .ost-step:nth-child(1) {
        animation-delay: 0s;
    }

    .ost-step:nth-child(2) {
        animation-delay: 0.1s;
    }

    .ost-step:nth-child(3) {
        animation-delay: 0.2s;
    }

    .ost-step:nth-child(4) {
        animation-delay: 0.3s;
    }

    .ost-step:nth-child(5) {
        animation-delay: 0.4s;
    }

    .ost-step:nth-child(6) {
        animation-delay: 0.5s;
    }

    .ost-step:nth-child(7) {
        animation-delay: 0.6s;
    }

    .ost-step:nth-child(8) {
        animation-delay: 0.7s;
    }

    .ost-step:nth-child(9) {
        animation-delay: 0.8s;
    }

    .ost-step img {
        margin: 0 0 0 12px;
        width: var(--ost-step-size);
        height: var(--ost-step-size);
    }

    .ost-step span {
        font-size: 14px;
        padding-top: 12px;
    }

    /* خط عمودی کنار استپ‌ها */
    .ost-step::after {
        content: "";
        position: absolute;
        right: calc(24px + (var(--ost-step-size) / 2) - (var(--ost-line-width) / 2));
        top: var(--ost-step-size);
        width: var(--ost-line-width);
        height: calc(100% - var(--ost-step-size));
        background: var(--ost-inactive);
        z-index: 0;
    }

    .ost-step:last-child::after {
        display: none;
    }

    /* active روی موبایل */
    .ost-step.active {
        opacity: 1;
    }

    .ost-step.active::after {
        background: var(--ost-accent);
    }

    /* completed روی موبایل */
    .ost-step.completed {
        opacity: 1;
    }

    .ost-step.completed::after {
        background: var(--ost-primary);
    }
}

/* ================================
   Animation Keyframes
   ================================ */

/* دسکتاپ: fade + slide از پایین به بالا */
@keyframes ostFadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(var(--ost-animation-distance));
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* موبایل: fade + slide از راست به چپ (با توجه به RTL) */
@keyframes ostFadeSlideInMobile {
    0% {
        opacity: 0;
        transform: translateX(var(--ost-animation-distance));
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================
   Tracking Form Styles
   ================================ */
.ost-tracking-form-wrapper {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ost-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.ost-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ost-submit-btn {
    padding: 10px 20px;
    background-color: var(--ost-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.ost-submit-btn:hover {
    background-color: #008c91;
}

/* Messages */
.ost-error {
    color: #d63638;
    background: #fcebeb;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #fadddd;
}

.ost-message.ost-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.ost-result-container h3 {
    margin-top: 30px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.ost-step.future img {
    filter: grayscale(100%) blur(1.5px);
}

.ost-step.future span {
    color: #999;
}

/* Responsive adjustments for form */
@media (max-width: 480px) {
    .ost-input-group {
        flex-direction: column;
    }
    
    .ost-submit-btn {
        width: 100%;
    }
}
