﻿/* wwwroot/css/shared-components.css */
/* این فایل شامل کلاس‌های مشترکی است که هم در صفحات Account (سمت کاربر)
   و هم در پنل Admin برای نمایش سفارش/خلاصه قیمت استفاده می‌شوند. */

/* ===== ORDER STATUS BADGE ===== */
.order-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
}

.order-status-badge--pending {
    background: #fff3e0;
    color: #e65100;
}

.order-status-badge--confirmed,
.order-status-badge--processing {
    background: #e3f2fd;
    color: #1565c0;
}

.order-status-badge--shipped {
    background: #ede7f6;
    color: #5e35b1;
}

.order-status-badge--delivered {
    background: #e8f5e9;
    color: #2e7d32;
}

.order-status-badge--cancelled,
.order-status-badge--refunded {
    background: #ffebee;
    color: #c62828;
}

/* ===== TICKET STATUS BADGE ===== */
.ticket-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill, 20px);
    white-space: nowrap;
    display: inline-block;
}

.ticket-status-badge--open {
    background: #fff3e0;
    color: #e65100;
}

.ticket-status-badge--answered {
    background: #e3f2fd;
    color: #1565c0;
}

.ticket-status-badge--closed {
    background: #f5f5f5;
    color: #757575;
}

/* ===== TICKET NEW FORM ===== */
.ticket-new-form {
    background: var(--bg-secondary, #f9f9f9);
    border-radius: var(--radius-md, 10px);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ===== TICKET BACK LINK ===== */
.ticket-back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
}

    .ticket-back-link:hover {
        color: var(--primary);
    }

/* ===== TICKET THREAD ===== */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.ticket-message {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md, 10px);
    background: var(--bg-secondary, #f5f5f5);
}

.ticket-message--admin {
    align-self: flex-start;
    background: color-mix(in srgb, var(--primary, #e53935) 10%, white);
    border: 1px solid color-mix(in srgb, var(--primary, #e53935) 25%, transparent);
}

.ticket-message--user {
    align-self: flex-end;
}

.ticket-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.ticket-message__body {
    font-size: 0.9rem;
    color: var(--text);
    white-space: pre-line;
    line-height: 1.8;
}

.ticket-reply-box {
    background: var(--bg-secondary, #f9f9f9);
    border-radius: var(--radius-md, 10px);
    padding: 1rem;
}

@media (max-width: 576px) {
    .ticket-message {
        max-width: 92%;
    }
}

/* ===== ORDER DETAIL ITEM (ردیف محصول در جزئیات سفارش) ===== */
.order-detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .order-detail-item:last-child {
        border-bottom: none;
    }

.order-detail-item__img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

    .order-detail-item__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.order-detail-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.order-detail-item__name {
    font-weight: 600;
    font-size: 0.9rem;
}

.order-detail-item__attrs {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.order-detail-item__price {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ===== SUMMARY ROW (خلاصه مالی - استفاده در Checkout / Order Details) ===== */
.checkout-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #616161;
    margin-bottom: 0.5rem;
}

.checkout-summary-item--total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-top: 0.5rem;
}

/* ===== ORDER TIMELINE (مشترک بین Admin و Account) ===== */
.order-timeline {
    position: relative;
    padding-right: 1.5rem;
}

.order-timeline__item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-right: 1rem;
    border-right: 2px solid #f0f0f0;
}

    .order-timeline__item:last-child {
        padding-bottom: 0;
        border-right-color: transparent;
    }

.order-timeline__dot {
    position: absolute;
    right: -5px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.order-timeline__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.order-timeline__note {
    font-size: 0.85rem;
    color: #424242;
    background: #f9f9f9;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0.3rem 0;
}

.order-timeline__by {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== GENERIC LTR HELPER ===== */
.ltr {
    direction: ltr;
    text-align: left;
    display: inline-block;
}

/* اضافه به wwwroot/css/shared-components.css */

.return-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
}

.return-status-badge--pending {
    background: #fff3e0;
    color: #e65100;
}

.return-status-badge--approved,
.return-status-badge--itemreceived {
    background: #e3f2fd;
    color: #1565c0;
}

.return-status-badge--refunded {
    background: #e8f5e9;
    color: #2e7d32;
}

.return-status-badge--rejected,
.return-status-badge--cancelled {
    background: #ffebee;
    color: #c62828;
}