/* WooCommerce Loyalty Points - Frontend Styles */

:root {
    --blrw-accent: #0675c4;
}

/* ── Product Message ─────────────────────────────────────────── */
.blrw-product-message {
    color: #16a34a;
    font-size: 1em;
    margin: 8px 0;
}

/* ── My Account: Balance Summary ────────────────────────────── */
.blrw-myaccount .blrw-balance-summary,
.blrw-ref-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.blrw-balance-card {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
}

.blrw-balance-card .blrw-label {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 4px;
}

.blrw-balance-card .blrw-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: inherit;
}

.blrw-myaccount .blrw-earn-info {
    color: #555;
    margin-bottom: 24px;
    font-size: 0.9em;
}

/* ── Transaction Table ──────────────────────────────────────── */
.blrw-transactions {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.blrw-transactions th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}

.blrw-transactions td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.blrw-positive {
    color: #16a34a;
    font-weight: 600;
}

.blrw-negative {
    color: #dc2626;
    font-weight: 600;
}

.blrw-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.blrw-type--earn { background: #d4edda; color: #155724; }
.blrw-type--redeem { background: #d1ecf1; color: #0c5460; }
.blrw-type--admin_add { background: #fff3cd; color: #856404; }
.blrw-type--admin_deduct { background: #f8d7da; color: #721c24; }
.blrw-type--refund_reversal { background: #f8d7da; color: #721c24; }
.blrw-type--expire { background: #f3f4f6; color: #6b7280; }

.blrw-pagination.woocommerce-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.blrw-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.blrw-pagination .page-numbers.current {
    background: var(--blrw-accent);
    border-color: var(--blrw-accent);
    color: #fff;
    font-weight: 600;
}

.blrw-pagination .page-numbers:hover:not(.current):not(.dots) {
    background: #f0f0f0;
}

/* ── Redeem Form ────────────────────────────────────────────── */
.blrw-redeem-form {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 1em;
}

.blrw-redeem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.blrw-redeem-title {
    font-weight: 700;
    font-size: 1em;
    color: inherit;
}

.blrw-redeem-balance {
    font-weight: 600;
    color: inherit;
}

.blrw-redeem-earn {
    margin: 0 0 12px;
    color: #16a34a;
    font-size: 1em;
}

/* ── Input + button row (matches WC coupon form layout) ── */
.blrw-redeem-input-row {
    display: flex;
    gap: 8px;
}

.blrw-redeem-input-row .input-text {
    flex: 3 1 120px;
    min-width: 0;
    -moz-appearance: textfield;
}

.blrw-redeem-input-row .input-text::-webkit-inner-spin-button,
.blrw-redeem-input-row .input-text::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.blrw-redeem-input-row .button {
    flex: 1 1 auto;
    white-space: nowrap;
}

.blrw-redeem-input-row .button.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    color: transparent;
}

.blrw-redeem-input-row .button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #333;
    border-right-color: transparent;
    border-radius: 50%;
    animation: blrw-spin 0.6s linear infinite;
}

@keyframes blrw-spin {
    to { transform: rotate(360deg); }
}

.blrw-redeem-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    color: #888;
}

.blrw-redeem-available {
    margin: 0 0 10px;
    font-size: 1em;
    color: inherit;
}

/* ── Applied state ── */
.blrw-redeem-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.blrw-redeem-applied__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.blrw-redeem-applied__label {
    font-weight: 600;
    color: #155724;
}

.blrw-redeem-applied__detail {
    font-size: 1em;
    color: #155724;
}

.blrw-redeem-remove {
    background: none;
    border: none;
    color: #dc2626;
    font-family: inherit;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.blrw-redeem-remove:hover {
    color: #991b1b;
}

.blrw-redeem-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Inline notice ── */
.blrw-redeem-notice {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
}

.blrw-redeem-notice--error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.blrw-redeem-notice--success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ── Guest Sign-Up Message ──────────────────────────────────── */
.blrw-guest-message .blrw-guest-message__text {
    margin: 0;
    font-size: 1em;
    color: inherit;
    line-height: 1.5;
}

.blrw-guest-message .blrw-guest-message__text a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blrw-guest-message .blrw-guest-message__extra {
    margin: 8px 0 0;
    font-size: 1em;
    font-weight: 600;
    color: #16a34a;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .blrw-myaccount .blrw-balance-summary,
    .blrw-ref-stats {
        flex-direction: column;
    }

    .blrw-transactions th:nth-child(4),
    .blrw-transactions td:nth-child(4),
    .blrw-transactions th:nth-child(5),
    .blrw-transactions td:nth-child(5) {
        display: none;
    }
}
