/* Price Comparison Calculator Specific Styles */

/* Comparison Table */
.comparison-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.comparison-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 20px;
    text-align: center;
}

.comparison-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
    border-top: 1px solid #e2e8f0;
}

.comparison-item {
    padding: 20px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.comparison-item:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.comparison-item.best-value {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #10b981;
}

.comparison-item.best-value::before {
    content: '✓ Best Value';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.retailer-name {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.retailer-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
}

.retailers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.retailer-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.retailer-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.retailer-card.winner {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

.retailer-card.winner::before {
    content: "🏆 Best Deal";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #10b981;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.retailer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.retailer-header h4 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.remove-retailer {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-retailer:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.add-retailer-section {
    text-align: center;
    margin-top: 24px;
    padding: 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.add-retailer-note {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.comparison-table-container {
    margin: 24px 0;
}

.comparison-table {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.comparison-table table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: white;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.comparison-table th {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table tr:nth-child(even) {
    background: #f8fafc;
}

.comparison-table tr:hover {
    background: #f1f5f9;
}

.comparison-table .retailer-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.comparison-table .price {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    font-size: 15px;
}

.comparison-table .best-price {
    color: #10b981;
    background: #ecfdf5;
    padding: 4px 8px;
    border-radius: 4px;
}

.comparison-table .worst-price {
    color: #ef4444;
    background: #fef2f2;
    padding: 4px 8px;
    border-radius: 4px;
}

.comparison-table .trial-period {
    color: #2563eb;
    font-weight: 500;
}

.comparison-table .warranty {
    color: #7c3aed;
    font-weight: 500;
}

.comparison-table .delivery {
    color: #f59e0b;
    font-weight: 500;
}

.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.score-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.score-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.score-card.top-score {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.score-retailer {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.score-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.score-value.excellent {
    color: #10b981;
}

.score-value.good {
    color: #2563eb;
}

.score-value.fair {
    color: #f59e0b;
}

.score-value.poor {
    color: #ef4444;
}

.score-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.score-item-label {
    color: #64748b;
}

.score-item-value {
    font-weight: 500;
    color: #374151;
}

.savings-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.savings-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.savings-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.savings-value.positive {
    color: #10b981;
}

.savings-value.negative {
    color: #ef4444;
}

.savings-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.best-deal-details {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.deal-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.deal-metric {
    text-align: center;
}

.deal-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.deal-metric-label {
    font-size: 12px;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-tips {
    space-y: 16px;
}

.tip-item {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
}

.tip-item strong {
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.tip-item p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.factor-weights {
    space-y: 12px;
}

.factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.factor-name {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.factor-weight {
    font-weight: 600;
    color: #2563eb;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

/* Primary result styling */
.primary-result .result-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
@media (max-width: 768px) {
    .retailers-container {
        grid-template-columns: 1fr;
    }
    
    .score-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .savings-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .deal-highlight {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-table {
        font-size: 14px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .score-cards {
        grid-template-columns: 1fr;
    }
    
    .savings-breakdown {
        grid-template-columns: 1fr;
    }
    
    .deal-highlight {
        grid-template-columns: 1fr;
    }
    
    .factor-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Animation for results reveal */
@keyframes resultsReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section.animate {
    animation: resultsReveal 0.6s ease-out;
}

/* Loading states */
.comparison-table.loading {
    opacity: 0.6;
    pointer-events: none;
}

.comparison-table.loading::after {
    content: "Comparing prices...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
