/* orders_history.css - Final Updated Version */
/* Global Container Styles */
.th-bg-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.th-bg-card {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.th-bg-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.06);
}

.th-bg-body {
    padding: 2rem;
}

/* Header Section */
.th-header {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 20px;
    margin-bottom: 24px;
    position: relative;
}

.th-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 3px;
    border-radius: 3px;
}

.th-title {
    font-weight: 800;
    color: #000000;
    font-size: 2rem;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    display: inline-block;
}

.th-subtitle {
    font-size: 0.95rem;
    color: #636e72;
    max-width: 80%;
    line-height: 1.5;
}

/* Filter Controls */
.th-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.th-filter-btn {
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 8px 20px;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.th-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(73, 80, 87, 0.1), rgba(73, 80, 87, 0.05));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.th-filter-btn:hover {
    border-color: #ced4da;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.th-filter-btn:hover::before {
    transform: translateX(0);
}

.th-filter-btn.filter-active {
    background: #000000;
    color: white;
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.th-filter-btn.filter-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Transaction Content Area */
.th-content-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow:
        inset 0 4px 12px rgba(0, 0, 0, 0.03),
        0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

.th-content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05));
    border-radius: 0 0 0 100%;
}

/* Transaction Card */
.th-transaction-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(233, 236, 239, 0.6);
    overflow: hidden;
    position: relative;
}

.th-transaction-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #000000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.th-transaction-card:hover::after {
    opacity: 1;
}

.tracking-resi-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    padding-top: 5px;
    min-height: 32px;
}

.th-transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: rgba(241, 243, 245, 0.4);
    border-bottom: 1px solid rgba(233, 236, 239, 0.5);
    position: relative;
}

.th-transaction-id {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #2b2d42;
    font-size: 1.1rem;
    letter-spacing: -0.3px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th-transaction-id::before {
    content: '#';
    color: #000000;
    font-weight: 800;
}

.th-transaction-date {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th-transaction-date i {
    color: #000000;
    font-size: 0.8rem;
}

/* Status Group */
.th-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.th-status-badges {
    display: flex;
    gap: 0.75rem;
}

/* Status Badges - Black and White Version */
.th-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    background: #000000;
    color: #ffffff;
    border-left: 3px solid #333333;
}

.th-status-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.th-status-badge:hover {
    transform: translateY(-2px);
}

.th-status-badge:hover::after {
    opacity: 1;
}

.th-status-badge i {
    font-size: 0.7rem;
    margin-right: 0.3rem;
    color: #ffffff;
}

/* Order Status Badges (Keep original colors) */
.badge-order-pending {
    background: #fff3cd !important;
    color: #856404 !important;
    border-left: 3px solid #ffc107 !important;
}

.badge-order-shipped {
    background: #cce5ff !important;
    color: #004085 !important;
    border-left: 3px solid #007bff !important;
}

.badge-order-delivered {
    background: #d4edda !important;
    color: #155724 !important;
    border-left: 3px solid #28a745 !important;
}

.badge-order-canceled {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-left: 3px solid #dc3545 !important;
}

/* Total Amount */
.th-total-amount {
    font-weight: 700;
    color: #2b2d42;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #e9ecef, #f8f9fa);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.th-total-amount::before {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Transaction Items */
.th-items-container {
    padding: 1rem 1.25rem;
}

.th-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(233, 236, 239, 0.4);
    transition: background-color 0.2s ease;
}

.th-item-card:hover {
    background-color: rgba(248, 249, 250, 0.5);
}

.th-item-card:last-child {
    border-bottom: none;
}

/* Product Card */
.th-product-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.th-product-image-container {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.th-product-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.th-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.th-product-image-container:hover .th-product-image {
    transform: scale(1.1);
}

.th-product-deleted-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.th-product-image-container:hover .th-product-deleted-badge {
    transform: translateY(0);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    20% { transform: translateY(-2px) rotate(-5deg); }
    40% { transform: translateY(2px) rotate(5deg); }
    60% { transform: translateY(-2px) rotate(-5deg); }
    80% { transform: translateY(2px) rotate(5deg); }
}

.th-product-deleted-badge i {
    font-size: 0.6rem;
}

.th-product-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.th-product-name {
    font-weight: 700;
    color: #2b2d42;
    font-size: 1rem;
    margin: 0;
    transition: color 0.2s ease;
}

.th-product-name:hover {
    color: #000000;
}

.th-product-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.th-product-category,
.th-product-brand {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.th-product-category:hover,
.th-product-brand:hover {
    color: #000000;
}

.th-product-category i,
.th-product-brand i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.th-product-description {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

/* Order Details */
.th-order-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.th-price-info {
    text-align: right;
}

.th-unit-price {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.th-unit-price::before {
    font-size: 0.7rem;
    opacity: 0.7;
}

.th-product-quantity {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0.2rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.th-product-quantity::before {
    content: '×';
    opacity: 0.7;
}

.th-total-price {
    font-weight: 700;
    color: #2b2d42;
    font-size: 1rem;
    min-width: 100px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.th-total-price::before {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Action Buttons */
.th-action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.th-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th-action-btn-primary {
    background: #000000;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.th-action-btn-primary:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.th-action-btn-secondary {
    background: white;
    color: #000000;
    border: 1px solid #000000;
}

.th-action-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Empty State */
.th-empty-state {
    text-align: center;
    padding: 40px 24px;
    background: #f8f9fa;
    border-radius: 16px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.th-empty-state::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05));
    border-radius: 50%;
}

.th-empty-state::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05));
    border-radius: 50%;
}

.th-empty-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.th-empty-icon {
    width: 50px;
    height: 50px;
    stroke: #adb5bd;
}

.th-empty-title {
    font-size: 1.8rem;
    color: #000000;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.th-empty-subtitle {
    font-size: 1.1rem;
    color: #636e72;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.th-empty-cta {
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Pagination */
.th-pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.th-pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.th-pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.th-pagination-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.th-pagination-btn.active {
    background: #000000;
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.th-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.th-loading-state {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.th-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.th-transaction-card {
    animation: fadeIn 0.6s ease forwards;
}

.th-empty-state {
    animation: fadeInUp 0.6s ease forwards;
}

.th-loading-spinner {
    animation: spin 1s linear infinite;
}

/* Tooltip */
.th-tooltip {
    position: relative;
    display: inline-block;
}

.th-tooltip .th-tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.th-tooltip .th-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.th-tooltip:hover .th-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .th-bg-container {
        padding: 1rem;
    }

    .th-bg-card {
        border-radius: 12px;
    }

    .th-bg-body {
        padding: 1.5rem;
    }

    .th-title {
        font-size: 1.6rem;
    }

    .th-subtitle {
        max-width: 100%;
    }

    .th-transaction-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .th-status-group {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .th-status-badges {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .th-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem 0;
    }

    .th-order-details {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        padding-top: 1rem;
        border-top: 1px dashed #e9ecef;
    }

    .th-product-image-container {
        width: 70px;
        height: 70px;
    }

    .th-empty-title {
        font-size: 1.4rem;
    }

    .th-empty-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .th-bg-body {
        padding: 1rem;
    }

    .th-content-wrapper {
        padding: 1rem;
    }

    .th-product-card {
        gap: 0.75rem;
    }

    .th-product-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .th-order-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .th-price-info {
        text-align: left;
    }

    .th-total-price {
        text-align: left;
    }
}
