/* Threshold Amount Enhanced - Frontend Styles */

.threshold-progress-container {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.threshold-progress-container.threshold-met {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.threshold-progress-container.threshold-progress {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-color: #17a2b8;
}

.threshold-progress-header {
    margin-bottom: 20px;
}

.threshold-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: bold;
}

.threshold-title.success {
    color: #155724;
}

.threshold-title.progress {
    color: #0c5460;
}

.threshold-icon {
    margin-right: 8px;
    font-size: 24px;
}

.threshold-message {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.threshold-message.success {
    color: #155724;
}

.threshold-message.progress {
    color: #0c5460;
}

.threshold-progress-bar {
    margin: 20px 0;
}

.threshold-progress-bar.animated .threshold-progress-fill {
    transition: width 0.8s ease-in-out;
}

.threshold-progress-track {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.threshold-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 12px;
    position: relative;
    transition: width 0.3s ease;
}

.threshold-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.threshold-progress-fill .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.threshold-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    font-weight: bold;
}

.progress-current {
    color: #28a745;
}

.progress-target {
    color: #6c757d;
}

.threshold-progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #212529;
}

/* Target Products Preview */
.threshold-target-products-preview {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
}

.target-products-title {
    color: #155724;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
}

.target-icon {
    margin-right: 10px;
    font-size: 28px;
}

.target-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.target-product-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.target-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.target-product-card .product-image {
    text-align: center;
    margin-bottom: 15px;
}

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

.target-product-card .product-name {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
}

.target-product-card .product-name a {
    color: #212529;
    text-decoration: none;
}

.target-product-card .product-name a:hover {
    color: #0056b3;
}

.target-product-card .product-pricing {
    margin: 15px 0;
}

.target-product-card .price-comparison {
    margin-bottom: 10px;
}

.target-product-card .regular-price {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.target-product-card .discounted-price {
    display: block;
    font-size: 18px;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 8px;
}

.target-product-card .savings-badge {
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.target-product-card .product-action {
    margin-top: 15px;
}

.target-product-card .product-action .button {
    width: 100%;
    background: #28a745;
    border-color: #28a745;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.target-product-card .product-action .button:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* Responsive Design */
@media (max-width: 768px) {
    .threshold-progress-container {
        padding: 20px;
        margin: 15px 0;
    }
    
    .threshold-title {
        font-size: 18px;
    }
    
    .threshold-message {
        font-size: 14px;
    }
    
    .threshold-progress-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .target-products-grid {
        grid-template-columns: 1fr;
    }
    
    .threshold-progress-labels {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .threshold-progress-container {
        padding: 15px;
    }
    
    .threshold-title {
        font-size: 16px;
    }
    
    .threshold-icon {
        font-size: 20px;
    }
    
    .threshold-progress-track {
        height: 20px;
    }
    
    .threshold-progress-fill .progress-text {
        font-size: 12px;
    }
}

/* Animation Classes */
.threshold-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.threshold-slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Loading States */
.threshold-loading {
    opacity: 0.6;
    pointer-events: none;
}

.threshold-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 #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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