/* Order Popup Styles */
#fpm-order-modal .fpm-modal-container {
    max-width: 800px;
}

.order-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.order-section {
    margin-bottom: 20px;
}

.order-section h4 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-table th, 
.order-items-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.order-items-table th {
    background-color: #f5f5f5;
}

.order-item-image img {
    width: 50px;
    height: auto;
}

.order-totals {
    margin-top: 20px;
    width: 100%;
}

.order-totals tr:last-child {
    font-weight: bold;
    border-top: 2px solid #eee;
}

/* Loading spinner */
.fpm-loading {
    text-align: center;
    padding: 20px;
}

.fpm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #005a3d;
    animation: fpm-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes fpm-spin {
    to { transform: rotate(360deg); }
}


 /* Order Details Styling */
            .fpm-order-details {
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
                color: #333;
                line-height: 1.5;
            }

            .order-header {
                background: #f8f9fa;
                padding: 20px;
                border-radius: 5px;
                margin-bottom: 20px;
                position: relative;
            }

            .order-header h2 {
                margin: 0 0 5px 0;
                color: #2c3338;
            }

            .fpm-order-status {
                position: absolute;
                top: 20px;
                right: 20px;
                padding: 5px 10px;
                border-radius: 3px;
                font-size: 14px;
                font-weight: 600;
                text-transform: capitalize;
            }

            .order-status.completed {
                background: #d4edda;
                color: #155724;
            }

            .order-status.processing {
                background: #cce5ff;
                color: #004085;
            }

            .order-status.pending {
                background: #fff3cd;
                color: #856404;
            }

            .order-status.failed {
                background: #f8d7da;
                color: #721c24;
            }

            .order-date {
                color: #6c757d;
                margin: 0;
            }

            .order-columns {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 20px;
                margin-bottom: 20px;
            }

            .order-section {
                background: #fff;
                border: 1px solid #e0e0e0;
                border-radius: 5px;
                padding: 15px;
                margin-bottom: 20px;
            }

            .order-section h3 {
                margin-top: 0;
                color: #2c3338;
                font-size: 18px;
                border-bottom: 1px solid #eee;
                padding-bottom: 10px;
            }

            .order-section h3 i {
                margin-right: 8px;
                color: #6c757d;
            }

            .order-items {
                width: 100%;
                border-collapse: collapse;
            }

            .order-items th {
                background: #f8f9fa;
                text-align: left;
                padding: 10px;
                font-weight: 600;
            }

            .order-items td {
                padding: 15px 10px;
                border-bottom: 1px solid #eee;
                vertical-align: top;
            }

            .product-col { width: 50%; }
            .price-col, .qty-col { width: 15%; }
            .total-col { width: 20%; }

            .product-info {
                display: flex;
                align-items: flex-start;
                gap: 15px;
            }

            .product-image img {
                width: 60px;
                height: auto;
                border-radius: 3px;
            }

            .product-name {
                flex-grow: 1;
            }

            .product-sku {
                font-size: 13px;
                color: #6c757d;
                margin-top: 3px;
            }

            .product-meta {
                margin-top: 8px;
            }

            .meta-item {
                font-size: 13px;
                line-height: 1.4;
            }

            .order-totals {
                width: 100%;
                max-width: 300px;
                margin-left: auto;
            }

            .order-totals th {
                text-align: left;
                padding: 8px 0;
            }

            .order-totals td {
                text-align: right;
                padding: 8px 0;
            }

            .order-totals tr:last-child {
                border-top: 2px solid #eee;
                font-weight: bold;
                font-size: 1.1em;
            }

            .customer-note {
                background: #f8f9fa;
                padding: 15px;
                border-radius: 5px;
                border-left: 3px solid #6c757d;
            }

            @media (max-width: 768px) {
                .order-columns {
                    grid-template-columns: 1fr;
                }
                
                .order-items th, 
                .order-items td {
                    padding: 10px 5px;
                    font-size: 14px;
                }
                
                .product-col { width: 60%; }
                .price-col, .qty-col { width: 10%; }
                .total-col { width: 20%; }
            }


              #order-status-popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }
    
    .popup-content {
        background: #fff;
        padding: 20px;
        border-radius: 5px;
        width: 90%;
        max-width: 400px;
    }
    
  #new-status-select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #000 !important;
}
    
    .popup-buttons {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }
    
    .popup-buttons button {
        flex: 1;
        padding: 10px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
    
    .save-status {
        background: #005a3d;
        color: #fff;
    }
    
    .cancel-popup {
    background: #ad1212db;
}
    .cancel-popup:hover {
    background: #ad1212db;
}
    
    #status-update-message {
        margin-top: 15px;
        padding: 10px;
        border-radius: 4px;
        display: none;
    }
    
    .success-message {
        background: #d4edda;
        color: #005a3d;
    }
    
    .error-message {
        background: #f8d7da;
        color: #721c24;
    }


    div#orders-tab h3 {
    font-size: 30px;
    font-weight: 700;
}



