/* Products Page Styles */
.products-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.products-title {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-section {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-input {
    flex: 1;
    min-width: 300px;
}

.add-product-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.add-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Products Tree Container */
.products-tree-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Product Tree Item */
.product-tree-item {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.product-tree-item:last-child {
    border-bottom: none;
}

.product-tree-item:hover {
    background-color: #f8f9fa;
}

.product-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.product-header:hover {
    background-color: #f1f3f4;
}

.expand-icon {
    margin-right: 12px;
    color: #6c757d;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.product-icon {
    margin-right: 15px;
    color: #007bff;
    font-size: 24px;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.product-code {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.product-details {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 20px;
}

.product-brand {
    font-size: 14px;
    color: #495057;
    margin: 0;
    font-weight: 500;
}

.product-category {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.status-badge-active {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.status-badge-inactive {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.btn-product-details {
    background: linear-gradient(45deg, #17a2b8, #138496);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-product-details:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-edit {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    border: none;
    color: #212529;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-delete {
    background: linear-gradient(45deg, #dc3545, #c82333);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Variant Tree Item */
.variant-tree-item {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    margin-left: 20px;
    margin-right: 20px;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.variant-tree-item:hover {
    background: #e9ecef;
    border-left-color: #0056b3;
}

.variant-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.variant-expand {
    margin-right: 10px;
    color: #6c757d;
    font-size: 18px;
}

.variant-icon {
    margin-right: 12px;
    color: #28a745;
    font-size: 20px;
}

.variant-info {
    flex: 1;
    min-width: 0;
}

.variant-name {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.variant-code {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.variant-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
}

.variant-barcode {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.variant-price {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
    margin: 0;
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}

/* Attributes Container */
.attributes-container {
    background: white;
    margin: 10px 20px 10px 60px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.attribute-tree-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.attribute-tree-item:last-child {
    border-bottom: none;
}

.attribute-tree-item:hover {
    background-color: #f8f9fa;
}

.attribute-icon {
    margin-right: 12px;
    color: #6f42c1;
    font-size: 18px;
}

.attribute-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attribute-name {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.attribute-value {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    font-weight: 500;
}

/* Loading and Empty States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .product-actions {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .products-container {
        padding: 10px;
    }
    
    .products-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .search-section {
        flex-direction: column;
        width: 100%;
        margin: 0;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .product-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .variant-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .attributes-container {
        margin-left: 20px;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .products-title {
        font-size: 24px;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .variant-name {
        font-size: 14px;
    }
    
    .product-actions {
        flex-wrap: wrap;
    }
}

/* Animation for expand/collapse */
.product-tree-item {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar for long lists */
.products-tree-container::-webkit-scrollbar {
    width: 8px;
}

.products-tree-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.products-tree-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.products-tree-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}