/**
 * Membershiping Badge & Flag Pricing Styles
 */

/* Special pricing indicators */
.membershiping-special-price {
    color: #2e7d32;
    font-weight: bold;
    font-size: 1.1em;
}

.membershiping-special-price-preview {
    color: #1976d2;
    font-weight: bold;
    font-size: 1.1em;
}

.membershiping-badge-price {
    color: #2e7d32;
    font-weight: bold;
    font-size: 1.1em;
}

.membershiping-badge-price-preview {
    color: #1976d2;
    font-weight: bold;
    font-size: 1.1em;
}

.membershiping-qualification-indicator,
.membershiping-badge-indicator {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
}

/* Qualification status styling */
.membershiping-qualification-indicator.qualified {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.membershiping-qualification-indicator.not-qualified {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #ef6c00;
}

/* Legacy support for badge indicators */
.membershiping-badge-indicator:contains('✓') {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.membershiping-badge-indicator:contains('✗') {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #ef6c00;
}

/* Product pricing layout */
.membershiping-original-price {
    color: #999;
    text-decoration: line-through;
}

.membershiping-member-price {
    color: #2e7d32;
    font-weight: bold;
}

.membershiping-member-price-label {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.membershiping-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 8px;
    text-transform: uppercase;
}

/* Shop page specific styling */
.woocommerce ul.products li.product .membershiping-qualification-indicator,
.woocommerce ul.products li.product .membershiping-badge-indicator {
    display: block;
    margin: 5px 0;
    font-size: 0.75em;
}

.woocommerce ul.products li.product .membershiping-special-price,
.woocommerce ul.products li.product .membershiping-badge-price {
    font-size: 1.2em;
}

/* Single product page styling */
.single-product .membershiping-qualification-indicator,
.single-product .membershiping-badge-indicator {
    display: block;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
}

.single-product .membershiping-special-price,
.single-product .membershiping-special-price-preview,
.single-product .membershiping-badge-price,
.single-product .membershiping-badge-price-preview {
    font-size: 1.5em;
    margin: 8px 0;
    display: block;
}

/* Cart page styling */
.woocommerce-cart .membershiping-qualification-indicator,
.woocommerce-cart .membershiping-badge-indicator {
    font-size: 0.85em;
    margin-top: 5px;
}

/* Admin pricing fields styling */
.membershiping-pricing-fields {
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-top: 20px;
}

.membershiping-badge-pricing-section,
.membershiping-flag-pricing-section {
    margin-bottom: 30px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.membershiping-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    flex-wrap: wrap;
}

.membershiping-price-row:last-child {
    margin-bottom: 0;
}

.badge-pricing-wrapper,
.flag-pricing-wrapper {
    margin: 15px 0;
    min-height: 50px;
    border: 1px dashed #ddd;
    padding: 10px;
    border-radius: 4px;
}

.badge-pricing-wrapper:empty::before,
.flag-pricing-wrapper:empty::before {
    content: attr(data-empty-text);
    color: #999;
    font-style: italic;
    text-align: center;
    display: block;
    padding: 20px;
}

.badge-pricing-wrapper:empty::before {
    content: "No badge-specific prices set. Click 'Add Badge Price' to add one.";
}

.flag-pricing-wrapper:empty::before {
    content: "No flag-specific prices set. Click 'Add Flag Price' to add one.";
}

.membershiping-pricing-fields h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

.membershiping-pricing-fields .description {
    margin-bottom: 15px;
    font-style: italic;
    color: #666;
    font-size: 13px;
}

.remove-price-row {
    background: #dc3232 !important;
    border-color: #dc3232 !important;
    color: white !important;
    min-width: 70px;
}

.remove-price-row:hover {
    background: #a00 !important;
    border-color: #a00 !important;
}

#add-badge-pricing-row,
#add-flag-pricing-row {
    margin-top: 10px;
}

/* Mobile responsive design */
@media (max-width: 768px) {
    .membershiping-price-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .membershiping-price-row select,
    .membershiping-price-row input[type="number"] {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .membershiping-qualification-indicator,
    .membershiping-badge-indicator {
        font-size: 0.75em;
        padding: 4px 8px;
        display: block;
        margin: 5px 0;
    }
    
    .single-product .membershiping-special-price,
    .single-product .membershiping-special-price-preview,
    .single-product .membershiping-badge-price,
    .single-product .membershiping-badge-price-preview {
        font-size: 1.3em;
    }
    
    .membershiping-badge-pricing-section,
    .membershiping-flag-pricing-section {
        padding: 10px;
        margin-bottom: 20px;
    }
}

/* Animation for price changes */
.membershiping-special-price,
.membershiping-badge-price,
.membershiping-member-price {
    transition: all 0.3s ease;
}

.membershiping-discount-badge {
    animation: pulse 2s infinite;
}

.membershiping-qualification-indicator.qualified {
    animation: fadeIn 0.5s ease-in;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility improvements */
.membershiping-badge-indicator[aria-label] {
    cursor: help;
}

.membershiping-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
