/* =============================================================================
   CredoQ Membership Plus — Frontend Styles v7.2
   Covers: [jfb_slot_tracker], [jfbst_membership_status], [jfb_user_qr]
============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --jfbst-primary:  #1e3c5c;
    --jfbst-accent:   #4facfe;
    --jfbst-green:    #22c55e;
    --jfbst-red:      #ef4444;
    --jfbst-orange:   #f59e0b;
    --jfbst-border:   #e2e8f0;
    --jfbst-bg:       #f8fafc;
    --jfbst-text:     #1e293b;
    --jfbst-muted:    #64748b;
    --jfbst-radius:   16px;
    --jfbst-shadow:   0 4px 24px rgba(30,60,92,.10);
}

/* ============================================================
   SHARED PRIMITIVES (reused by both shortcodes)
============================================================ */
.jfbst-tracker-wrap,
.jfbst-membership-status,
.jfbst-tracker-wrap *,
.jfbst-membership-status * {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

/* Progress bar track */
.jfbst-bar {
    background: #e2e8f0;
    border-radius: 99px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    position: relative;
}
.jfbst-bar-thin { height: 7px; }

/* Progress fill */
.jfbst-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
/* Shine animation */
.jfbst-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 55%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    animation: jfbst-shine 2.8s ease infinite;
}
@keyframes jfbst-shine {
    0%   { left: -100%; }
    55%  { left: 120%; }
    100% { left: 120%; }
}
/* Grey fill variant (duration bar) */
.jfbst-fill-gray {
    background: #94a3b8 !important;
}
.jfbst-fill-gray::after { display: none; }

/* Status pill (used in both shortcodes) */
.jfbst-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 800;
    color: white;
    white-space: nowrap;
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* Form ID chip */
.jfbst-form-chip {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 1px 7px;
    border-radius: 5px;
    font-size: .75rem;
    font-weight: 700;
    font-family: monospace;
    margin-left: 3px;
}

/* Popup overlay */
.jfbst-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,.55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.jfbst-popup-box {
    background: white;
    max-width: 500px;
    width: 90%;
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
    position: relative;
}
.jfbst-popup-close {
    position: absolute;
    top: 14px; right: 18px;
    background: none; border: none;
    font-size: 24px; cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    transition: color .2s, transform .2s;
}
.jfbst-popup-close:hover { color: #1e3c5c; transform: rotate(90deg); }

/* Login message */
.jfbst-login-msg {
    color: #64748b;
    font-style: italic;
    font-size: .9rem;
}

/* ============================================================
   [jfb_slot_tracker] — TRACKER SHORTCODE
============================================================ */
.jfbst-tracker-wrap {
    margin-bottom: 20px;
}

/* ── Plan badges container ───────────────────────────────── */
.jfbst-plan-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

/* Single plan badge card */
.jfbst-plan-badge {
    background: #fff;
    border-radius: var(--jfbst-radius);
    padding: 16px 18px;
    box-shadow: var(--jfbst-shadow);
    border: 1px solid var(--jfbst-border);
    transition: transform .18s, box-shadow .18s;
}
.jfbst-plan-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(30,60,92,.13);
}
.jfbst-badge-invalid {
    background: #fff8f8;
    border-color: #fecaca;
}

