/* Compare Page Styles - Matching Favorites Design */

/* Page header styling - Same as favorites */
.compare-header {
    border-bottom: 3px solid #f0f0f0;
    padding: 2rem 0 0.25rem;
    margin-bottom: 0;
    background: #fafafa;
}

.compare-header h1 {
    color: #2c3e50;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0;
    letter-spacing: -0.5px;
}

.compare-header .subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Breadcrumb styling - Same as favorites */
.breadcrumb-nav {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-nav ol {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-nav a {
    color: #868e96;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: #495057;
    text-decoration: underline;
}

.breadcrumb-nav .active {
    color: #6c757d;
    font-weight: 600;
}

/* Container adjustments */
.compare-container {
    margin-top: 0;
    padding-top: 0 !important;
    padding-bottom: 3rem !important;
    overflow-x: hidden;
}

/* Container spacing adjustments */
.container[data-locale] {
    margin-top: 0 !important;
    margin-bottom: 3rem !important;
}

/* Add more button */
.add-more-btn {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.add-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.3);
}

/* Comparison filters */
.comparison-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: #495057;
    color: white;
    border-color: #495057;
}

.filter-btn:hover:not(.active) {
    background: #f8f9fa;
    border-color: #6c757d;
}

/* Empty state - Similar to favorites */
.empty-compare {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: white;
    font-size: 2.5rem;
}

.empty-compare h3 {
    color: #495057;
    font-weight: 600;
    font-size: 1.5rem;
}

/* Product Comparison Table */
.table-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table-scroll::-webkit-scrollbar {
    height: 6px;
}

.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

/* Product headers */
.product-headers {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-header {
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    border-right: 1px solid #dee2e6;
    min-width: 280px;
    max-width: 320px;
    z-index: 1;
}

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

/* Remove button - Similar to favorites */
.remove-product {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #6c757d;
    color: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 20;
    pointer-events: auto;
}

.remove-product:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-image {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 0.75rem;
    margin: 0 auto 1rem;
    border: 1px solid #dee2e6;
    background: white;
    padding: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-brand {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #495057;
    margin-bottom: 1.5rem;
}

/* Quick action buttons */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.action-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 120px;
}

.btn-primary-action {
    background: #6c757d;
    color: white;
}

.btn-primary-action:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-secondary-action {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary-action:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Specification rows */
.spec-row {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.spec-row:hover {
    background: rgba(73, 80, 87, 0.02);
}

.spec-name {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #2c3e50;
    padding: 1.25rem 1.5rem;
    border-right: 1px solid #dee2e6;
    width: 200px;
    vertical-align: middle;
    position: sticky;
    left: 0;
    z-index: 5;
}

.spec-value {
    padding: 1.25rem 1.5rem;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #dee2e6;
    position: relative;
    font-weight: 500;
}

.spec-value:last-child {
    border-right: none;
}

/* Difference Highlighting */
.spec-different {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    position: relative;
}

.spec-different::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #f59e0b;
}

.spec-best-value {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    position: relative;
    font-weight: 700;
}

.spec-best-value::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #10b981;
}

.spec-worst-value {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    position: relative;
}

.spec-worst-value::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ef4444;
}

.difference-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #f59e0b;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Category headers */
.category-header {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
}

.category-header td {
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Responsive design */
@media (max-width: 768px) {
    .compare-header {
        padding: 1.5rem 0 1rem;
        margin: -1rem -15px 1.5rem -15px;
    }
    
    .compare-header h1 {
        font-size: 1.5rem;
    }
    
    .comparison-filters {
        justify-content: center;
    }
    
    .product-header {
        min-width: 240px;
        padding: 1.5rem 1rem;
    }
    
    .spec-name {
        width: 150px;
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .spec-value {
        padding: 1rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltips */
.tooltip-info {
    position: relative;
    cursor: help;
}

.tooltip-info:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.tooltip-info:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1000;
}