/**
 * Enhanced Product Comparison Modal Styles
 * For the tabbed comparison modal with search functionality
 */

/* ========================================
   COMPARISON TAB
   ======================================== */

.comparison-container {
    padding: 1.5rem 0;
}

.comparison-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.comparison-comparison-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: top;
}

.comparison-comparison-table td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: top;
}

.comparison-table tr:hover td {
    background-color: #f8f9fa;
}

/* ========================================
   SEARCH TAB
   ======================================== */

.search-container {
    padding: 0;
}

.search-header {
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 1rem 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.search-input-group {
    position: relative;
    display: flex;
}

.search-input-group .form-control {
    border-radius: 6px 0 0 0 6px;
    font-size: 15px;
    padding: 0.75rem 1rem;
    height: 46px;
    border: 1px solid #ced4da;
    background-color: #fff;
}

.search-input-group .btn {
    border-radius: 0 6px 6px 6px;
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.search-input-group .btn:hover {
    background-color: #5a626d;
    border-color: #5a626d;
}

.search-filters {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
}

.search-filters .row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-filters .col-md-4 {
    flex: 1;
    min-width: 200px;
}

.capacity-indicator {
    text-align: center;
    padding: 0.5rem;
    background-color: #e1f4f8;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.capacity-indicator .full {
    background-color: #28a745;
    color: #fff;
}

.capacity-indicator .warning {
    background-color: #ffc107;
    color: #212529;
}

.capacity-indicator .empty {
    background-color: #dc3545;
    color: #212529;
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    background-color: #fff;
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item .product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background-color: #f8f9fa;
    padding: 0.5rem;
    object-fit: cover;
    border: 1px solid #e9ecef;
}

.search-result-item .product-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    margin: 0;
}

.search-result-item .product-meta {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.search-result-item .brand-name {
    font-weight: 600;
    color: #007bff;
}

.search-result-item .category-name {
    color: #6c757d;
}

.search-result-item .price-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-result-item .current-price {
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.search-result-item .original-price {
    font-size: 13px;
    color: #6c757d;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.search-result-item .discount-badge {
    background-color: #28a745;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

.search-result-item .discount-badge.hot {
    background-color: #dc3545;
    color: #212529;
}

/* ========================================
   SEARCH LOADING AND STATES
   ======================================== */

.search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-loading .spinner {
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.search-no-results {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-no-results i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.search-no-results h6 {
    color: #495057;
    margin-top: 1rem;
}

.search-no-results p {
    color: #6c757d;
    margin-bottom: 0;
}

/* ========================================
   PAGINATION
   ======================================== */

.search-pagination {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.search-pagination .btn {
    padding: 0.5rem 1rem;
    min-width: 120px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.search-pagination .load-more .spinner {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

/* ========================================
   COMPARISON TABLE ENHANCEMENTS
   ======================================== */

.comparison-spec-row {
    background-color: #f8f9fa;
}

.comparison-spec-row td {
    vertical-align: top;
    padding: 0.75rem;
}

.comparison-spec-row td:first-child {
    font-weight: 600;
    color: #495057;
    width: 150px;
}

.comparison-spec-row td.spec-label {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.comparison-spec-row td.spec-value {
    font-size: 13px;
    color: #000;
}

.comparison-winner-row {
    background-color: #e9ecef;
}

.comparison-winner-row td {
    padding: 1rem;
    font-size: 12px;
    color: #333;
    border-left: 3px solid #fff;
}

.comparison-winner-row td:first-child {
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.comparison-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    text-align: center;
}

.comparison-empty-state i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.comparison-empty-state h5 {
    color: #495057;
    margin-top: 1rem;
    font-size: 1.25rem;
}

.comparison-empty-state p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.4;
}

.comparison-empty-state .btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.comparison-empty-state .btn:hover {
    background-color: #0056b3;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .comparison-modal .modal-dialog.modal-xl {
        margin: 0;
        max-width: 100%;
        width: 100vw;
        height: 100vh;
    }

    .comparison-modal .modal-content {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 200px);
    }

    .comparison-modal .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }

    .search-results, .search-results-list {
        max-height: 300px;
    }

    .search-result-item {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .search-result-item .product-image {
        margin-bottom: 1rem;
    }

    .search-result-item .product-actions {
        margin-top: 1rem;
        width: 100%;
    }

    .search-header .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-filters .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-filters .col-md-4 {
        width: 100%;
    }

    .search-capacity-indicator {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
        font-size: 11px;
    }

    .search-result-item .product-info {
        width: 100%;
    }

    .search-result-item .product-name {
        font-size: 16px;
        line-height: 1.4;
    }

    .search-result-item .price-section {
        font-size: 14px;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .search-result-item .current-price {
        font-size: 16px;
        font-weight: bold;
    }

    .search-result-item .old-price {
        font-size: 14px;
        margin-right: 0;
    }

    .search-result-item .discount-badge {
        font-size: 11px;
        margin-bottom: 0.5rem;
    }
}

    .comparison-table {
        font-size: 12px;
        margin-bottom: 0;
    }

    .comparison-spec-row td {
        padding: 0.5rem;
        vertical-align: top;
    }

    .comparison-spec-row td:first-child {
        width: auto;
    }

    .comparison-spec-row td:last-child {
        width: auto;
    }
}