/**
 * Campaign Widget Styles
 * Styles for all campaign type widgets displayed on frontend
 */

/* Main widget container */
.upspr-campaign-widget {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upspr-campaign-widget .upspr-widget-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Products grid */
.upspr-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* Individual product item */
.upspr-product-item {
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.upspr-product-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Product image */
.upspr-product-image {
    margin-bottom: 10px;
}

.upspr-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Product details */
.upspr-product-details {
    text-align: center;
}

.upspr-product-name {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.upspr-product-name a {
    color: #333;
    text-decoration: none;
}

.upspr-product-name a:hover {
    color: #0073aa;
}

.upspr-product-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upspr-product-rating {
    margin-bottom: 8px;
}

.upspr-product-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.upspr-add-to-cart {
    margin-top: 10px;
}

.upspr-add-to-cart .button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.upspr-add-to-cart .button:hover {
    background: #005a87;
    color: #fff;
}

/* Campaign type specific styles */
.upspr-cross-sell-widget {
    border-left: 4px solid #28a745;
}

.upspr-upsell-widget {
    border-left: 4px solid #007cba;
}

.upspr-related-products-widget {
    border-left: 4px solid #6f42c1;
}

.upspr-frequently-bought-together-widget {
    border-left: 4px solid #fd7e14;
}

.upspr-personalized-recommendations-widget {
    border-left: 4px solid #e83e8c;
}

.upspr-trending-products-widget {
    border-left: 4px solid #dc3545;
}

.upspr-recently-viewed-widget {
    border-left: 4px solid #6c757d;
}

/* Responsive design */
@media (max-width: 768px) {
    .upspr-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .upspr-campaign-widget {
        margin: 15px 0;
        padding: 15px;
    }
    
    .upspr-product-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .upspr-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .upspr-campaign-widget {
        margin: 10px 0;
        padding: 10px;
    }
    
    .upspr-widget-title {
        font-size: 16px;
    }
}

/* Loading state */
.upspr-campaign-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.upspr-campaign-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.upspr-campaign-widget.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.upspr-campaign-widget.error .upspr-widget-title {
    color: #721c24;
}

/* Empty state */
.upspr-campaign-widget.empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.upspr-campaign-widget.empty::before {
    content: '📦';
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}
