/*
 * Enhanced Products Page Styles - Dokan Marketplace Style
 * Modern marketplace layout for product listings
 */

/* Main Container */
.epf-products-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    min-height: 70vh;
}

/* Page Header */
.epf-products-header {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.epf-header-content {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #374151;
}

.epf-page-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.epf-page-title i {
    font-size: 28px;
}

.epf-product-count {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.7;
    color: #6b7280;
}

.epf-add-product-btn {
    background: #260aae;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #260aae;
    display: flex;
    align-items: center;
    gap: 8px;
}

.epf-add-product-btn:hover {
    background: #1e0889;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    border-color: #1e0889;
    box-shadow: 0 4px 12px rgba(38, 10, 174, 0.3);
}

/* Filters Section */
.epf-products-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.epf-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.epf-filter-group {
    display: flex;
    flex-direction: column;
}

.epf-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.epf-filter-select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.epf-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Products Table */
.epf-products-main {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.epf-products-table-container {
    overflow-x: auto;
    border-radius: 12px;
}

.epf-products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.epf-products-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.epf-products-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef;
}

.epf-products-table tr:hover {
    background: #f8f9fa;
}

.epf-products-table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

/* Table Column Styles */
.epf-col-product { min-width: 300px; width: 35%; }
.epf-col-stock { width: 12%; }
.epf-col-price { width: 15%; }
.epf-col-inventory { width: 8%; text-align: center; }
.epf-col-date { width: 12%; }
.epf-col-status { width: 10%; }
.epf-col-actions { width: 8%; text-align: center; }

/* Product Info in Table */
.epf-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epf-product-thumb-wrapper {
    position: relative;
    flex-shrink: 0;
}

.epf-product-thumb-table {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.epf-no-image-table {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.epf-no-image-table i {
    font-size: 20px;
}

/* Video Indicator */
.epf-video-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    border: 2px solid white;
}

/* Condition Indicator */
.epf-condition-indicator {
    position: absolute;
    bottom: -2px;
    left: -2px;
    padding: 2px 4px;
    font-size: 8px;
    font-weight: 700;
    border-radius: 3px;
    color: white;
    border: 1px solid white;
}

.epf-condition-new { background: #28a745; }
.epf-condition-like-new { background: #20c997; }
.epf-condition-very-good { background: #17a2b8; }
.epf-condition-good { background: #007bff; }
.epf-condition-acceptable { background: #ffc107; color: #000; }
.epf-condition-for-parts { background: #dc3545; }

/* Product Details */
.epf-product-details {
    flex: 1;
    min-width: 0;
}

.epf-product-title-table {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.epf-product-title-table a {
    color: #495057;
    text-decoration: none;
    transition: color 0.3s ease;
}

.epf-product-title-table a:hover {
    color: #007bff;
}

.epf-product-meta-table {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6c757d;
}

.epf-location-meta,
.epf-author-meta {
    display: flex;
    align-items: center;
    gap: 3px;
}

.epf-location-meta i,
.epf-author-meta i {
    font-size: 10px;
}

/* Stock Status Badges */
.epf-stock-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.epf-stock-instock {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.epf-stock-outofstock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Price Styling in Table */
.epf-price-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.epf-price-main-table {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
}

.epf-price-table-free {
    color: #dc3545;
    font-weight: 700;
    font-size: 14px;
}

.epf-seller-gets-table {
    font-size: 10px;
    color: #6c757d;
}

/* Inventory Count */
.epf-inventory-count {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Date Info */
.epf-date-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.epf-date-main {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.epf-time-main {
    font-size: 11px;
    color: #6c757d;
}

/* Status Badges */
.epf-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.epf-status-publish {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.epf-status-draft {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.epf-status-pending {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.epf-status-private {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.epf-status-future {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

/* Action Buttons */
.epf-actions-table {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.epf-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 12px;
}

.epf-view-btn-table:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.epf-edit-btn-table:hover {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.epf-free-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Product Content */
.epf-product-content {
    padding: 20px;
}

.epf-product-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.epf-product-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.3s ease;
}

.epf-product-title a:hover {
    color: #667eea;
}

/* Price Section */
.epf-product-price {
    margin-bottom: 15px;
}

.epf-price-main {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
}

.epf-price-free {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.epf-price-breakdown {
    margin-top: 4px;
}

.epf-seller-gets {
    color: #6b7280;
    font-size: 12px;
}

/* Product Meta */
.epf-product-meta {
    margin-bottom: 15px;
}

.epf-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #6b7280;
}

.epf-meta-item:last-child {
    margin-bottom: 0;
}

.epf-meta-item i {
    width: 14px;
    font-size: 12px;
    color: #9ca3af;
}

/* Product Categories */
.epf-product-categories {
    margin-bottom: 15px;
}

.epf-category-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 4px;
}

/* Product Actions */
.epf-product-actions {
    display: flex;
    gap: 8px;
}

.epf-view-btn,
.epf-edit-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.epf-view-btn {
    background: #667eea;
    color: white;
}

.epf-view-btn:hover {
    background: #5a67d8;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.epf-edit-btn {
    background: #f59e0b;
    color: white;
    border: none;
}

.epf-edit-btn:hover {
    background: #d97706;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* No Products Found */
.epf-no-products {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.epf-no-products-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.epf-no-products-content i {
    font-size: 80px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.epf-no-products-content h3 {
    font-size: 24px;
    color: #374151;
    margin-bottom: 12px;
    font-weight: 600;
}

.epf-no-products-content p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.6;
}

.epf-add-first-product-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.epf-add-first-product-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Pagination */
.epf-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.epf-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 4px;
}

.epf-pagination .page-numbers li {
    display: flex;
}

.epf-pagination .page-numbers a,
.epf-pagination .page-numbers span {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.epf-pagination .page-numbers .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.epf-pagination .page-numbers a:hover {
    background: #f3f4f6;
    border-color: #667eea;
    color: #667eea;
}

/* Mobile Responsiveness for Table */
@media (max-width: 768px) {
    .epf-products-page-container {
        padding: 15px;
    }
    
    .epf-header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .epf-page-title {
        font-size: 24px;
        flex-direction: column;
        gap: 8px;
    }
    
    .epf-filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Mobile Table Styling */
    .epf-products-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .epf-products-table {
        min-width: 800px;
    }
    
    .epf-products-table th,
    .epf-products-table td {
        padding: 8px 6px;
    }
    
    .epf-col-product { min-width: 250px; }
    .epf-col-stock { min-width: 80px; }
    .epf-col-price { min-width: 100px; }
    .epf-col-inventory { min-width: 60px; }
    .epf-col-date { min-width: 90px; }
    .epf-col-status { min-width: 80px; }
    .epf-col-actions { min-width: 70px; }
    
    .epf-product-thumb-table {
        width: 50px;
        height: 50px;
    }
    
    .epf-no-image-table {
        width: 50px;
        height: 50px;
    }
    
    .epf-product-title-table {
        font-size: 13px;
    }
    
    .epf-product-meta-table {
        font-size: 10px;
    }
    
    .epf-pagination .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .epf-pagination .page-numbers a,
    .epf-pagination .page-numbers span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .epf-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .epf-product-image {
        height: 180px;
    }
    
    .epf-product-content {
        padding: 16px;
    }
    
    .epf-no-products-content {
        padding: 30px 20px;
    }
    
    .epf-no-products-content i {
        font-size: 60px;
    }
    
    .epf-no-products-content h3 {
        font-size: 20px;
    }
}

/* Dokan-style seller info */
.epf-seller-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.epf-seller-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.epf-seller-name {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

/* Loading and Empty States */
.epf-products-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #6b7280;
}

.epf-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search and Filter Enhancement */
.epf-search-results-info {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Stock Status */
.epf-stock-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.epf-stock-instock {
    background: #10b981;
    color: white;
}

.epf-stock-outofstock {
    background: #ef4444;
    color: white;
}

/* Featured Product Styling (if implementing featured listings) */
.epf-product-card.featured {
    border: 2px solid #f59e0b;
    position: relative;
}

.epf-product-card.featured::before {
    content: "Featured";
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f59e0b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
}

/* Enhanced Product Actions for better UX */
.epf-quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.epf-product-card:hover .epf-quick-view-btn {
    opacity: 1;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .epf-products-page-container {
        background-color: #1f2937;
    }
    
    .epf-products-filters,
    .epf-products-main,
    .epf-product-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .epf-filter-select {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .epf-product-title a {
        color: #f9fafb;
    }
    
    .epf-filter-label {
        color: #f9fafb;
    }
}
