/* Product Catalog Styles */

.product-catalog-container {
    margin-top: var(--space-6);
}

/* Search and Filter Controls */
.catalog-filters {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: 0 2px 8px var(--shadow-md);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-group label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label i {
    color: var(--primary);
    font-size: 0.875rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-right: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
    width: 24px;
    height: 24px;
}

.clear-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.filter-select {
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.filter-select option {
    background: rgba(17, 24, 39, 0.95);
    color: var(--text);
}

.clear-all-btn {
    padding: var(--space-3) var(--space-4);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--warning, #f59e0b);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.clear-all-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.filter-results-info {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-results-info #results-count {
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .clear-all-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Sync Status Indicator */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: var(--font-size-sm);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-status i {
    font-size: 0.875rem;
}

.sync-status.sync-syncing {
    color: var(--primary);
}

.sync-status.sync-success {
    color: var(--success, #10b981);
}

.sync-status.sync-error {
    color: var(--warning, #f59e0b);
}

.page-header {
    position: relative;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.product-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px var(--shadow-lg);
    margin-bottom: var(--space-6);
    position: relative;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    color: var(--text);
    background: rgba(17, 24, 39, 0.95);
}

.product-table thead {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(16, 185, 129, 0.3));
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header alignment - match data alignment */
.product-table th:nth-child(1),
.product-table th:nth-child(3),
.product-table th:nth-child(5) {
    text-align: center;
}

.product-table th:nth-child(2),
.product-table th:nth-child(4),
.product-table th:nth-child(6),
.product-table th:nth-child(7),
.product-table th:nth-child(8) {
    text-align: left;
}

.product-table th:nth-child(9),
.product-table th:nth-child(11),
.product-table th:nth-child(12),
.product-table th:nth-child(13) {
    text-align: right;
}

.product-table th:nth-child(10) {
    text-align: center;
}

.product-table th {
    padding: var(--space-4) var(--space-3);
    text-align: center;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 101;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(16, 185, 129, 0.3));
    backdrop-filter: blur(10px);
}

.product-table th:last-child {
    border-right: none;
}

.product-table tbody {
    position: relative;
    z-index: 1;
}

.product-table tbody {
    position: relative;
    z-index: 1;
}

.product-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color var(--transition-fast);
    background: rgba(17, 24, 39, 0.95);
}

.product-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.25);
}

.product-table tbody tr:last-child {
    border-bottom: none;
}

.product-table td {
    padding: var(--space-4) var(--space-3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
    word-wrap: break-word;
    text-align: left;
    max-width: 200px;
    background: rgba(17, 24, 39, 0.95);
}

.product-table td:last-child {
    border-right: none;
}

/* Specific column styling */
.product-table td:nth-child(1) {
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    min-width: 80px;
}

.product-table td:nth-child(2) {
    color: var(--text-muted);
    min-width: 120px;
    text-align: left;
}

.product-image-cell {
    text-align: center;
    padding: var(--space-2) !important;
    min-width: 120px;
    position: relative;
}

.product-image-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
}

.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-fast);
    display: block;
}

.product-image-wrapper:hover .product-image {
    transform: scale(1.05);
    border-color: var(--primary);
}

.product-image-enlarge-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    pointer-events: none;
    z-index: 10;
}

.product-image-wrapper:hover .product-image-enlarge-icon {
    opacity: 1;
    transform: scale(1.1);
}

.product-image-enlarge-icon i {
    font-size: 0.75rem;
}

.product-table td:nth-child(4) {
    font-weight: 500;
    color: var(--text);
    min-width: 150px;
    text-align: left;
}

.product-table td:nth-child(5) {
    color: var(--text-muted);
    min-width: 80px;
    text-align: center;
}

.product-table td:nth-child(6) {
    color: var(--text-muted);
    max-width: 250px;
    line-height: 1.5;
    text-align: left;
    text-justify: inter-word;
}

.product-table td:nth-child(7) {
    color: var(--text);
    min-width: 100px;
    text-align: left;
}

.product-table td:nth-child(8) {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    min-width: 120px;
    text-align: left;
}

.product-table td:nth-child(9),
.product-table td:nth-child(11),
.product-table td:nth-child(12),
.product-table td:nth-child(13) {
    font-weight: 600;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
    min-width: 100px;
}

.product-table td:nth-child(10) {
    color: var(--warning);
    text-align: center;
    white-space: nowrap;
    min-width: 100px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state p {
    font-size: var(--font-size-lg);
    margin: 0;
}

/* Image Lightbox Modal */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 10001;
    max-width: 90vw;
    max-height: 90vh;
    background: rgba(17, 24, 39, 0.98);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: lightboxFadeIn 0.3s ease-out;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.lightbox-image-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-4);
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lightbox-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    color: var(--text);
    padding: var(--space-8);
}

.lightbox-loading i {
    font-size: 2rem;
    color: var(--primary);
}

.lightbox-loading span {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.lightbox-info {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.95);
}

.lightbox-title {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.lightbox-description {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .lightbox-image-container {
        max-height: 60vh;
        padding: var(--space-2);
    }

    .lightbox-image {
        max-height: 60vh;
    }

    .lightbox-info {
        padding: var(--space-3) var(--space-4);
    }

    .lightbox-title {
        font-size: var(--font-size-base);
    }

    .lightbox-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-table {
        font-size: var(--font-size-sm);
    }
    
    .product-table th,
    .product-table td {
        padding: var(--space-3) var(--space-2);
    }
}

@media (max-width: 768px) {
    .product-table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .product-table {
        min-width: 1400px;
    }
    
    .product-table th,
    .product-table td {
        padding: var(--space-2);
        font-size: var(--font-size-sm);
    }
    
    .sync-status {
        font-size: var(--font-size-xs);
        padding: 0.375rem 0.75rem;
    }
}

