/* Product Comparison Table Styles */

.pis-product-comparison {
    margin-top: 60px;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.pis-product-comparison h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.pis-comparison-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Table Wrapper for responsive scrolling */
.pis-comparison-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Main comparison table */
.pis-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

.pis-comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pis-comparison-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.pis-comparison-table th:first-child {
    border-top-left-radius: 6px;
}

.pis-comparison-table th:last-child {
    border-top-right-radius: 6px;
}

/* Column widths */
.pis-col-category {
    width: 12%;
    min-width: 120px;
}

.pis-col-old-product {
    width: 22%;
    min-width: 200px;
}

.pis-col-new-product {
    width: 22%;
    min-width: 200px;
}

.pis-col-benefits {
    width: 28%;
    min-width: 250px;
}

.pis-col-savings {
    width: 16%;
    min-width: 140px;
}

/* Table body */
.pis-comparison-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.pis-comparison-table tbody tr:hover {
    background-color: #f7f9fc;
}

.pis-comparison-table td {
    padding: 20px 12px;
    vertical-align: top;
}

/* Category badge */
.pis-category-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product info styling */
.pis-product-info {
    padding: 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.pis-product-info.pis-recommended {
    background: #e8f5e9;
    border-color: #4caf50;
    position: relative;
}

.pis-product-info.pis-recommended::before {
    content: "RECOMMENDED";
    position: absolute;
    top: -10px;
    right: 10px;
    background: #4caf50;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.pis-product-name {
    display: block;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 8px;
}

.pis-product-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pis-detail-item {
    font-size: 12px;
    color: #6c757d;
}

/* Benefits list */
.pis-benefits-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.pis-benefits-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #495057;
}

.pis-benefits-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 16px;
}

/* Savings info */
.pis-savings-info {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 6px;
    border: 1px solid #667eea30;
}

.pis-savings-amount {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 4px;
}

.pis-savings-percent {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Summary footer */
.pis-comparison-summary {
    background: #f8f9fa;
    font-size: 16px;
}

.pis-comparison-summary td {
    padding: 20px 12px;
    border-top: 2px solid #dee2e6;
}

.pis-summary-label {
    text-align: right;
    color: #333;
}

.pis-summary-value {
    text-align: center;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

#pis-total-savings {
    font-size: 24px;
    color: #2e7d32;
}

/* Placeholder/loading state */
.pis-comparison-row.pis-placeholder {
    opacity: 0.5;
    background: repeating-linear-gradient(
        90deg,
        #f8f9fa,
        #f8f9fa 10px,
        #ffffff 10px,
        #ffffff 20px
    );
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.pis-comparison-table.loading tbody {
    position: relative;
    overflow: hidden;
}

.pis-comparison-table.loading tbody::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.5),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

/* Status indicators */
.pis-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.pis-status-badge.processing {
    background: #fff3cd;
    color: #856404;
}

.pis-status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.pis-status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive design */
@media (max-width: 1024px) {
    .pis-comparison-table {
        font-size: 13px;
    }
    
    .pis-comparison-table th,
    .pis-comparison-table td {
        padding: 12px 8px;
    }
    
    .pis-product-name {
        font-size: 14px;
    }
    
    .pis-savings-amount {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .pis-product-comparison {
        padding: 20px 10px;
    }
    
    .pis-comparison-table-wrapper {
        border-radius: 0;
        margin: 0 -10px;
    }
    
    .pis-comparison-description {
        font-size: 13px;
        padding: 0 10px;
    }
    
    /* Add scroll indicator */
    .pis-comparison-table-wrapper::after {
        content: "→ Scroll for more";
        display: block;
        text-align: center;
        padding: 10px;
        background: #f8f9fa;
        color: #6c757d;
        font-size: 12px;
    }
}

/* Print styles */
@media print {
    .pis-product-comparison {
        background: white;
        box-shadow: none;
    }
    
    .pis-comparison-table thead {
        background: #333;
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .pis-comparison-table tbody tr:nth-child(even) {
        background: #f8f9fa;
    }
}