table#fpm-orders-table {
    width: 100% !important;
}

table#fpm-orders-table tr th {
    text-align: left !important;
}

table#fpm-orders-table tbody tr td {
    text-align: left !important;
}
[dir="rtl"] table#fpm-orders-table tbody tr td {
    text-align: right !important;
}
[dir="rtl"] table#fpm-orders-table tr th {
    text-align: right !important;
}

div#fpm-orders-table_filter {
    margin-left: 0px !important;
}

/* Enhanced Media Wrapper */
.custom-media-wrapper {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.custom-media-wrapper:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.custom-media-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.custom-media-wrapper:hover::before {
    left: 100%;
}

/* Enhanced Primary Button */
.custom-media-open.button.button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.custom-media-open.button.button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.custom-media-open.button.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.custom-media-open.button.button-primary:hover::before {
    left: 100%;
}

.custom-media-open.button.button-primary:active {
    transform: translateY(0);
}

/* Preview Container */
.custom-media-preview {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.custom-media-preview:not(:empty) {
    border: 3px solid #e5e7eb;
    padding: 10px;
    background: white;
}

.custom-media-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.custom-media-preview:hover img {
    transform: scale(1.02);
}

/* Modal Styles */
.custom-media-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-media-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: backdropFadeIn 0.4s ease;
}

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-media-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    max-height: 700px;
    position: relative;
    overflow: hidden;
    animation: contentSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes contentSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.custom-media-modal-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.custom-media-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #f1f5f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.custom-media-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-media-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.custom-media-modal-close .dashicons {
    font-size: 20px;
}

/* Modal Body */
.custom-media-modal-body {
    display: flex;
    height: calc(100% - 80px);
}

/* Sidebar */
.custom-media-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e5e7eb;
    padding: 24px;
    overflow-y: auto;
}

.custom-media-upload-container {
    margin-bottom: 24px;
}

.custom-media-upload.button.button-primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.custom-media-upload.button.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.custom-media-upload .dashicons {
    font-size: 18px;
}

/* Library */
.custom-media-library {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.custom-media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(45deg, #f8fafc, #e2e8f0);
}

.custom-media-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.custom-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.media-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.media-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.media-item.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.media-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-item:hover img {
    transform: scale(1.1);
}

/* Preview Pane */
.custom-media-preview-pane {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-left: 1px solid #e5e7eb;
    padding: 24px;
    overflow-y: auto;
}

.custom-media-preview-pane h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    background: linear-gradient(135deg, #1f2937 0%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.custom-media-preview-image {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.custom-media-preview-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.custom-media-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-media-select.button.button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.custom-media-select.button.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.custom-media-delete.button.button-link {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.custom-media-delete.button.button-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-media-modal-content {
        width: 95%;
        height: 90vh;
    }
    
    .custom-media-modal-body {
        flex-direction: column;
    }
    
    .custom-media-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .custom-media-preview-pane {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
    
    .custom-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 16px;
    }
}

/* Scrollbar Styling */
.custom-media-library::-webkit-scrollbar,
.custom-media-sidebar::-webkit-scrollbar,
.custom-media-preview-pane::-webkit-scrollbar {
    width: 8px;
}

.custom-media-library::-webkit-scrollbar-track,
.custom-media-sidebar::-webkit-scrollbar-track,
.custom-media-preview-pane::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-media-library::-webkit-scrollbar-thumb,
.custom-media-sidebar::-webkit-scrollbar-thumb,
.custom-media-preview-pane::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-media-library::-webkit-scrollbar-thumb:hover,
.custom-media-sidebar::-webkit-scrollbar-thumb:hover,
.custom-media-preview-pane::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}