/* css/wc-order-overview.css */
.woocommerce-MyAccount-navigation-link--order-overview a::before {
    content: "\f163";
    color: #0085ca !important;
}

.woocommerce-orders-table {
    margin-bottom: 2em;
}

.woocommerce-orders-table th,
.woocommerce-orders-table td {
    padding: 12px;
}

.woocommerce-orders-table th {
    background-color: #f8f8f8;
}

.woocommerce-orders-table tr:nth-child(even) {
    background-color: #fafafa;
}

.woocommerce-button {
    margin-right: 5px;
}

.woocommerce-pagination {
    text-align: center;
    margin-top: 2em;
}

.woocommerce-pagination .woocommerce-button {
    margin: 0 5px;
}

/* Updated modern styling for Order Overview plugin */

/* Container styles */
.woocommerce-account .woocommerce-MyAccount-content {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Search box styling */
.wc-order-overview-search {
    margin-bottom: 2rem;
    position: relative;
    transition: transform 0.3s ease;
}

.wc-order-overview-search input {
    width: 100%;
    max-width: 500px;
    padding: 16px 20px 16px 50px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
    background-repeat: no-repeat;
    background-position: 16px center;
    background-size: 20px;
}

.wc-order-overview-search input:focus {
    border-color: #0085ca;
    box-shadow: 0 0 0 1px rgba(0,133,202,0.1);
    outline: none;
}

/* Table styling */
.wc-order-overview-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wc-order-overview-table th,
.wc-order-overview-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 0.2s ease;
}

.wc-order-overview-table th {
    background: #f6f4fa;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wc-order-overview-table tr:hover {
    background-color: #f9f7fd;
}

.wc-order-overview-table tr:last-child td {
    border-bottom: none;
}

/* Link styling */
.wc-order-overview-table a {
    color: #7e57c2;
    text-decoration: none;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    border-bottom: 1px solid transparent;
}

.wc-order-overview-table a:hover {
    color: #5e35b1;
    border-bottom: 1px solid #5e35b1;
}

/* Improved button styling */
.approve-order-button {
    padding: 10px 18px;
    background: #7e57c2;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(94, 53, 177, 0.2);
    display: flex;
    align-items: center;
}

.approve-order-button:hover {
    background: #5e35b1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(94, 53, 177, 0.3);
}

.approve-order-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(94, 53, 177, 0.3);
}

.approve-order-button.processing {
    background: #9575cd;
    opacity: 0.8;
    cursor: wait;
}

.approve-order-button.approved {
    background: #4caf50;
    cursor: default;
}

/* Status indicators */
.order-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.order-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.order-status.completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.order-status.completed::before {
    background-color: #2e7d32;
}

.order-status.processing {
    background-color: #e3f2fd;
    color: #1565c0;
}

.order-status.processing::before {
    background-color: #1565c0;
}

.order-status.on-hold {
    background-color: #fff8e1;
    color: #f57f17;
}

.order-status.on-hold::before {
    background-color: #f57f17;
}

.order-status.pending {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.order-status.pending::before {
    background-color: #7b1fa2;
}

.order-status.cancelled,
.order-status.failed,
.order-status.refunded {
    background-color: #ffebee;
    color: #c62828;
}

.order-status.cancelled::before,
.order-status.failed::before,
.order-status.refunded::before {
    background-color: #c62828;
}

/* Enhanced Pagination styles */
.wc-order-overview-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wc-order-overview-pagination a,
.wc-order-overview-pagination span {
    padding: 10px 15px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #ddd;
    color: #7e57c2;  /* Purple color for all text */
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    font-size: 14px;
}

.wc-order-overview-pagination a:hover {
    background: #f5f0ff;  /* Light purple background on hover */
    border-color: #7e57c2;
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(126, 87, 194, 0.1);
}

.wc-order-overview-pagination span.current {
    background: #0085ca;
    color: #fff;
    border-color: #0085ca;
    font-weight: 600;
}

.wc-order-overview-pagination .page-jump button {
    background: #7e57c2;  /* Purple background for Go button */
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-order-overview-pagination .page-jump button:hover {
    background: #6441a5;  /* Darker purple on hover */
}

/* Progress bar for loading */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    margin-bottom: 20px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #7e57c2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Order count info */
.order-count-info {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Responsive styles for pagination */
@media screen and (max-width: 782px) {
    .wc-order-overview-pagination {
        gap: 5px;
    }
    
    .wc-order-overview-pagination a,
    .wc-order-overview-pagination span {
        padding: 8px 12px;
        min-width: 35px;
        font-size: 13px;
    }
    
    .wc-order-overview-pagination .first-page,
    .wc-order-overview-pagination .last-page {
        display: none;
    }
}

/* Loading state */
#wc-order-overview-results.loading {
    position: relative;
    min-height: 200px;
}

.wc-fancy-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    z-index: 50;
    opacity: 1;
}

/* Make sure loading spinner is visible */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(126, 87, 194, 0.1);
    border-radius: 50%;
    border-top-color: #0085ca;
    animation: loader-spin 1s linear infinite;
    margin-bottom: 15px;
}

