/* ================================================================
   BEN Member Plugin — CSS
   ================================================================ */

/* ── Dashboard tổng thể ──────────────────────────────────────── */
.ben-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.ben-tabs .nav-tab-wrapper {
    border-bottom: 1px solid #ccc;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.ben-tabs .nav-tab-wrapper li {
    margin: 0;
    padding: 0;
}

.ben-tabs .nav-tab {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: 3px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #0073aa;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 3px 3px 0 0;
}

.ben-tabs .nav-tab:hover {
    background: #e8e8e8;
    color: #006799;
}

.ben-tabs .nav-tab-active {
    background: #fff;
    border-bottom: 1px solid #fff;
    color: #222;
    font-weight: 500;
    margin-bottom: -1px;
}

.ben-tabs .tab-content {
    display: none;
    padding: 24px;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
}

.ben-tabs .tab-content.active {
    display: block;
}

/* ── Stat boxes ──────────────────────────────────────────────── */
.ben-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ben-stats .stat-box {
    background: #f0f6fc;
    padding: 20px 16px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #c6dff7;
}

.ben-stats .stat-box h3 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 600;
    color: #0073aa;
}

.ben-stats .stat-box p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

/* ── Model SVG container ─────────────────────────────────────── */
.ben-model {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.ben-model h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

.ben-model p {
    color: #666;
    font-style: italic;
    font-size: 13px;
    margin-top: 10px;
}

/* ── Send post button ────────────────────────────────────────── */
.ben-send-post-btn {
    background: #0073aa !important;
    border-color: #006799 !important;
    padding: 8px 20px !important;
    font-size: 15px !important;
    color: #fff !important;
}

.ben-send-post-btn:hover {
    background: #006799 !important;
    border-color: #005177 !important;
}

/* ── Exchange form ───────────────────────────────────────────── */
.ben-exchange-form .ben-form-group {
    margin-bottom: 18px;
}

.ben-exchange-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.ben-exchange-form input[type="text"],
.ben-exchange-form input.large-text,
.ben-exchange-form textarea.large-text,
.ben-exchange-form select {
    width: 100%;
    max-width: 600px;
    padding: 8px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ben-exchange-form select {
    height: 38px;
}

.ben-exchange-form textarea.large-text {
    resize: vertical;
}

.ben-exchange-form .ben-ok {
    color: #2e7d32;
    margin: 5px 0 0;
    font-size: 13px;
}

.ben-exchange-form .ben-error {
    color: #d32f2f;
    margin: 5px 0 0;
    font-size: 13px;
}

/* Gợi ý list */
.ben-suggestions {
    list-style: none;
    padding: 8px 0 0;
    margin: 0;
}

.ben-suggestions li {
    margin-bottom: 4px;
}

.ben-suggestions a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.ben-suggestions a:hover {
    text-decoration: underline;
}

/* Website đề xuất */
.ben-exchange-form .recommended-sites {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
}

.ben-exchange-form .recommended-sites li {
    margin-bottom: 5px;
}

.ben-exchange-form .recommended-sites a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.ben-exchange-form .recommended-sites a:hover {
    text-decoration: underline;
}

/* ── Invite section ──────────────────────────────────────────── */
.ben-invite {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.ben-invite input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 7px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    background: #f9f9f9;
}

.ben-invite .button {
    white-space: nowrap;
}

/* ── Tables ──────────────────────────────────────────────────── */
.wp-list-table {
    width: 100%;
    border-collapse: collapse;
}

.wp-list-table th,
.wp-list-table td {
    padding: 10px 12px;
    font-size: 13px;
}

/* Responsive table wrapper */
.ben-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Notifications ───────────────────────────────────────────── */
.notice-success.ben-notification {
    border-left-color: #2e7d32 !important;
}

.notice-error.ben-notification {
    border-left-color: #d32f2f !important;
}

.notice-info.ben-notification {
    border-left-color: #0073aa !important;
}

/* ── Template exchange (frontend) ────────────────────────────── */
.ben-exchange-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.7;
}

.ben-exchange-content h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.ben-exchange-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 782px) {
    .ben-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ben-tabs .nav-tab {
        padding: 6px 10px;
        font-size: 13px;
    }

    .ben-tabs .tab-content {
        padding: 16px;
    }

    .ben-invite {
        flex-direction: column;
        align-items: stretch;
    }

    .wp-list-table {
        display: block;
        overflow-x: auto;
    }

    .ben-exchange-form input[type="text"],
    .ben-exchange-form input.large-text,
    .ben-exchange-form textarea.large-text,
    .ben-exchange-form select {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ben-stats {
        grid-template-columns: 1fr 1fr;
    }

    .ben-stats .stat-box h3 {
        font-size: 22px;
    }

    .ben-tabs .nav-tab span.dashicons {
        display: none;
    }
}


/* Rank Math-style wizard UI */
.ben-wizard-progress {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0 auto 22px;
    padding: 0;
    max-width: 860px;
}
.ben-wizard-progress li { display: flex; align-items: center; gap: 8px; flex: 1; color: #7a8494; font-size: 13px; }
.ben-wizard-progress li:not(:last-child)::after { content: ''; height: 2px; flex: 1; margin: 0 10px; background: #dfe5ec; }
.ben-wizard-progress li.is-complete::after, .ben-wizard-progress li.is-active::after { background: #2271b1; }
.ben-wizard-progress span { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #e8edf3; color: #536170; font-weight: 700; }
.ben-wizard-progress .is-active span, .ben-wizard-progress .is-complete span { background: #2271b1; color: #fff; }
.ben-wizard-progress .is-active strong { color: #1d2327; }
/* FIX: đổi từ .ben-wizard-step (bọc ngoài <section>, đã bỏ vì gây lỗi
 * reload iframe TinyMCE) sang .ben-wizard-field (đánh dấu trực tiếp lên
 * từng .ben-form-group gốc, không di chuyển vị trí DOM). */
.ben-wizard-field { display: none; padding: 4px 0; }
.ben-wizard-field.is-active { display: block; animation: benWizardIn .18s ease-out; }
/* Nav (nút Quay lại/Tiếp theo) cần display:flex khi hiện, không phải
 * block, để 2 nút nằm ngang đúng như thiết kế ban đầu. */
.ben-wizard-nav.ben-wizard-field.is-active { display: flex; }
.ben-wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e6e9ed; }
.ben-wizard-summary { margin: 0 0 18px; padding: 14px 16px; border: 1px solid #dfe5ec; border-radius: 8px; background: #f8fafc; }
.ben-wizard-summary h3 { margin: 0 0 8px; }
.ben-wizard-summary p { margin: 4px 0; }
.ben-field-error { border-color: #d63638 !important; box-shadow: 0 0 0 1px #d63638 !important; }
.ben-wizard-inline-error { padding: 10px 12px; border-left: 4px solid #d63638; background: #fff1f1; color: #8a2424; }
@keyframes benWizardIn { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
    .ben-wizard-progress { display: grid; gap: 8px; }
    .ben-wizard-progress li:not(:last-child)::after { display: none; }
    .ben-wizard-progress li { flex: none; }
    .ben-exchange-form { padding: 14px; }
}
