/* =========================================================
   MyCred Chat Economy — Frontend / Profile Tab Styles
   ========================================================= */

/* ── Tab Wrapper ── */
.mce-tab-wrap {
    padding: 6px 0 30px;
    font-family: inherit;
    max-width: 680px;
}

/* ── Section Header ── */
.mce-section-header {
    margin-bottom: 18px;
}

.mce-section-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mce-subtext {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* ==========================================================
   FAN VIEW — price cards + balance + CTA
   ========================================================== */

/* ── Pricing Cards Grid ── */
.mce-pricing-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* ── Individual Price Card ── */
.mce-price-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow 0.2s;
}

.mce-price-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
}

/* ── Card Icon ── */
.mce-price-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* ── Card Info ── */
.mce-price-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mce-price-label {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
    line-height: 1.3;
}

.mce-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.2;
    display: block;
}

.mce-price-amount .mce-point-label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.mce-price-note {
    font-size: 12px;
    color: #a0aec0;
    line-height: 1.4;
}

/* ── Balance Row ── */
.mce-balance-row {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mce-balance-row strong {
    color: #2d3748;
}

.mce-buy-link {
    color: #e67e22;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.mce-buy-link:hover {
    color: #cf6d17;
    text-decoration: underline;
}

/* ── CTA Buttons ── */
.mce-chat-btn,
.mce-chat-btn.button.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
    min-width: 180px;
}

/* "Start Chatting" — blue */
.mce-chat-btn:not(.mce-buy-btn),
.mce-chat-btn.button.button-primary:not(.mce-buy-btn) {
    background: #3b82f6;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(59,130,246,.35);
}

.mce-chat-btn:not(.mce-buy-btn):hover {
    background: #2563eb;
    box-shadow: 0 4px 14px rgba(59,130,246,.45);
    transform: translateY(-1px);
    color: #fff !important;
}

/* "Buy Points to Chat" — orange */
.mce-buy-btn,
.mce-chat-btn.mce-buy-btn.button.button-primary {
    background: #f97316 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(249,115,22,.35) !important;
}

.mce-buy-btn:hover,
.mce-chat-btn.mce-buy-btn:hover {
    background: #ea6c0a !important;
    box-shadow: 0 4px 14px rgba(249,115,22,.45) !important;
    transform: translateY(-1px);
    color: #fff !important;
}

/* ── Welcome Preview ── */
.mce-welcome-preview {
    margin-top: 24px;
    padding: 14px 18px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.mce-welcome-preview-label {
    font-size: 12px;
    color: #0369a1;
    font-weight: 600;
    margin-bottom: 8px;
}

.mce-welcome-preview-bubble {
    font-size: 13.5px;
    color: #1e40af;
    font-style: italic;
    line-height: 1.5;
}

/* ==========================================================
   INFLUENCER VIEW — price editor + breakdown
   ========================================================== */

.mce-price-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Field Group ── */
.mce-field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.mce-price-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mce-price-input {
    width: 90px;
    padding: 9px 12px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: #2d3748;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}

.mce-price-input:focus {
    border-color: #4299e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66,153,225,.18);
}

.mce-price-input-wrap .mce-point-label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.mce-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #a0aec0;
}

/* ── Breakdown Box ── */
.mce-breakdown-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.mce-breakdown-box h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Breakdown Table ── */
.mce-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mce-breakdown-table tr {
    border-bottom: 1px solid #f0f4f8;
}

.mce-breakdown-table tr:last-child {
    border-bottom: none;
}

.mce-breakdown-table td {
    padding: 10px 6px;
    color: #4a5568;
    vertical-align: middle;
}

.mce-breakdown-table td:first-child {
    width: 70%;
}

.mce-breakdown-table .mce-val {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

/* Deduction row — orange/muted */
.mce-deduction-row td {
    color: #c05621;
}

.mce-deduction-row .mce-val.mce-neg {
    color: #c05621;
    font-weight: 700;
}

/* Total row — green highlighted */
.mce-total-row {
    background: #f0fff4;
    border-radius: 6px;
}

.mce-total-row td {
    color: #276749;
    font-weight: 700;
    padding-top: 11px;
    padding-bottom: 11px;
}

.mce-total-row .mce-val.mce-pos {
    color: #276749;
    font-size: 15px;
}

/* ── Hold / Instant Notice ── */
.mce-hold-notice {
    margin: 14px 0 0;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #f6e05e;
    border-left: 4px solid #ecc94b;
    border-radius: 6px;
    font-size: 12.5px;
    color: #744210;
    line-height: 1.5;
}

/* ── Save Button (influencer) ── */
.mce-save-btn,
.mce-save-btn.button.button-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(59,130,246,.3) !important;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
    min-width: 150px;
    justify-content: center;
}

.mce-save-btn:hover {
    background: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59,130,246,.4) !important;
    transform: translateY(-1px);
    color: #fff !important;
}

