/**
 * Frontend Styles for My Group Buying
 */

.mgb-group-buying-info {
    clear: both;
    margin: 25px 0;
    padding: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mgb-group-buying-info h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
}

.mgb-participants-counter {
    margin-bottom: 20px;
}

.mgb-participants-counter p {
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.5;
}

.mgb-progress-bar {
    width: 100%;
    height: 35px;
    background-color: #e0e0e0;
    border-radius: 18px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mgb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    color: white;
    font-weight: bold;
}

.mgb-progress-bar-full .mgb-progress-fill {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
}

.mgb-status-notice {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
}

.mgb-status-notice p {
    margin: 0;
    font-size: 14px;
}

.mgb-status-notice.mgb-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.mgb-status-notice.mgb-success {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.mgb-status-notice.mgb-success::before {
    content: "✓ ";
    font-weight: bold;
    color: #28a745;
}

.mgb-countdown-timer {
    clear: both;
    margin: 25px 0;
    padding: 20px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
}

.mgb-countdown-timer p {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mgb-timer-display {
    font-weight: bold;
    font-size: 18px;
    color: #856404;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.mgb-group-buying-info.updated {
    animation: pulse 2s ease-in-out;
}

/* Group Buying Badge on Shop Page */
.mgb-group-buying-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: #ffffff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

/* Ensure product image container is positioned relative for badge positioning */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce-page ul.products li.product .woocommerce-loop-product__link {
    position: relative;
}

/* Alternative selectors for different theme structures */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
    display: block;
}

/* Responsive design */
@media (max-width: 768px) {
    .mgb-group-buying-info {
        padding: 20px;
    }
    
    .mgb-participants-counter p {
        font-size: 14px;
    }
    
    .mgb-progress-bar {
        height: 30px;
    }
    
    .mgb-group-buying-badge {
        font-size: 11px;
        padding: 4px 10px;
        top: 8px;
        right: 8px;
    }
}

