/* WooCommerce Quantity Rebates Manager - Frontend Styles */

/* Rebate Information Box */
.wc-qr-rebate-info {
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-qr-title {
    margin: 0 0 20px 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-qr-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
}

/* Table Wrapper */
.wc-qr-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-qr-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.wc-qr-table thead th {
    padding: 15px;
    text-align: left;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #667eea;
}

.wc-qr-table tbody tr {
    transition: all 0.3s ease;
}

.wc-qr-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.wc-qr-table tbody td {
    padding: 15px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    color: #333;
    font-size: 15px;
}

.wc-qr-table tbody tr:last-child td {
    border-bottom: none;
}

/* Discount Badge */
.wc-qr-discount {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

/* Price Display */
.wc-qr-price {
    font-weight: 700;
    color: #667eea;
    font-size: 16px;
}

.wc-qr-price .woocommerce-Price-amount {
    font-size: 16px;
}

/* Cart Rebate Info */
.wc-qr-cart-rebate {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wc-qr-rebate-info {
        padding: 20px 15px;
    }
    
    .wc-qr-title {
        font-size: 18px;
    }
    
    .wc-qr-table thead {
        display: none;
    }
    
    .wc-qr-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid rgba(102, 126, 234, 0.2);
        border-radius: 8px;
        overflow: hidden;
    }
    
    .wc-qr-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .wc-qr-table tbody tr:last-child td:last-child {
        border-bottom: none;
    }
    
    .wc-qr-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #667eea;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

@media screen and (max-width: 480px) {
    .wc-qr-rebate-info {
        margin: 20px -15px;
        border-radius: 0;
    }
    
    .wc-qr-title {
        font-size: 16px;
    }
    
    .wc-qr-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .wc-qr-discount,
    .wc-qr-price {
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .wc-qr-rebate-info {
        background: white;
        border: 2px solid #667eea;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .wc-qr-title {
        color: #667eea;
    }
    
    .wc-qr-icon {
        background: #667eea;
        color: white;
    }
    
    .wc-qr-discount {
        background: #11998e;
        box-shadow: none;
    }
}

/* Animation for quantity changes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.wc-qr-table tbody tr.wc-qr-active-tier {
    background: rgba(102, 126, 234, 0.1);
    animation: pulse 0.5s ease;
}

/* Loading State */
.wc-qr-loading {
    text-align: center;
    padding: 20px;
    color: white;
}

.wc-qr-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip for additional information */
.wc-qr-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.wc-qr-tooltip .wc-qr-tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.wc-qr-tooltip:hover .wc-qr-tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Accessibility */
.wc-qr-table thead th:focus,
.wc-qr-table tbody td:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wc-qr-rebate-info {
        border: 3px solid #000;
    }
    
    .wc-qr-discount {
        background: #000;
        color: #fff;
    }
    
    .wc-qr-price {
        color: #000;
        font-weight: 900;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wc-qr-table-wrapper {
        background: #2d3748;
    }
    
    .wc-qr-table tbody td {
        color: #e2e8f0;
    }
    
    .wc-qr-cart-rebate {
        background: #2d3748;
        color: #38ef7d;
    }
}

/* RTL Support */
[dir="rtl"] .wc-qr-title {
    flex-direction: row-reverse;
}

[dir="rtl"] .wc-qr-table thead th,
[dir="rtl"] .wc-qr-table tbody td {
    text-align: right;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wc-qr-rebate-info,
    .wc-qr-table tbody tr,
    .wc-qr-loading::after {
        animation: none;
        transition: none;
    }
}
