/* TVB Loyalty Rewards — Frontend Styles */

:root {
    --tvb-red: #8B0000;
    --tvb-red-light: #c0392b;
    --tvb-gold: #f9a825;
    --tvb-dark: #1a1a1a;
    --tvb-border: #e0e0e0;
    --tvb-success: #2e7d32;
}

/* ── My Account / Rewards Tab ─────────────────────────── */

.tvb-loyalty-account {
    font-family: inherit;
}

.tvb-account-hero {
    background: linear-gradient(135deg, var(--tvb-red) 0%, #c0392b 100%);
    color: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.tvb-account-pts {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.tvb-account-pts-label {
    font-size: 14px;
    opacity: .8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 4px 0 8px;
}

.tvb-account-rand {
    font-size: 18px;
    background: rgba(255,255,255,.2);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

.tvb-tier-display {
    font-size: 15px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
}

.tvb-tier-bronze { background: #cd7f32; color: #fff; }
.tvb-tier-silver { background: rgba(255,255,255,.25); color: #fff; }
.tvb-tier-gold   { background: var(--tvb-gold); color: var(--tvb-dark); }

.tvb-lifetime {
    font-size: 13px;
    opacity: .75;
}

/* Earn Info */
.tvb-earn-info {
    background: #fafafa;
    border: 1px solid var(--tvb-border);
    border-left: 4px solid var(--tvb-red);
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.tvb-earn-info h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--tvb-dark);
}

.tvb-earn-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tvb-earn-info ul li {
    font-size: 14px;
    padding: 4px 0;
    color: #444;
}

/* Reward Catalogue */
.tvb-catalogue-section { margin-bottom: 32px; }
.tvb-catalogue-section h3 { font-size: 18px; margin-bottom: 16px; color: var(--tvb-dark); }

.tvb-catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.tvb-catalogue-item {
    border: 2px solid var(--tvb-border);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    transition: all .2s ease;
}

.tvb-catalogue-item img,
.tvb-catalogue-item .tvb-catalogue-placeholder {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-size: 40px;
    line-height: 80px;
}

.tvb-can-afford {
    border-color: var(--tvb-success);
    background: #f9fff9;
}

.tvb-catalogue-item-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.tvb-catalogue-pts { font-size: 16px; font-weight: 700; color: var(--tvb-red); }
.tvb-catalogue-value { font-size: 12px; color: #888; }

.tvb-can-redeem { font-size: 11px; color: var(--tvb-success); font-weight: 600; display: block; margin-top: 6px; }
.tvb-pts-needed { font-size: 11px; color: #999; display: block; margin-top: 6px; }

/* Transaction History */
.tvb-history-section h3 { font-size: 18px; margin-bottom: 12px; color: var(--tvb-dark); }

.tvb-history-table { width: 100%; font-size: 13px; }
.tvb-history-table th { background: #f5f5f5; font-size: 12px; text-transform: uppercase; color: #666; }

.tvb-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 4px;
}

.tvb-type-earn    { background: #e8f5e9; color: #2e7d32; }
.tvb-type-redeem  { background: #fff3e0; color: #e65100; }
.tvb-type-reverse { background: #fce4ec; color: #c62828; }
.tvb-type-adjust  { background: #e8eaf6; color: #3949ab; }
.tvb-type-expire  { background: #f5f5f5; color: #757575; }

.tvb-pts-positive { color: #2e7d32; font-weight: 700; }
.tvb-pts-negative { color: #c62828; font-weight: 700; }

/* ── Cart / Checkout ──────────────────────────────────── */

.tvb-cart-points-row th,
.tvb-cart-points-row td {
    background: #fff8f8;
    border-top: 1px dashed var(--tvb-red);
}

/* Gateway */
.tvb-points-gateway {
    padding: 12px 0;
}

.tvb-points-balance-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
}

.tvb-pts-balance { color: var(--tvb-red); font-size: 18px; }
.tvb-pts-value   { color: #888; font-size: 13px; }

.tvb-points-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
}

.tvb-points-input {
    width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--tvb-border);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
}

.tvb-apply-btn {
    background: var(--tvb-red);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.tvb-apply-btn:hover { background: var(--tvb-red-light); }

.tvb-clear-btn {
    background: #f0f0f0;
    color: #555;
    border: 1px solid var(--tvb-border);
    padding: 9px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.tvb-points-preview {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin: 8px 0;
    font-weight: 600;
}

.tvb-points-max-notice {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.tvb-loyalty-notice {
    background: #fff8f0;
    border-left: 4px solid var(--tvb-red);
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tvb-loyalty-icon { font-size: 20px; }

/* Thank you page */
.tvb-loyalty-notice.woocommerce-message {
    background: #fff9e6;
    border: 1px solid #f9a825;
    border-left: 4px solid #f9a825;
}

@media (max-width: 600px) {
    .tvb-account-hero { flex-direction: column; }
    .tvb-account-pts { font-size: 42px; }
    .tvb-catalogue-grid { grid-template-columns: repeat(2, 1fr); }
}
