/**
 * Price Comparison Feed Importer - Frontend Styles
 * Compact, modern design for price comparison widget
 */

/* Container */
.pcfi-comparison-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Header */
.pcfi-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pcfi-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pcfi-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.pcfi-icon {
    width: 18px;
    height: 18px;
    color: white;
}

.pcfi-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pcfi-shop-count {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.pcfi-savings {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #10b981;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Content */
.pcfi-content {
    padding: 12px;
}

/* Best Offer - Compact horizontal layout */
.pcfi-best-offer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.pcfi-best-badge {
    flex-shrink: 0;
}

.pcfi-best-badge svg {
    width: 24px;
    height: 24px;
    color: #f59e0b;
}

.pcfi-best-details {
    flex: 1;
    min-width: 0;
}

.pcfi-shop-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcfi-best-price {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
    line-height: 1;
}

/* Buttons */
.pcfi-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.pcfi-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pcfi-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
}

.pcfi-button-secondary {
    background: white;
    color: #667eea;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
}

.pcfi-button-secondary:hover {
    background: #f9fafb;
    border-color: #667eea;
    color: #667eea;
}

.pcfi-button-icon {
    width: 14px;
    height: 14px;
}

.pcfi-button-icon-small {
    width: 12px;
    height: 12px;
}

/* Other Offers - Compact list */
.pcfi-other-offers {
    margin-top: 12px;
}

.pcfi-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.pcfi-offers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcfi-offer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pcfi-offer-item:hover {
    background: white;
    border-color: #d1d5db;
}

.pcfi-offer-left {
    flex: 1;
    min-width: 0;
}

.pcfi-offer-shop {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcfi-offer-meta {
    font-size: 11px;
    color: #9ca3af;
}

.pcfi-price-diff {
    color: #dc2626;
}

.pcfi-offer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcfi-offer-price {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

/* Price Graph - Simplified */
.pcfi-price-graph {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.pcfi-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pcfi-graph-min,
.pcfi-graph-max {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.pcfi-graph-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcfi-graph-bar {
    position: relative;
    height: 24px;
    background: linear-gradient(90deg, #10b981 0%, #ef4444 100%);
    border-radius: 12px;
    overflow: visible;
}

.pcfi-graph-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pcfi-graph-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.pcfi-graph-point-best {
    background: #fbbf24;
    border-color: #f59e0b;
    width: 16px;
    height: 16px;
}

/* Footer */
.pcfi-footer {
    padding: 10px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.pcfi-update-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #9ca3af;
}

.pcfi-footer-icon {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pcfi-comparison-widget {
        margin: 15px -10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .pcfi-header-content {
        flex-wrap: wrap;
    }

    .pcfi-best-offer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pcfi-best-details {
        flex-basis: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .pcfi-button-primary {
        flex: 1;
        justify-content: center;
    }

    .pcfi-offer-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pcfi-offer-right {
        display: flex;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .pcfi-header {
        padding: 10px 12px;
    }

    .pcfi-content {
        padding: 10px;
    }

    .pcfi-best-price {
        font-size: 18px;
    }

    .pcfi-offer-price {
        font-size: 14px;
    }

    .pcfi-button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .pcfi-stats {
        gap: 6px;
    }

    .pcfi-shop-count,
    .pcfi-savings {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pcfi-comparison-widget {
        background: #1f2937;
        border-color: #374151;
    }

    .pcfi-title {
        color: white;
    }

    .pcfi-best-offer {
        background: #064e3b;
        border-color: #10b981;
    }

    .pcfi-shop-name {
        color: #e5e7eb;
    }

    .pcfi-best-price {
        color: #10b981;
    }

    .pcfi-section-title {
        color: #9ca3af;
    }

    .pcfi-offer-item {
        background: #374151;
        border-color: #4b5563;
    }

    .pcfi-offer-item:hover {
        background: #4b5563;
        border-color: #6b7280;
    }

    .pcfi-offer-shop {
        color: #f3f4f6;
    }

    .pcfi-offer-meta {
        color: #9ca3af;
    }

    .pcfi-offer-price {
        color: #f3f4f6;
    }

    .pcfi-price-graph {
        background: #374151;
    }

    .pcfi-graph-min,
    .pcfi-graph-max {
        color: #d1d5db;
    }

    .pcfi-footer {
        background: #374151;
        border-top-color: #4b5563;
    }

    .pcfi-update-info {
        color: #9ca3af;
    }
}

/* Print styles */
@media print {
    .pcfi-comparison-widget {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .pcfi-button {
        display: none;
    }
}