/**
 * Volume Pricing Manager - Frontend Styles
 */

.vpm-pricing-table-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vpm-pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.vpm-pricing-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.vpm-pricing-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpm-pricing-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.vpm-pricing-table tbody tr:last-child {
    border-bottom: none;
}

.vpm-pricing-table tbody tr:hover {
    background-color: #f9fafb;
}

.vpm-pricing-table td {
    padding: 16px 20px;
    font-size: 15px;
}

.vpm-quantity {
    color: #374151;
}

.vpm-price {
    text-align: right;
}

.vpm-price-value {
    font-weight: 600;
    color: #10b981;
    font-size: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.vpm-sale-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.vpm-price-value del {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 14px;
}

.vpm-price-value ins {
    text-decoration: none;
    font-weight: 700;
    color: #ef4444;
}

.vpm-regular-price {
    color: #6b7280;
}

.vpm-sale-price {
    color: #ef4444;
}

.vpm-savings-message {
    text-align: center;
    margin: 20px 0 0;
    font-weight: 600;
    color: #10b981;
    font-size: 15px;
}

/* Compact Style */
.vpm-table-compact .vpm-pricing-table {
    max-width: 500px;
}

.vpm-table-compact .vpm-pricing-table th,
.vpm-table-compact .vpm-pricing-table td {
    padding: 12px 16px;
    font-size: 14px;
}

.vpm-table-compact .vpm-price-value {
    font-size: 15px;
}

/* Minimal Style */
.vpm-table-minimal .vpm-pricing-table {
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

.vpm-table-minimal .vpm-pricing-table thead {
    background: #f3f4f6;
    color: #374151;
}

.vpm-table-minimal .vpm-pricing-table tbody tr:hover {
    background-color: #fafafa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vpm-pricing-table {
        max-width: 100%;
    }
    
    .vpm-pricing-table th,
    .vpm-pricing-table td {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .vpm-pricing-table th {
        font-size: 12px;
    }
    
    .vpm-price-value {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .vpm-pricing-table th,
    .vpm-pricing-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .vpm-price-value {
        font-size: 14px;
    }
    
    .vpm-savings-message {
        font-size: 14px;
    }
}

/* Formula Display (for documentation pages) */
.vpm-formula {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 20px 0;
}

.vpm-formula code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #2d3748;
    display: block;
    white-space: pre;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .vpm-pricing-table {
        background: #1f2937;
        color: #e5e7eb;
    }
    
    .vpm-pricing-table tbody tr {
        border-bottom-color: #374151;
    }
    
    .vpm-pricing-table tbody tr:hover {
        background-color: #374151;
    }
    
    .vpm-quantity {
        color: #d1d5db;
    }
    
    .vpm-price-value {
        color: #34d399;
    }
    
    .vpm-savings-message {
        color: #34d399;
    }
}

/* Print Styles */
@media print {
    .vpm-pricing-table-wrapper {
        page-break-inside: avoid;
    }
    
    .vpm-pricing-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .vpm-pricing-table thead {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .vpm-pricing-table tbody tr {
        border-bottom: 1px solid #ddd;
    }
}

/* Volume Pricing Field Styles */
.addon-volume_pricing {
    margin-bottom: 20px;
}

.vpm-price-info {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 3px solid #10b981;
    border-radius: 4px;
}

.vpm-unit-price,
.vpm-total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.vpm-unit-price {
    color: #6b7280;
}

.vpm-total-price {
    font-weight: 600;
    font-size: 16px;
    color: #111827;
    border-top: 1px solid #e5e7eb;
    margin-top: 6px;
    padding-top: 10px;
}

.vpm-price-info .vpm-label {
    color: #6b7280;
}

.vpm-price-info .vpm-value {
    font-weight: 600;
    color: #10b981;
}

.vpm-savings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: #ecfdf5;
    border-radius: 4px;
    border: 1px solid #10b981;
}

.vpm-savings-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.vpm-savings-text {
    font-weight: 600;
    color: #059669;
    font-size: 14px;
}

/* Compact table inside product add-ons */
.addon-volume_pricing .vpm-pricing-table-wrapper {
    margin-top: 15px;
}

.addon-volume_pricing .vpm-pricing-table {
    max-width: 100%;
    font-size: 13px;
}

.addon-volume_pricing .vpm-pricing-table th,
.addon-volume_pricing .vpm-pricing-table td {
    padding: 10px 12px;
    font-size: 13px;
}

.addon-volume_pricing .vpm-savings-message {
    font-size: 13px;
    margin-top: 10px;
}

/* Mobile responsive for volume pricing fields */
@media (max-width: 768px) {
    .vpm-price-info {
        padding: 10px;
    }
    
    .vpm-unit-price,
    .vpm-total-price {
        font-size: 13px;
    }
    
    .vpm-total-price {
        font-size: 15px;
    }
    
    .vpm-savings {
        padding: 8px;
    }
    
    .vpm-savings-text {
        font-size: 13px;
    }
}

/* Animation for price updates */
.vpm-price-info .vpm-value {
    transition: all 0.3s ease;
}

.vpm-price-info .vpm-value.updated {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        color: #059669;
    }
}
