.sampost-tracking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'IRANSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background: linear-gradient(145deg, #f5f7fb, #ffffff);
}

.sampost-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.sampost-search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.sampost-search-input {
    width: 100%;
    /* top right bottom left - برای RTL فضای کافی سمت راست برای آیکن در نظر گرفته می‌شود */
    padding: 10px 44px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    direction: rtl;
    box-sizing: border-box;
}

.sampost-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.sampost-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #666;
    pointer-events: none;
}

.sampost-filter-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sampost-filter-box label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.sampost-filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    direction: rtl;
    min-width: 150px;
    background: #fff;
    cursor: pointer;
}

.sampost-filter-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.sampost-table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.sampost-tracking-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    table-layout: fixed;
}

.sampost-tracking-table th:nth-child(1),
.sampost-recipient-cell {
    width: 60%;
}

.sampost-tracking-table th:nth-child(2),
.sampost-destination-cell {
    width: 40%;
}

.sampost-tracking-table thead {
    background: linear-gradient(90deg, #f3f4ff, #e0e7ff);
}

.sampost-tracking-table th {
    padding: 14px 18px;
    text-align: right;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.sampost-tracking-table td {
    padding: 14px 18px;
    text-align: right;
}

/* یک خط یکسره برای هر سطر اصلی جدول */
.sampost-tracking-table tbody tr.sampost-row td {
    border-bottom: 1px solid #e5e7eb;
}

/* سطر جزئیات بدون خط جداکننده اضافه */
.sampost-details-row td {
    border-bottom: none;
    padding-top: 0;
}

.sampost-tracking-table tbody tr:hover {
    background: #f9f9f9;
}

.sampost-details-col {
    display: none;
}

.sampost-details-cell {
    text-align: right;
}

.sampost-recipient-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sampost-recipient-name {
    font-weight: 500;
    color: #111827;
}

.sampost-destination-cell {
    white-space: nowrap;
}

.sampost-toggle-details {
    background: #e5edff;
    color: #4f46e5;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.sampost-toggle-details:hover {
    background: #e5edff;
}

.sampost-toggle-details.active {
    background: #e5edff;
}

.sampost-plus-icon {
    display: inline-block;
}

.sampost-details-content {
    margin-top: 8px;
    padding: 12px 16px;
    background: #f3f4ff;
    border-radius: 10px;
    text-align: right;
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sampost-detail-item {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.sampost-detail-item:last-child {
    margin-bottom: 0;
}

.sampost-detail-item strong {
    color: #333;
    min-width: 80px;
}

.sampost-detail-item span {
    color: #374151;
    font-family: 'IRANSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.sampost-no-data {
    text-align: center !important;
    color: #999;
    padding: 40px !important;
}

.sampost-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sampost-page-btn {
    padding: 7px 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 40px;
}

.sampost-page-btn:hover {
    background: #f5f5f5;
    border-color: #2271b1;
}

.sampost-page-btn.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.sampost-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state */
.sampost-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.sampost-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sampost-tracking-container {
        max-width: 100%;
        padding: 20px 10px 30px;
    }
    .sampost-filters {
        flex-direction: column;
    }
    
    .sampost-search-box,
    .sampost-filter-box {
        width: 100%;
    }
    
    .sampost-filter-select {
        width: 100%;
    }
    
    .sampost-table-wrapper {
        overflow-x: hidden;
    }
    
    .sampost-tracking-table {
        width: 100%;
    }
    
    .sampost-recipient-cell {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    
    .sampost-recipient-name {
        display: block;
        margin-top: 2px;
        width: calc(100% - 40px);
    }
}