.loader-text {
    font-size: 16px;
    color: #7e57c2;
    font-weight: 500;
}

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

/* Fix error message styling */
.wc-order-overview-error {
    padding: 1.25rem;
    background: #ffebee;
    border-left: 4px solid #ef5350;
    color: #b71c1c;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

.wc-order-overview-error::before {
    content: "⚠️";
    font-size: 18px;
    margin-right: 10px;
}

/* No results message styling */
.wc-order-overview-no-results {
    padding: 3rem 2rem;
    text-align: center;
    color: #616161;
    background: #f9f9f9;
    border-radius: 12px;
    margin: 1.5rem 0;
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wc-order-overview-no-results::before {
    content: "🔍";
    font-size: 38px;
    margin-bottom: 1rem;
}

.wc-order-overview-no-results p {
    margin: 0.5rem 0;
}

.wc-order-overview-no-results p:first-of-type {
    font-weight: 500;
    font-size: 18px;
    color: #333;
}

/* Responsive design */
@media screen and (max-width: 1200px) {
    .wc-order-overview-table-container {
        overflow-x: auto;
    }
    
    .wc-order-overview-table {
        min-width: 900px;
    }
}

@media screen and (max-width: 1100px) {
    .wc-order-overview-table th,
    .wc-order-overview-table td {
        padding: 0.85rem 0.7rem;
    }
    
    .order-number-display {
        font-size: 13px;
    }
    
    .product-list {
        max-width: 200px;
    }
}

@media screen and (max-width: 767px) {
    /* Hide less important columns on mobile */
    .wc-order-overview-table th:nth-child(3),
    .wc-order-overview-table td:nth-child(3),
    .wc-order-overview-table th:nth-child(6),
    .wc-order-overview-table td:nth-child(6) {
        display: none;
    }
    
    .product-list {
        max-width: 150px;
    }
}

/* Animations */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Modern scrollbar */
.wc-order-overview-table::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.wc-order-overview-table::-webkit-scrollbar-track {
    background: #f6f4fa;
    border-radius: 4px;
}

.wc-order-overview-table::-webkit-scrollbar-thumb {
    background: #bebebe;
    border-radius: 4px;
}

.wc-order-overview-table::-webkit-scrollbar-thumb:hover {
    background: #7e57c2;
}

/* Table container with horizontal scrolling for mobile */
.wc-order-overview-table-container {
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
}

/* Enhanced table header icons */
.header-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.order-number-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>');
}

.customer-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
}

.location-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>');
}

.products-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path></svg>');
}

.price-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>');
}

.files-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>');
}

.invoice-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>');
}

.status-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"></path></svg>');
}

.action-icon {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="14 2 18 6 7 17 3 17 3 13 14 2"></polygon><line x1="3" y1="22" x2="21" y2="22"></line></svg>');
}

/* Order number cell */
.order-number {
    font-weight: 600;
}

