/* 
 * WooCommerce Quantity Discount Plugin - Frontend CSS
 * File: assets/css/frontend.css
 * Version: 1.0.0
 */

/* Main discount message styles */
.wc-qty-discount-message {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease-in;
    line-height: 1.5;
}

/* Success message (discount applied) */
.wc-qty-discount-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Info message (incentive to add more items) */
.wc-qty-discount-message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Warning message */
.wc-qty-discount-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Remove padding from table cells containing discount notices */
.wc-qty-discount-notice td {
    padding: 0 !important;
    border: none !important;
}

/* Progress bar container */
.wc-qty-discount-progress-bar {
    background-color: #f8f9fa;
    border-radius: 4px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

/* Progress bar fill */
.wc-qty-discount-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* Tier information display */
.wc-qty-discount-tier-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

/* Savings amount display */
.wc-qty-discount-savings {
    font-weight: bold;
    color: #28a745;
    font-size: 16px;
    display: inline-block;
    margin-left: 8px;
}

/* Discount badge */
.wc-qty-discount-badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: #28a745;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 8px;
}

/* Special styling for incentive messages */
.wc-qty-discount-incentive {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none !important;
}

.wc-qty-discount-incentive .wc-qty-discount-message {
    background: transparent;
    border: none;
    color: white;
}

/* Countdown timer */
.wc-qty-discount-countdown {
    font-size: 14px;
    margin-top: 5px;
    opacity: 0.9;
}

/* Loading state */
.wc-qty-discount-message.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Flash animation for updates */
.wc-qty-discount-message.flash {
    animation: flash 0.6s ease-in-out;
}

/* Pulse animation for attention */
.wc-qty-discount-pulse {
    animation: pulse 2s infinite;
}

/* Tier visualization container */
.wc-qty-discount-tier-visual {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

/* Tier steps container */
.tier-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Connection line between steps */
.tier-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: 1;
}

/* Individual step styling */
.step {
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    min-width: 60px;
    text-align: center;
}

/* Completed step */
.step.completed {
    background: #28a745;
    color: white;
}

/* Target step (next goal) */
.step.target {
    background: #ffc107;
    color: #333;
    animation: pulse 2s infinite;
}

/* Reward step */
.step.reward {
    background: #17a2b8;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flash {
    0%, 100% { 
        background-color: inherit; 
    }
    50% { 
        background-color: #fff3cd; 
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Cart table specific styles */
.woocommerce-cart-form .wc-qty-discount-notice {
    background-color: transparent;
}

.woocommerce-checkout-review-order .wc-qty-discount-notice {
    background-color: transparent;
}

/* Mini cart styles */
.widget_shopping_cart .wc-qty-discount-message {
    font-size: 12px;
    padding: 8px 10px;
    margin: 8px 0;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .wc-qty-discount-message {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .wc-qty-discount-tier-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .wc-qty-discount-savings {
        font-size: 14px;
    }
    
    .tier-steps {
        flex-direction: column;
        gap: 8px;
    }
    
    .tier-steps::before {
        display: none;
    }
    
    .step {
        width: 100%;
        max-width: 200px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .wc-qty-discount-message {
        padding: 8px 10px;
        font-size: 13px;
        margin: 8px 0;
    }
    
    .wc-qty-discount-badge {
        display: block;
        margin: 5px 0 0 0;
        text-align: center;
    }
    
    .wc-qty-discount-tier-info {
        font-size: 11px;
    }
}