/* Top row inside badge */
.jfbst-plan-badge-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.jfbst-plan-badge-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.jfbst-plan-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--jfbst-primary);
    line-height: 1.2;
}
.jfbst-plan-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.jfbst-date-chip {
    font-size: .78rem;
    color: var(--jfbst-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}
.jfbst-date-sep {
    color: #cbd5e1;
    font-size: .8rem;
}

/* Per-plan credit bar section */
.jfbst-plan-credit-bar {
    margin-top: 4px;
}
.jfbst-plan-credit-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
    color: var(--jfbst-muted);
    margin-bottom: 6px;
}
.jfbst-plan-no-credit,
.jfbst-plan-invalid-msg {
    font-size: .82rem;
    color: var(--jfbst-muted);
    margin: 4px 0 0;
    font-style: italic;
}
.jfbst-plan-invalid-msg { color: #b91c1c; }

/* ── Combined totals bar ─────────────────────────────────── */
.jfbst-combined-bar-wrap {
    background: #fff;
    border-radius: var(--jfbst-radius);
    padding: 18px 20px;
    box-shadow: var(--jfbst-shadow);
    border: 1px solid var(--jfbst-border);
}
.jfbst-label {
    font-weight: 700;
    color: var(--jfbst-primary);
    font-size: .95rem;
    margin-bottom: 10px;
}
.jfbst-dates {
    margin-top: 10px;
    font-size: .82rem;
    color: var(--jfbst-muted);
}
.jfbst-dates strong { color: var(--jfbst-primary); }
.jfbst-membership-credit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 700;
}

/* ============================================================
   [jfbst_membership_status] — MEMBERSHIP STATUS SHORTCODE
============================================================ */
.jfbst-membership-status {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Header row */
.jfbst-ms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}
.jfbst-ms-header h3 {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: var(--jfbst-primary) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}
.jfbst-ms-count {
    background: #f1f5f9;
    color: var(--jfbst-muted);
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
}

/* Empty state */
.jfbst-ms-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: var(--jfbst-radius);
    border: 1px dashed var(--jfbst-border);
    color: var(--jfbst-muted);
}
.jfbst-ms-empty-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.jfbst-ms-empty p { margin: 0; font-size: .9rem; }

/* Individual plan card */
.jfbst-ms-card {
    background: #fff;
    border-radius: var(--jfbst-radius);
    box-shadow: var(--jfbst-shadow);
    border: 1px solid var(--jfbst-border);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
}
.jfbst-ms-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(30,60,92,.13);
}

/* Card head */
.jfbst-ms-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    gap: 12px;
}
.jfbst-ms-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.jfbst-ms-card-title strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--jfbst-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jfbst-ms-plan-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dates row */
.jfbst-ms-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 14px;
    flex-wrap: wrap;
}
.jfbst-ms-date-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.jfbst-ms-date-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jfbst-muted);
}
.jfbst-ms-date-value {
    font-size: .88rem;
    font-weight: 700;
    color: var(--jfbst-text);
}
.jfbst-ms-date-sep {
    font-size: 1rem;
    color: #cbd5e1;
    padding: 0 4px;
    align-self: flex-end;
    padding-bottom: 2px;
}
.jfbst-expired-text { color: var(--jfbst-red) !important; }

/* Section (credit bar, duration bar) */
.jfbst-ms-section {
    padding: 14px 20px;
    border-top: 1px solid #f1f5f9;
}
.jfbst-ms-section-duration {
    background: #fafbfc;
}
.jfbst-ms-section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: .82rem;
    color: var(--jfbst-muted);
    font-weight: 600;
}
.jfbst-ms-credit-numbers strong { font-weight: 800; }

/* Form IDs note */
.jfbst-ms-form-ids {
    margin-top: 7px;
    font-size: .78rem;
    color: var(--jfbst-muted);
}
.jfbst-ms-form-ids.jfbst-form-ids-all {
    color: var(--jfbst-green);
    font-weight: 600;
}

/* No credit / no section text */
.jfbst-ms-no-credit {
    padding: 10px 20px 14px;
    font-size: .82rem;
    color: var(--jfbst-muted);
    font-style: italic;
    border-top: 1px solid #f1f5f9;
}

/* Card footer */
.jfbst-ms-card-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

/* History button */
.jfbst-history-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 18px !important;
    border-radius: 99px !important;
    background: linear-gradient(135deg, var(--jfbst-primary), #2a5a8c) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: .84rem !important;
    font-family: inherit !important;
    transition: all .2s !important;
}
.jfbst-history-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(30,60,92,.3) !important;
}

