/* ==========================================================================
 * BP Referral Program — Dark Theme
 * Black Planet nightlife branding: dark backgrounds, purple/magenta accents
 * ======================================================================== */

:root {
    --bp-bg:       #0d0d0d;
    --bp-card:     #1a1a2e;
    --bp-card-alt: #16213e;
    --bp-accent:   #c026d3;
    --bp-accent2:  #a855f7;
    --bp-text:     #e4e4e7;
    --bp-muted:    #71717a;
    --bp-pos:      #4ade80;
    --bp-neg:      #f87171;
    --bp-border:   #27272a;
    --bp-radius:   10px;
}

.bp-ref-dashboard {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--bp-text);
}

/* ==========================================================================
 * Cards
 * ======================================================================== */

.bp-ref-card {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    padding: 24px;
    margin-bottom: 16px;
}
.bp-ref-card h2, .bp-ref-card h3 { margin: 0 0 16px; color: #fff; }
.bp-ref-center { text-align: center; }

/* ==========================================================================
 * Stats row
 * ======================================================================== */

.bp-ref-stats-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.bp-ref-stat-num  { font-size: 2rem; font-weight: 800; color: var(--bp-accent2); }
.bp-ref-stat-label { font-size: .85rem; color: var(--bp-muted); margin-top: 2px; }

/* ==========================================================================
 * Progress bar (default, large, mini)
 * ======================================================================== */

.bp-ref-progress-wrap {
    background: var(--bp-bg);
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
    margin: 10px 0 6px;
}
.bp-ref-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--bp-accent), var(--bp-accent2));
    border-radius: 6px;
    transition: width .4s ease;
}
.bp-ref-progress-label { font-size: .8rem; color: var(--bp-muted); }

/* Large progress bar — used in teaser card */
.bp-ref-progress-lg {
    height: 14px;
    border-radius: 7px;
    margin: 18px 0 8px;
}
.bp-ref-progress-lg .bp-ref-progress-bar {
    border-radius: 7px;
}

/* Mini progress bar — used in share widget teaser */
.bp-ref-progress-mini {
    height: 6px;
    border-radius: 3px;
    margin: 8px 0 0;
}
.bp-ref-progress-mini .bp-ref-progress-bar {
    border-radius: 3px;
}

/* ==========================================================================
 * Link box
 * ======================================================================== */

.bp-ref-link-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.bp-ref-link-input {
    flex: 1;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border);
    border-radius: 6px;
    color: var(--bp-text);
    padding: 10px 12px;
    font-size: .9rem;
    outline: none;
}
.bp-ref-link-input:focus { border-color: var(--bp-accent); }

/* ==========================================================================
 * Buttons
 * ======================================================================== */

.bp-ref-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
    background: linear-gradient(135deg, var(--bp-accent), var(--bp-accent2));
    color: #fff;
}
.bp-ref-btn:hover { opacity: .85; }
.bp-ref-btn-sm { padding: 7px 14px; font-size: .82rem; }
.bp-ref-btn-wa { background: #25d366; }
.bp-ref-btn-wa:hover { opacity: .85; }
.bp-ref-btn-redeem { font-size: 1rem; padding: 12px 28px; }
.bp-ref-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ==========================================================================
 * Redemption form
 * ======================================================================== */

.bp-ref-redeem-form {
    margin-top: 12px;
}
.bp-ref-redeem-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.bp-ref-redeem-label {
    font-size: .95rem;
    font-weight: 600;
    color: var(--bp-text);
}
.bp-ref-redeem-input {
    width: 100px;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border);
    border-radius: 6px;
    color: var(--bp-text);
    padding: 10px 12px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}
