/* SmartElite Subscriptions — Frontend / My Account Styles */

/* ── Badge (shared with admin) ────────────────────────────────────────── */
.ses-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.ses-status-active     { background: #d1fae5; color: #065f46; }
.ses-status-cancelled  { background: #fee2e2; color: #991b1b; }
.ses-status-paused     { background: #fef3c7; color: #92400e; }
.ses-status-past-due,
.ses-status-past_due   { background: #fee2e2; color: #991b1b; }
.ses-status-failed     { background: #e5e7eb; color: #374151; }
.ses-status-other      { background: #ede9fe; color: #5b21b6; }

/* ── My Account wrapper ───────────────────────────────────────────────── */
.ses-my-account h2 {
    margin-bottom: 1.2rem;
}

/* ── Table ────────────────────────────────────────────────────────────── */
.ses-subscriptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.ses-subscriptions-table thead th {
    background: #f9fafb;
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.ses-subscriptions-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.ses-subscriptions-table tbody tr:last-child td {
    border-bottom: none;
}
.ses-subscriptions-table tbody tr:hover td {
    background: #fafafa;
}

/* Sub-ID – muted */
.ses-subscriptions-table .ses-col-id {
    color: #9ca3af;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Product link */
.ses-subscriptions-table a {
    text-decoration: none;
}
.ses-subscriptions-table a:hover {
    text-decoration: underline;
}

/* Dates */
.ses-subscriptions-table .ses-col-date {
    white-space: nowrap;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Amount */
.ses-subscriptions-table .ses-col-amount {
    white-space: nowrap;
    font-weight: 600;
}

/* ── Payment method column ────────────────────────────────────────────── */
.ses-col-pm {
    white-space: nowrap;
}

/* "Visa •••• 4242" */
.ses-pm-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* The •••• dots — slightly larger for visual weight */
.ses-pm-dots {
    letter-spacing: 2px;
    font-size: 0.75rem;
    color: #6b7280;
}

/* "exp. 08/27" — muted, on its own line */
.ses-pm-expiry {
    display: block;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* "Manage card →" link when PM details aren't available */
.ses-pm-add-link {
    font-size: 0.85rem;
    color: #1d4ed8;
}

/* "Manual billing" label for WP-Cron-managed subscriptions */
.ses-pm-manual {
    font-size: 0.82rem;
    color: #9ca3af;
}

/* ── Action buttons ───────────────────────────────────────────────────── */
.ses-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
/* Remove default form margins so buttons sit inline */
.ses-actions form {
    margin: 0;
    padding: 0;
}
.ses-actions .button,
.ses-actions button.button {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.ses-actions .button:hover,
.ses-actions button.button:hover {
    background: #f3f4f6;
}

/* Pause – neutral blue tint */
.ses-actions .ses-btn-pause {
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.ses-actions .ses-btn-pause:hover {
    background: #eff6ff;
}

/* Cancel – red */
.ses-actions .ses-btn-cancel {
    color: #b91c1c;
    border-color: #fca5a5;
}
.ses-actions .ses-btn-cancel:hover {
    background: #fef2f2;
}

/* Resume – green */
.ses-actions .ses-btn-resume {
    color: #065f46;
    border-color: #6ee7b7;
}
.ses-actions .ses-btn-resume:hover {
    background: #ecfdf5;
}

/* View Order / Update card – muted */
.ses-actions .ses-btn-view {
    color: #6b7280;
    border-color: #e5e7eb;
}
.ses-actions .ses-btn-view:hover {
    background: #f9fafb;
    color: #111827;
}

/* ── WC Payment Methods page enhancements ─────────────────────────────── */

/* "★ Default" badge on the default card row */
.woocommerce-MyAccount-paymentMethods .ses-pm-default-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #d1fae5;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    pointer-events: none;
    cursor: default;
}

/* "Set as default" button — styled as a soft link-button */
.woocommerce-MyAccount-paymentMethods .ses-pm-set-default-btn {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s;
}
.woocommerce-MyAccount-paymentMethods .ses-pm-set-default-btn:hover {
    background: #dbeafe;
    color: #1e40af;
}

/* "Cannot delete — only card on file" — greyed-out non-link */
.woocommerce-MyAccount-paymentMethods .ses-pm-no-delete {
    display: inline-block;
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
    text-decoration: none !important;
    pointer-events: none;
    cursor: default;
}


@media (max-width: 768px) {
    .ses-subscriptions-table thead {
        display: none;
    }
    .ses-subscriptions-table tbody tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 8px 0;
    }
    .ses-subscriptions-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 7px 14px;
        border-bottom: 1px solid #f3f4f6;
        font-size: 0.875rem;
    }
    .ses-subscriptions-table tbody td:last-child {
        border-bottom: none;
    }
    .ses-subscriptions-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        flex-shrink: 0;
        margin-right: 10px;
    }
    /* On mobile, stack PM info vertically */
    .ses-pm-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 1px;
    }
    .ses-pm-expiry {
        text-align: right;
    }
    .ses-actions {
        justify-content: flex-end;
    }
}