.mce-save-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Save Message ── */
.mce-save-msg {
    display: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

/* ── Login prompt ── */
.mce-fan-view > p > a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.mce-fan-view > p > a:hover {
    text-decoration: underline;
}

/* ==========================================================
   INFLUENCER VIEW — Inner tabs (Settings / My Earnings)
   ========================================================== */

.mce-inner-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.mce-inner-tab {
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #718096;
    text-decoration: none;
    border-radius: 7px 7px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: color 0.15s, background 0.15s;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mce-inner-tab:hover {
    color: #2d3748;
    background: #f7fafc;
    text-decoration: none;
}

.mce-inner-tab.mce-tab-active {
    color: #2563eb;
    background: #fff;
    border-color: #e2e8f0;
    border-bottom-color: #fff;
}

/* ==========================================================
   MY EARNINGS — Summary cards + earnings table
   ========================================================== */

.mce-earnings-summary {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mce-summary-card {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.mce-summary-num {
    font-size: 26px;
    font-weight: 800;
    color: #276749;
    line-height: 1.1;
}

.mce-summary-lbl {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.mce-no-data {
    font-size: 14px;
    color: #a0aec0;
    font-style: italic;
    padding: 20px 0;
}

/* ── Earnings history table ── */
.mce-earnings-table {
    font-size: 13.5px;
}

.mce-earnings-table thead th {
    text-align: left;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e2e8f0;
}

.mce-earnings-table tbody tr:hover {
    background: #f7fafc;
}

.mce-earnings-table .mce-pos {
    color: #276749;
    font-size: 14px;
}

.mce-log-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

/* ==========================================================
   MY EARNINGS — MyCred [mycred_history] shortcode reskin
   Wraps the shortcode output in .mce-history-wrap and overrides
   MyCred's default table/list styles to match the modern design.
   ========================================================== */

.mce-history-wrap {
    overflow-x: auto;
}

/* Hide MyCred's built-in heading — we have our own section header */
.mce-history-wrap h3,
.mce-history-wrap .mycred-log-title,
.mce-history-wrap > div > h3 {
    display: none !important;
}

/* Table */
.mce-history-wrap table,
.mce-history-wrap .mycred-log {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* Header row */
.mce-history-wrap table thead th,
.mce-history-wrap .mycred-log thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid #e2e8f0;
    background: #fff;
}

/* Body rows */
.mce-history-wrap table tbody tr,
.mce-history-wrap .mycred-log tbody tr,
.mce-history-wrap .mycred-log-row {
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.15s;
}

.mce-history-wrap table tbody tr:last-child,
.mce-history-wrap .mycred-log tbody tr:last-child {
    border-bottom: none;
}

/* Hover effect */
.mce-history-wrap table tbody tr:hover,
.mce-history-wrap .mycred-log tbody tr:hover,
.mce-history-wrap .mycred-log-row:hover {
    background: #f7fafc !important;
}

/* Cells */
.mce-history-wrap table td,
.mce-history-wrap .mycred-log td {
    padding: 11px 14px;
    color: #4a5568;
    vertical-align: middle;
}

/* Date column */
.mce-history-wrap .mycred-log-time,
.mce-history-wrap td:first-child {
    white-space: nowrap;
    font-size: 12px;
    color: #888;
    width: 155px;
}

/* Points / creds column — green, bold, right-aligned */
.mce-history-wrap .mycred-log-creds {
    text-align: right !important;
    white-space: nowrap;
    font-weight: 700;
    font-size: 14px;
    color: #276749 !important;
    width: 110px;
}

/* Add a "+" prefix on positive amounts via pseudo */
.mce-history-wrap .mycred-log-creds:not(:empty)::before {
    content: '+';
    color: #276749;
    font-weight: 700;
}

/* Entry / description column — fan-name links */
.mce-history-wrap .mycred-log-entry {
    color: #4a5568;
}

.mce-history-wrap .mycred-log-entry a,
.mce-history-wrap td a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.mce-history-wrap .mycred-log-entry a:hover,
.mce-history-wrap td a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Entry count text ("N entries") */
.mce-history-wrap .mycred-log-total,
.mce-history-wrap p {
    font-size: 13px;
    color: #718096;
    margin: 0 0 10px 0;
}

/* Pagination */
.mce-history-wrap .mycred-log-pagination,
.mce-history-wrap .mycred-log-navi {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 13px;
}

.mce-history-wrap .mycred-log-pagination a,
.mce-history-wrap .mycred-log-navi a,
.mce-history-wrap .mycred-log-pagination span,
.mce-history-wrap .mycred-log-navi span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #4a5568;
    text-decoration: none;
    background: #fff;
    font-size: 13px;
    transition: background 0.15s;
}

.mce-history-wrap .mycred-log-pagination a:hover,
.mce-history-wrap .mycred-log-navi a:hover {
    background: #f7fafc;
    color: #2d3748;
}

.mce-history-wrap .mycred-log-pagination .current,
.mce-history-wrap .mycred-log-navi .current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 540px) {
    .mce-pricing-display {
        grid-template-columns: 1fr;
    }

    .mce-chat-btn {
        width: 100%;
    }

    .mce-earnings-summary {
        flex-direction: column;
    }

    .mce-inner-tabs {
        flex-wrap: wrap;
    }
}