.bp-ref-redeem-input::-webkit-outer-spin-button,
.bp-ref-redeem-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bp-ref-redeem-input:focus {
    border-color: var(--bp-accent);
    box-shadow: 0 0 0 2px rgba(192, 38, 211, 0.2);
}
.bp-ref-redeem-suffix {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bp-accent2);
}
.bp-ref-redeem-msg {
    margin-top: 10px;
    font-size: .9rem;
    min-height: 24px;
}
.bp-ref-redeem-msg.bp-ref-msg-ok {
    color: var(--bp-pos);
}
.bp-ref-redeem-msg.bp-ref-msg-err {
    color: var(--bp-neg);
}

/* ==========================================================================
 * Share row
 * ======================================================================== */

.bp-ref-share-row, .bp-ref-share-buttons { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ==========================================================================
 * Hint text
 * ======================================================================== */

.bp-ref-hint { font-size: .85rem; color: #b4b4bd; }
.bp-ref-hint code { background: var(--bp-bg); padding: 2px 6px; border-radius: 3px; color: var(--bp-accent2); }
.bp-ref-muted { color: var(--bp-muted); }

/* ==========================================================================
 * Flash messages
 * ======================================================================== */

.bp-ref-flash { padding: 14px 18px; border-radius: var(--bp-radius); margin-bottom: 16px; font-size: .9rem; }
.bp-ref-flash-ok  { background: #052e16; border: 1px solid #166534; color: #86efac; }
.bp-ref-flash-err { background: #450a0a; border: 1px solid #991b1b; color: #fca5a5; }

/* ==========================================================================
 * History table
 * ======================================================================== */

.bp-ref-table-wrap { overflow-x: auto; }
.bp-ref-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bp-ref-table th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--bp-border); color: var(--bp-muted); font-weight: 600; }
.bp-ref-table td { padding: 10px 8px; border-bottom: 1px solid var(--bp-border); }
.bp-ref-pts-pos { color: var(--bp-pos); font-weight: 700; }
.bp-ref-pts-neg { color: var(--bp-neg); font-weight: 700; }

/* ==========================================================================
 * Share widget (event pages)
 * ======================================================================== */

.bp-ref-share-widget {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    padding: 16px;
    margin-top: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--bp-text);
}
.bp-ref-share-header { margin-bottom: 10px; }
.bp-ref-share-icon { font-size: 1.1rem; }
.bp-ref-share-subtitle { font-size: .82rem; color: var(--bp-text); margin: 0 0 8px; }
.bp-ref-share-nudge { font-size: .85rem; color: var(--bp-text); padding: 8px 0; }
.bp-ref-share-link-box .bp-ref-link-input { font-size: .82rem; padding: 8px 10px; }

/* ==========================================================================
 * Share widget — teaser for non-eligible users
 * ======================================================================== */

.bp-ref-share-teaser {
    padding: 4px 0;
}
.bp-ref-share-teaser-text {
    font-size: .85rem;
    color: var(--bp-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
 * Teaser card (dashboard — non-eligible users)
 * ======================================================================== */

.bp-ref-teaser-card {
    padding: 32px 24px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: linear-gradient(135deg, var(--bp-card) 0%, #1e1040 100%);
}
.bp-ref-teaser-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.bp-ref-teaser-msg {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--bp-text);
    max-width: 480px;
    margin: 0 auto 8px;
}
.bp-ref-teaser-hint {
    font-size: .85rem;
    color: var(--bp-accent2);
    margin-top: 16px;
    font-style: italic;
}

/* ==========================================================================
 * Event Link Generator — card list
 * ======================================================================== */

.bp-ref-event-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.bp-ref-event-card {
    background: var(--bp-bg);
    border: 1px solid var(--bp-border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color .2s;
}
.bp-ref-event-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.bp-ref-event-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.bp-ref-event-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.bp-ref-event-date {
    font-size: .82rem;
    color: var(--bp-accent2);
    white-space: nowrap;
}

.bp-ref-event-link-row {
    margin-bottom: 10px;
}
.bp-ref-event-link-input {
    font-size: .8rem !important;
    padding: 8px 10px !important;
    width: 100%;
    background: var(--bp-card) !important;
}

.bp-ref-event-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
 * Responsive tweaks
 * ======================================================================== */

@media (max-width: 520px) {
    .bp-ref-card { padding: 18px 14px; }
    .bp-ref-stats-row { gap: 16px; }
    .bp-ref-stat-num { font-size: 1.5rem; }
    .bp-ref-link-box { flex-direction: column; }
    .bp-ref-event-info { flex-direction: column; gap: 2px; }
    .bp-ref-event-actions { flex-direction: column; }
    .bp-ref-event-actions .bp-ref-btn-sm { width: 100%; justify-content: center; }
    .bp-ref-redeem-row { flex-direction: column; align-items: stretch; }
    .bp-ref-redeem-input { width: 100%; }
}


/* ==========================================================================
 * Mini Widget Card — [bp_referral_mini]
 * ======================================================================== */

.bp-ref-mini-card {
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    padding: 18px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--bp-text);
}
.bp-ref-mini-eligible {
    border-color: rgba(168, 85, 247, 0.3);
}
.bp-ref-mini-teaser {
    border-color: rgba(168, 85, 247, 0.15);
    background: linear-gradient(135deg, var(--bp-card) 0%, #1e1040 100%);
}
.bp-ref-mini-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.bp-ref-mini-icon {
    font-size: 1.2rem;
}
.bp-ref-mini-title {
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
}
.bp-ref-mini-balance {
    margin-left: auto;
    font-weight: 700;
    font-size: .95rem;
    color: var(--bp-accent2);
}
.bp-ref-mini-body {
    /* body wrapper */
}
.bp-ref-mini-desc {
    font-size: .85rem;
    color: var(--bp-text);
    margin: 0 0 12px;
    line-height: 1.5;
}
.bp-ref-mini-cta {
    display: inline-flex;
    margin-top: 4px;
}
.bp-ref-mini-progress-label {
    font-size: .75rem;
    color: var(--bp-text);
    margin-top: 4px;
}

/* ==========================================================================
 * How It Works / Rules Section
 * ======================================================================== */

.bp-ref-rules {
    border-color: rgba(168, 85, 247, 0.2);
    background: linear-gradient(135deg, var(--bp-card) 0%, #161230 100%);
}
.bp-ref-rules h3 {
    margin-bottom: 14px;
}
.bp-ref-rules-list {
    margin: 0 0 16px;
    padding-left: 22px;
    list-style: decimal;
    line-height: 1.8;
    font-size: .92rem;
    color: var(--bp-text);
}
.bp-ref-rules-list li {
    padding-left: 4px;
    margin-bottom: 4px;
}
.bp-ref-rules-notes {
    border-top: 1px solid var(--bp-border);
    padding-top: 12px;
    margin-top: 4px;
}
.bp-ref-rules-notes p {
    font-size: .82rem;
    color: #b4b4bd;
    margin: 0 0 6px;
    line-height: 1.5;
}

/* ==========================================================================
 * Event Eligibility Labels
 * ======================================================================== */

.bp-ref-event-eligible {
    font-size: .82rem;
    color: var(--bp-pos);
    font-weight: 600;
    padding: 4px 0;
    margin-bottom: 6px;
}
.bp-ref-event-ineligible {
    font-size: .82rem;
    color: #fbbf24;
    font-weight: 600;
    padding: 4px 0;
    margin-bottom: 6px;
}


/* ==========================================================================
 * Redeem rules list
 * ======================================================================== */

.bp-ref-redeem-rules {
    margin: 8px 0 4px;
    padding-left: 20px;
    list-style: disc;
    font-size: .88rem;
    color: var(--bp-text);
    line-height: 1.7;
}
.bp-ref-redeem-rules li {
    margin-bottom: 2px;
}

/* Rules intro text (admin-editable) */
.bp-ref-rules-intro {
    font-size: .92rem;
    color: var(--bp-text);
    line-height: 1.6;
    margin-bottom: 12px;
}
