/* Product Comparison Styles */

.compare-loading-container,
.compare-error-container,
.compare-results-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.compare-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-message {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* Error Container */
.compare-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-error-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.error-icon {
    font-size: 60px;
    color: #ef4444;
    margin-bottom: 20px;
}

.compare-error-content h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #1f2937;
}

.compare-error-content p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 30px;
}

.retry-button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Results Container */
.compare-results-container {
    padding: 30px 20px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.results-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.results-meta {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.new-search-button {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.new-search-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: slideUp 0.5s ease-out;
    animation-fill-mode: both;
    display: flex;
    flex-direction: column;
    min-height: 650px;
    height: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.product-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
}

.product-source-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-source-badge.amazon {
    background: linear-gradient(135deg, #ff9900 0%, #ff6600 100%);
    color: white;
}

.product-source-badge.flipkart {
    background: linear-gradient(135deg, #2874f0 0%, #1557bf 100%);
    color: white;
}

.scraper-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.scraper-badge.playwright {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white;
}

.scraper-badge.selenium {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.product-image-container {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 20px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.product-details {
    padding: 20px;
    flex: 1;
    overflow: visible;
    min-height: 200px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.product-price {
    font-size: 28px;
    font-weight: 700;
    color: #10b981;
}

.product-original-price {
    font-size: 18px;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.rating-stars {
    color: #fbbf24;
    font-size: 14px;
}

.rating-value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.reviews-count {
    font-size: 13px;
    color: #6b7280;
}

.product-features {
    margin-bottom: 20px;
}

.product-features h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.product-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-features li {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.product-features li i {
    color: #10b981;
    margin-top: 2px;
}

.product-actions {
    padding: 0 20px 20px;
    margin-top: auto;
}

.buy-now-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.buy-now-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Comparison-specific styles */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.comparison-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.vs-badge {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.comparison-product-card {
    background: white;
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: slideUp 0.6s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 700px;
    height: auto;
}

.comparison-product-card.winner {
    box-shadow: 0 20px 60px rgba(252, 211, 77, 0.4);
    border: 3px solid #fbbf24;
}

.winner-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comparison-recommendation {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    color: white;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.recommendation-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.recommendation-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.recommendation-content p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
}

.product-pros,
.product-cons {
    margin-bottom: 20px;
}

.product-pros h4,
.product-cons h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-pros h4 {
    color: #10b981;
}

.product-cons h4 {
    color: #ef4444;
}

.product-pros ul,
.product-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-pros li,
.product-cons li {
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.product-pros li {
    color: #059669;
}

.product-cons li {
    color: #dc2626;
}

.product-pros li i {
    color: #10b981;
}

.product-cons li i {
    color: #ef4444;
}

.buy-now-button.winner {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .comparison-divider {
        padding: 0;
    }

    .vs-badge {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .results-header h2 {
        font-size: 24px;
    }

    .product-image-container {
        height: 220px;
    }
}
