/**
 * Product Comparison Table Styles
 *
 * @package Product_Comparison
 */

.pc-comparison-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Loading Indicator */
.pc-comparison-loading {
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 15px;
}

.pc-comparison-loading .spinner {
    float: none;
    margin: 0 auto 10px;
}

/* Product Selector */
.pc-product-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.pc-selector-column select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.pc-selector-column select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Comparison Table */
.pc-comparison-table-wrapper {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pc-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.pc-comparison-table thead {
    background: #f9f9f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pc-comparison-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.pc-comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

/* Product Header */
.pc-product-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.pc-product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.pc-product-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.pc-product-link {
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.pc-product-link:hover {
    text-decoration: underline;
}

/* Attribute Label */
.pc-attribute-label {
    font-weight: 600;
    color: #555;
    background: #f9f9f9;
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 5;
}

/* Attribute Values */
.pc-attribute-value {
    text-align: left;
    vertical-align: top;
    min-width: 150px;
}

/* Value Types */
.pc-empty-value {
    color: #999;
    font-style: italic;
}

.pc-boolean-value.pc-yes {
    color: #00a32a;
    font-weight: 500;
}

.pc-boolean-value.pc-no {
    color: #d63638;
    font-weight: 500;
}

.pc-multi-value {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    margin: 2px;
    font-size: 13px;
}

.pc-text-value {
    color: #333;
}

/* Empty State */
.pc-empty-row {
    background: #f9f9f9;
}

.pc-empty-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Error State */
.pc-error-message {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #f9f9f9;
}

/* Current Product Indicator */
.pc-current-product {
    padding: 12px 15px;
    background: #e8f4f8;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc-current-label {
    font-weight: 600;
    color: #333;
}

.pc-current-title {
    color: #0073aa;
}

/* Category Filter */
.pc-category-filter {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.pc-category-filter label {
    font-weight: 600;
    margin-right: 10px;
}

.pc-category-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Row Hover Effect */
.pc-attribute-row:hover {
    background: #f5f5f5;
}

.pc-attribute-row:hover .pc-attribute-label {
    background: #f0f0f0;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .pc-product-selector {
        grid-template-columns: 1fr;
    }

    .pc-comparison-table {
        font-size: 14px;
    }

    .pc-comparison-table th,
    .pc-comparison-table td {
        padding: 10px;
    }

    .pc-attribute-label {
        min-width: 150px;
        font-size: 13px;
    }

    .pc-product-thumbnail {
        width: 60px;
        height: 60px;
    }

    .pc-product-title {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .pc-comparison-wrapper {
        margin: 10px 0;
    }

    .pc-comparison-table th,
    .pc-comparison-table td {
        padding: 8px;
        font-size: 13px;
    }

    .pc-multi-value {
        display: block;
        margin: 2px 0;
    }
}

/* Print Styles */
@media print {
    .pc-product-selector,
    .pc-category-filter {
        display: none;
    }

    .pc-comparison-table {
        page-break-inside: auto;
    }

    .pc-attribute-row {
        page-break-inside: avoid;
    }
}

/* Property Comparison - Hidden Rows with Fade Effect */
.pc-attribute-row-hidden {
    display: none;
}

.pc-comparison-table-wrapper.pc-has-hidden-rows {
    position: relative;
    padding-bottom: 20px;
}

.pc-comparison-table-wrapper.pc-has-hidden-rows .pc-comparison-table {
    position: relative;
    padding-bottom: 40px;
}

.pc-comparison-table-wrapper.pc-has-hidden-rows .pc-comparison-table::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
}

/* Show More Link */
.pc-show-more-wrapper {
    text-align: center;
    padding: 10px 0;
}

.pc-show-more-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pc-show-more-button::before {
    content: '↓';
    font-size: 12px;
    transition: transform 0.2s ease;
}

.pc-show-more-button:hover {
    color: #005a87;
}

.pc-show-more-button:hover::before {
    transform: translateY(2px);
}

.pc-show-more-button:active {
    color: #004566;
}

/* Product Downloads List */
.pc-downloads-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pc-downloads-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.pc-downloads-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pc-download-item {
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
}

.pc-download-item:last-child {
    border-bottom: none;
}

.pc-download-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.pc-download-link:hover {
    color: #0073aa;
    padding-left: 4px;
}

.pc-download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #555;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.pc-download-link:hover .pc-download-icon {
    background: #0073aa;
    color: #fff;
}

.pc-download-icon svg {
    width: 20px;
    height: 20px;
}

.pc-download-description {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.pc-download-size {
    font-size: 13px;
    color: #777;
    font-weight: 400;
}

/* Responsive Design for Downloads */
@media screen and (max-width: 480px) {
    .pc-download-link {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pc-download-size {
        width: 100%;
        margin-left: 48px;
    }
}