.order-number-display {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.order-date {
    font-size: 12px;
    color: #777;
}

/* Customer data */
.customer-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.customer-email {
    font-size: 13px;
    color: #777;
}

/* Shipping address */
.shipping-address {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

.no-shipping {
    font-style: italic;
    color: #888;
}

/* Product list styling */
.product-list {
    max-width: 300px;
}

.product-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.product-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.product-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    display: flex;
    flex-direction: column;
}

.product-details a {
    margin-bottom: 4px;
}

.product-quantity {
    font-size: 12px;
    color: #777;
}

.hidden-products {
    display: none;
}

.more-products {
    font-size: 12px;
    color: #777;
    font-style: italic;
    margin-top: 5px;
}

.toggle-products {
    color: #7e57c2;
    cursor: pointer;
    font-size: 13px;
    display: inline-block;
    margin-top: 8px;
    border: none;
    background: none;
    padding: 0;
    font-weight: 500;
}

.toggle-products:hover {
    text-decoration: underline;
}

/* Product list toggle states */
.product-list.expanded .hidden-products {
    display: block;
    animation: fadeIn 0.3s ease;
}

.product-list.expanded .more-products {
    display: none;
}

/* Order total styling */
.order-total {
    text-align: right;
}

.price-amount {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin-bottom: 4px;
}

.payment-method {
    font-size: 12px;
    color: #777;
}

/* Files styling */
.files {
    min-width: 120px;
}

.uploaded-file {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.file-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.uploaded-file a {
    font-size: 13px;
}

.no-files {
    color: #888;
    font-style: italic;
    font-size: 12px;
}

/* Invoice styling */
.invoice-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-link .invoice-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.no-invoice {
    color: #888;
    font-style: italic;
    font-size: 12px;
}

/* Action column styling */
.approved-status {
    display: flex;
    align-items: center;
    color: #4caf50;
    font-weight: 500;
}

.approved-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%234caf50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.no-action {
    color: #888;
    font-style: italic;
    font-size: 12px;
}

/* Button icon */
.approve-order-button .button-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

/* Row hover animation */
.order-row {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    z-index: 1;
    position: relative;
}

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

/* Initial loading state */
.wc-order-overview-initial-loading {
    display: none;
}

/* Make sure the table container has proper spacing when empty */
.wc-order-overview-table-container:empty {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced table container - force visibility */
.wc-order-overview-table-container {
    margin-top: 1.5rem !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Make table always visible */
.wc-order-overview-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: table !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix any table rows that might be hidden */
.wc-order-overview-table tr {
    display: table-row !important;
    opacity: 1 !important;
}

/* Ensure cell display */
.wc-order-overview-table td, 
.wc-order-overview-table th {
    display: table-cell !important;
}

/* Search highlight styling */
.search-highlight {
    background-color: rgba(0,133,202,0.2);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* Search status indicator */
.search-status {
    margin-top: 0.5rem;
    font-size: 13px;
    color: #666;
    margin-bottom: 1rem;
}

/* Clear search button hover effect */
.clear-search-button:hover {
    color: #5e35b1;
    background-color: rgba(94, 53, 177, 0.08);
    border-radius: 50%;
}

/* Enhanced form styling */
.wc-order-overview-search {
    display: flex;
    align-items: center;
    position: relative;
}

.wc-order-overview-search input:focus + .clear-search-button {
    color: #5e35b1;
}

/* Ensure the table still looks good */
.wc-order-overview-container {
    margin-top: 20px;
}

/* Styling for files in the action column */
.order-files {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

.files-heading {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.order-files a {
    display: block;
    margin: 3px 0;
    padding: 3px 0;
    font-size: 13px;
    color: #7e57c2;
    text-decoration: none;
}

.order-files a:hover {
    color: #5e35b1;
    text-decoration: underline;
}

/* Add file icon */
.order-files a:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%237e57c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Adjust action column width to accommodate files */
.wc-order-overview-table th:last-child,
.wc-order-overview-table td:last-child {
    min-width: 140px;
    width: auto;
}

/* Hide any remaining file columns that might be present */
.wc-order-overview-table th:nth-child(6),
.wc-order-overview-table td:nth-child(6) {
    display: none !important;
}

/* Compact files styling */
.order-files-compact {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    background: #7e57c2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 5px;
    white-space: nowrap;
}

.file-badge:hover {
    background: #6441a5;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.file-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1v5h5v10H6V3h7z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.file-label {
    font-weight: 400;
    margin-right: 4px;
}

.file-count {
    font-weight: 600;
    opacity: 0.9;
}

.order-files-compact {
    margin-top: 8px;
    display: block;
}

/* When space is tight, ensure it doesn't wrap awkwardly */
@media screen and (max-width: 1100px) {
    .file-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .file-icon {
        width: 12px;
        height: 12px;
        margin-right: 4px;
    }
}

/* Popup styling */
.files-popup {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    margin-top: 8px;
}

.files-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

.files-popup-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.close-popup {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 5px;
}

.files-popup-content {
    padding: 10px 15px;
    max-height: 200px;
    overflow-y: auto;
}

.files-popup-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.files-popup-content li {
    margin-bottom: 8px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.files-popup-content li:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.files-popup-content a {
    color: #7e57c2;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-popup-content a:hover {
    text-decoration: underline;
}

.files-popup-content a:before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%237e57c2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1v5h5v10H6V3h7z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

/* Show popup when active */
.files-popup.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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