/* ================================================================
   XC Loyalty Points System — Public / Front-end Styles
   Author: XaniaCode | https://xaniacode.com
   ================================================================ */

:root {
    --xc-primary:   #6c63ff;
    --xc-success:   #28a745;
    --xc-danger:    #dc3545;
    --xc-warning:   #fd7e14;
    --xc-info:      #17a2b8;
    --xc-radius:    10px;
    --xc-shadow:    0 4px 20px rgba(108,99,255,.12);
    --xc-border:    #e5e5e5;
    --xc-text:      #333;
    --xc-muted:     #777;
}

/* ── Base ── */
.xc-lps-points-page { font-family: inherit; color: var(--xc-text); }

/* ── Dashboard ── */
.xc-lps-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 600px) { .xc-lps-dashboard { grid-template-columns: 1fr; } }

.xc-lps-balance-card {
    background: linear-gradient(135deg, var(--xc-primary), #8b83ff);
    color: #fff;
    border-radius: var(--xc-radius);
    padding: 28px 24px;
    box-shadow: var(--xc-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.xc-lps-balance-card .balance-label {
    font-size: 13px;
    opacity: .85;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.xc-lps-balance-card .balance-amount {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.xc-lps-balance-card .balance-worth {
    font-size: 14px;
    opacity: .9;
}

/* ── Tier card ── */
.xc-lps-tier-card {
    background: #fff;
    border-radius: var(--xc-radius);
    padding: 24px;
    box-shadow: var(--xc-shadow);
    border: 1px solid var(--xc-border);
}
.xc-lps-tier-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.xc-lps-tier-mult {
    font-size: 13px;
    color: var(--xc-muted);
    margin-bottom: 14px;
}
.xc-lps-progress-wrap {
    background: #f0f0f0;
    border-radius: 30px;
    height: 10px;
    overflow: hidden;
    margin: 8px 0 6px;
}
.xc-lps-progress-fill {
    height: 100%;
    border-radius: 30px;
    transition: width .6s cubic-bezier(.25,.46,.45,.94);
}
.xc-lps-progress-label {
    font-size: 12px;
    color: var(--xc-muted);
}

/* ── Section cards ── */
.xc-lps-section {
    background: #fff;
    border-radius: var(--xc-radius);
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--xc-border);
    margin-bottom: 20px;
}
.xc-lps-section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
    color: #1d2327;
}

/* ── Redeem form ── */
.xc-lps-redeem-box {
    background: #f9f8ff;
    border: 1px solid #d8d5ff;
    border-radius: var(--xc-radius);
    padding: 20px 22px;
    margin: 16px 0;
}
.xc-lps-redeem-box h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--xc-primary);
}
.xc-lps-redeem-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.xc-lps-redeem-row input[type="number"] {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--xc-border);
    border-radius: 6px;
    font-size: 14px;
}
.xc-lps-redeem-row .xc-lps-apply-btn {
    background: var(--xc-primary);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}
.xc-lps-redeem-row .xc-lps-apply-btn:hover { background: #5a52d5; }
.xc-lps-remove-btn {
    background: none;
    border: 1px solid var(--xc-danger);
    color: var(--xc-danger);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
}
.xc-lps-remove-btn:hover { background: var(--xc-danger); color: #fff; }
.xc-lps-balance-info {
    font-size: 13px;
    color: var(--xc-muted);
    margin-bottom: 10px;
}
.xc-lps-redeem-msg {
    margin-top: 8px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 5px;
}
.xc-lps-redeem-msg.success { background: #d4edda; color: #155724; }
.xc-lps-redeem-msg.error   { background: #f8d7da; color: #721c24; }

/* ── Transaction history table ── */
.xc-lps-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.xc-lps-history-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #eee;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
}
.xc-lps-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.xc-lps-history-table tr:last-child td { border-bottom: none; }
.xc-lps-history-table .pts-positive { color: var(--xc-success); font-weight: 700; }
.xc-lps-history-table .pts-negative { color: var(--xc-danger);  font-weight: 700; }

/* ── Type badge ── */
.xc-lps-type-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    background: #e9ecef;
    color: #555;
}
.xc-lps-type-pill.purchase   { background: #d4edda; color: #155724; }
.xc-lps-type-pill.signup     { background: #cce5ff; color: #004085; }
.xc-lps-type-pill.review     { background: #fff3cd; color: #856404; }
.xc-lps-type-pill.birthday   { background: #f8d7da; color: #721c24; }
.xc-lps-type-pill.referral   { background: #d1ecf1; color: #0c5460; }
.xc-lps-type-pill.redemption { background: #fde8d8; color: #7c3000; }

/* ── Referral box ── */
.xc-lps-referral-box {
    background: #f0f8ff;
    border: 1px solid #c8e6ff;
    border-radius: var(--xc-radius);
    padding: 20px;
}
.xc-lps-referral-link-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}
.xc-lps-referral-link-wrap input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--xc-border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.xc-lps-copy-btn {
    background: var(--xc-info);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s;
}
.xc-lps-copy-btn:hover { background: #117a8b; }
.xc-lps-ref-code { font-size: 13px; color: var(--xc-muted); margin: 6px 0 0; }

/* ── Rewards catalog ── */
.xc-lps-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.xc-lps-reward-card {
    background: #fff;
    border: 1px solid var(--xc-border);
    border-radius: var(--xc-radius);
    overflow: hidden;
    text-align: center;
    transition: box-shadow .25s, transform .25s;
}
.xc-lps-reward-card:hover {
    box-shadow: var(--xc-shadow);
    transform: translateY(-3px);
}
.xc-lps-reward-card img { width: 100%; height: 160px; object-fit: cover; }
.xc-lps-reward-card .xc-lps-reward-info { padding: 14px; }
.xc-lps-reward-card .xc-lps-reward-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.xc-lps-reward-card .xc-lps-reward-cost { color: var(--xc-primary); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.xc-lps-redeem-reward-btn {
    background: var(--xc-primary);
    color: #fff;
    border: none;
    width: 100%;
    padding: 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s;
}
.xc-lps-redeem-reward-btn:hover { background: #5a52d5; }
.xc-lps-redeem-reward-btn:disabled { background: #aaa; cursor: not-allowed; }

/* ── Product / cart notices ── */
.xc-lps-product-notice {
    background: #f0f0ff;
    border: 1px solid #d8d5ff;
    border-left: 4px solid var(--xc-primary);
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--xc-text);
    margin: 12px 0;
}
.xc-lps-thankyou-notice {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 18px;
    border-radius: 6px;
    color: #155724;
    margin: 16px 0;
    font-size: 15px;
}

/* ── Pagination ── */
.xc-lps-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
}
.xc-lps-pagination a,
.xc-lps-pagination span {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid var(--xc-border);
    font-size: 13px;
    text-decoration: none;
    color: var(--xc-text);
}
.xc-lps-pagination .current {
    background: var(--xc-primary);
    color: #fff;
    border-color: var(--xc-primary);
}

/* ── Login notice ── */
.xc-lps-login-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
}

/* ── How to earn list ── */
.xc-lps-how-list { list-style: none; padding: 0; margin: 0; }
.xc-lps-how-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.xc-lps-how-list li:last-child { border-bottom: none; }
.xc-lps-how-list .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
}
.xc-lps-how-list .pts-badge {
    margin-left: auto;
    background: var(--xc-primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ── My-account endpoint ── */
.woocommerce-account .xc-lps-points-page { padding: 0; }
.xc-lps-balance { font-weight: 700; color: var(--xc-primary); }