/* ============================================================
   [jfb_user_qr] — QR SHORTCODE
============================================================ */
.jfbst-qr-wrap {
    text-align: center;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: #fff;
    border-radius: var(--jfbst-radius);
    padding: 28px;
    box-shadow: var(--jfbst-shadow);
    border: 1px solid var(--jfbst-border);
    display: inline-block;
    max-width: 260px;
}
.jfbst-qr-wrap img {
    max-width: 200px;
    border-radius: 10px;
    display: block;
    margin: 0 auto 12px;
    padding: 10px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.jfbst-qr-wrap p {
    font-size: .85rem;
    color: var(--jfbst-muted);
    margin: 0;
    font-weight: 500;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    .jfbst-plan-badge        { padding: 13px 14px; }
    .jfbst-plan-badge-top    { flex-direction: column; align-items: flex-start; }
    .jfbst-ms-card-head      { flex-wrap: wrap; }
    .jfbst-ms-dates          { flex-direction: column; gap: 6px; }
    .jfbst-ms-date-sep       { display: none; }
    .jfbst-combined-bar-wrap { padding: 14px 14px; }
}

/* ════════════════════════════════════════════════════
   CredoQ v7.2 — New: Radio plan selection + Notifications
════════════════════════════════════════════════════ */

/* ── Plan radio selector ─────────────────────── */
.jfbst-plan-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.jfbst-plan-radio { display: none; }
.jfbst-radio-custom {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    transition: all .2s;
    flex-shrink: 0;
    position: relative;
}
.jfbst-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--jfbst-primary, #1e3c5c);
    transition: transform .2s;
}
.jfbst-plan-radio:checked ~ .jfbst-radio-custom {
    border-color: var(--jfbst-primary, #1e3c5c);
    background: #eff6ff;
}
.jfbst-plan-radio:checked ~ .jfbst-radio-custom::after { transform: translate(-50%,-50%) scale(1); }

.jfbst-badge-valid:has(.jfbst-plan-radio:checked) { box-shadow: 0 0 0 2px var(--jfbst-primary,#1e3c5c) !important; }

.jfbst-selected-plan-info {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-radius: 10px;
    border: 1px solid #bae6fd;
    font-size: .84rem;
    color: #0369a1;
    font-weight: 500;
}

/* ── Notification bell widget ─────────────────── */
.credoq-notif-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}
.credoq-bell-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    position: relative;
    transition: all .2s;
    color: #1e3c5c;
}
.credoq-bell-btn:hover { background: #1e3c5c; color: white; border-color: #1e3c5c; }
.credoq-bell-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: .65rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
    min-width: 18px; padding: 0 3px;
}
.credoq-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 48px rgba(15,23,42,.18);
    z-index: 100001;
    overflow: hidden;
}
.credoq-notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 800;
    font-size: .88rem;
    color: #1e293b;
}
.credoq-notif-mark-read {
    font-size: .72rem; font-weight: 700; color: #4facfe;
    background: none; border: none; cursor: pointer;
    font-family: inherit; padding: 0;
}
.credoq-notif-mark-read:hover { text-decoration: underline; }
.credoq-notif-list { max-height: 360px; overflow-y: auto; }
.credoq-notif-item {
    display: flex; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.credoq-notif-item:last-child { border-bottom: none; }
.credoq-notif-item:hover { background: #f8faff; }
.credoq-notif-unread { background: #f0f9ff !important; }
.credoq-notif-icon { font-size: 1.2rem; flex-shrink: 0; }
.credoq-notif-body { flex: 1; min-width: 0; }
.credoq-notif-title { font-size: .83rem; font-weight: 700; color: #1e293b; margin-bottom: 2px; }
.credoq-notif-msg { font-size: .76rem; color: #64748b; line-height: 1.5; }
.credoq-notif-time { font-size: .68rem; color: #94a3b8; margin-top: 3px; }
.credoq-notif-loading, .credoq-notif-empty {
    padding: 24px; text-align: center; color: #94a3b8; font-size: .85rem;
}

@media(max-width:400px){
    .credoq-notif-panel{ width: 95vw; right: -50%; }
}
