/**
* Best Promo Scanner CSS
*
* @author DESPO
* @copyright 2024 DESPO
*/

.best-promo-scanner {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.best-promo-header {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.best-promo-header h3 {
    margin: 0;
    color: #007bff;
    font-size: 1.4em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-promo-header .material-icons {
    font-size: 1.2em;
}

.best-promo-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.promo-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
}
.promo-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promo-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.promo-name strong {
    font-size: 1.1em;
    color: #343a40;
}

.promo-code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #6c757d;
}

.promo-code code {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.promo-discount {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-block;
    align-self: flex-start;
}

.discount-amount {
    font-size: 0.95em;
    font-weight: 500;
}

.promo-description {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 5px;
}

.promo-conditions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 12px;
    margin-top: 8px;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.condition-item:last-child {
    margin-bottom: 0;
}

.condition-item.missing-amount {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.condition-item.missing-quantity {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.condition-item.missing-products {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.condition-item.ready {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.condition-item .material-icons {
    font-size: 18px;
    margin-right: 4px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-left: 10px;
}

.progress-fill {
    height: 100%;
    background: #ffc107;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.missing-products-list {
    list-style: none;
    margin: 5px 0 0 0;
    padding: 0;
}

.missing-products-list li {
    background: rgba(255,255,255,0.5);
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 0.85em;
}

.ready-text {
    font-weight: 600;
    flex: 1;
}

.apply-promo-code {
    background: #28a745;
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.apply-promo-code:hover {
    background: #218838;
}

.best-promo-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.best-promo-footer .text-muted {
    font-size: 0.8em;
    color: #6c757d;
}

/* Responsive design */
@media (max-width: 768px) {
    .best-promo-scanner {
        padding: 15px;
        margin: 15px 0;
    }
    
    .promo-name {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .condition-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-bar {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .best-promo-header h3 {
        font-size: 1.2em;
    }
    
    .promo-item {
        padding: 12px;
    }
    
    .condition-item {
        padding: 6px;
        font-size: 0.85em;
    }
}

/* Animation for new promotions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.promo-item.new {
    animation: slideIn 0.5s ease-out;
}

/* Print styles */
@media print {
    .best-promo-scanner {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .apply-promo-code {
        display: none;
    }
}
