/* ═══════════════════════════════════════════════════════════════════════════ */
/*  TTBPC Member Portal — WooCommerce My Account Extension                   */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Section Container ─────────────────────────────────────────────────── */

.gp-portal-section {
    max-width: 800px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: var(--gp-text, #0a1f0e);
}

.gp-portal-section h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: var(--gp-dark, #0a1f0e);
}

.gp-portal-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

/* ─── Balance Display ───────────────────────────────────────────────────── */

.gp-portal-balance,
.gp-portal-member-number {
    background: var(--gp-green-light, #e6f7ee);
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.gp-portal-balance-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gp-text-muted, #5a7a5e);
    margin-bottom: 8px;
}

.gp-portal-balance-amount {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--gp-green, #00A651);
    line-height: 1.1;
}

/* ─── Tables ────────────────────────────────────────────────────────────── */

.gp-portal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    margin-bottom: 24px;
}

.gp-portal-table th,
.gp-portal-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gp-gray-100, #dde8de);
}

.gp-portal-table th {
    background: var(--gp-gray-50, #f4f6f3);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gp-text-muted, #5a7a5e);
}

.gp-portal-table tr:hover td {
    background: var(--gp-gray-50, #f4f6f3);
}

.gp-portal-table .gp-amount-positive {
    color: var(--gp-green, #00A651);
    font-weight: 600;
}

.gp-portal-table .gp-amount-negative {
    color: #dc2626;
    font-weight: 600;
}

/* ─── Status Badges ─────────────────────────────────────────────────────── */

.gp-portal-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.gp-portal-badge--paid,
.gp-portal-badge--active,
.gp-portal-badge--authorized {
    background: #dcfce7;
    color: #15803d;
}

.gp-portal-badge--pending {
    background: #fef9c3;
    color: #a16207;
}

.gp-portal-badge--failed {
    background: #fecaca;
    color: #dc2626;
}

.gp-portal-badge--redeemed {
    background: #e0e7ff;
    color: #4338ca;
}

.gp-portal-badge--inactive {
    background: #f1f5f9;
    color: #64748b;
}

/* ─── Forms ─────────────────────────────────────────────────────────────── */

.gp-portal-form {
    background: var(--gp-gray-50, #f4f6f3);
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.gp-portal-form-note {
    font-size: 13px;
    color: var(--gp-text-muted, #5a7a5e);
    margin: 0 0 16px;
}

.gp-portal-form-row {
    margin-bottom: 14px;
}

.gp-portal-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gp-text, #0a1f0e);
}

.gp-portal-form-row input,
.gp-portal-form-row select {
    width: 100%;
    max-width: 320px;
    padding: 8px 12px;
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gp-text, #0a1f0e);
    background: #fff;
}

.gp-portal-form-row input:focus,
.gp-portal-form-row select:focus {
    outline: none;
    border-color: var(--gp-green, #00A651);
    box-shadow: 0 0 0 2px rgba(0, 166, 81, 0.15);
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.gp-btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
    line-height: 1.4;
}

.gp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gp-btn-primary {
    background: var(--gp-green, #00A651);
    color: #fff;
}

.gp-btn-primary:hover:not(:disabled) {
    background: var(--gp-green-hover, #008c44);
}

.gp-btn-secondary {
    background: #fff;
    color: var(--gp-green, #00A651);
    border: 1px solid var(--gp-green, #00A651);
}

.gp-btn-secondary:hover:not(:disabled) {
    background: var(--gp-green-light, #e6f7ee);
}

/* ─── Card Display ──────────────────────────────────────────────────────── */

.gp-portal-card-display {
    margin-bottom: 24px;
}

.gp-portal-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 8px;
}

.gp-portal-card-brand {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--gp-text-muted, #5a7a5e);
}

.gp-portal-card-last4 {
    font-size: 18px;
    font-weight: 600;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

/* ─── Clover Element Fields ─────────────────────────────────────────────── */

.gp-clover-field {
    margin-bottom: 14px;
}

.gp-clover-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gp-text, #0a1f0e);
}

.gp-clover-field > div {
    height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 6px;
    background: #fff;
}

.gp-clover-fields-row {
    display: flex;
    gap: 12px;
}

.gp-clover-fields-row .gp-clover-field {
    flex: 1;
}

/* ─── Info Box ──────────────────────────────────────────────────────────── */

.gp-portal-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.gp-portal-info-box p {
    margin: 0;
}

/* ─── Filter Bar ────────────────────────────────────────────────────────── */

.gp-portal-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.gp-portal-filter-bar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gp-text-muted, #5a7a5e);
}

.gp-portal-filter-bar select {
    padding: 6px 10px;
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ─── Messages ──────────────────────────────────────────────────────────── */

.gp-portal-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.gp-portal-msg--success {
    background: #dcfce7;
    color: #15803d;
}

.gp-portal-msg--error {
    background: #fecaca;
    color: #dc2626;
}

/* ─── Empty / Loading States ────────────────────────────────────────────── */

.gp-portal-empty {
    color: var(--gp-text-muted, #5a7a5e);
    font-style: italic;
    padding: 20px 0;
}

.gp-portal-loading {
    color: var(--gp-text-faint, #7a9a7e);
    font-size: 13px;
}

/* ─── Gift Card Accordion ───────────────────────────────────────────────── */

.gp-gc-card {
    border: 1px solid var(--gp-gray-100, #dde8de);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.gp-gc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.gp-gc-card-header:hover {
    background: var(--gp-gray-50, #f4f6f3);
}

.gp-gc-card-number {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-weight: 600;
}

.gp-gc-card-balance {
    font-weight: 700;
    color: var(--gp-green, #00A651);
}

.gp-gc-card-body {
    display: none;
    padding: 0 16px 16px;
    background: var(--gp-gray-50, #f4f6f3);
}

.gp-gc-card.open .gp-gc-card-body {
    display: block;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .gp-clover-fields-row {
        flex-direction: column;
        gap: 0;
    }

    .gp-portal-balance-amount {
        font-size: 28px;
    }

    .gp-portal-table {
        font-size: 13px;
    }

    .gp-portal-table th,
    .gp-portal-table td {
        padding: 8px 8px;
    }
}
