/* BBC Subscriber Form – bbc-sub-style.css v3.0.0 */

.bbc-sub-wrap {
    max-width: 520px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
}

#bbc-sub-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bbc-sub-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbc-sub-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.bbc-sub-field label span {
    color: #c0392b;
    margin-left: 2px;
}

.bbc-sub-field input[type="text"],
.bbc-sub-field input[type="email"],
.bbc-sub-field input[type="tel"],
.bbc-sub-field input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #222;
}

.bbc-sub-field input:focus {
    border-color: #5b4de0;
    box-shadow: 0 0 0 3px rgba(91,77,224,0.12);
}

.bbc-sub-field input[readonly] {
    background: #f5f5f5;
    color: #888;
    cursor: default;
    border-color: #e0e0e0;
}

.bbc-sub-field input.bbc-invalid {
    border-color: #c0392b;
}

/* ---- Avatar Upload ---- */
.bbc-avatar-upload-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bbc-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f0eeff;
    border: 2px solid #c5bcf5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.bbc-avatar-placeholder {
    font-size: 32px;
    line-height: 1;
    color: #9b8fe8;
}

.bbc-avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbc-avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0eeff;
    color: #4a3cc8;
    border: 1.5px solid #c5bcf5;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    width: fit-content;
}

.bbc-avatar-upload-btn:hover { background: #e0dbff; }

.bbc-avatar-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    color: #c0392b;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.bbc-avatar-remove-btn:hover { opacity: 0.7; }

.bbc-avatar-hint {
    font-size: 11px;
    color: #999;
    margin: 0;
}

/* Password show/hide */
.bbc-pw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.bbc-pw-input-wrap input[type="password"],
.bbc-pw-input-wrap input[type="text"] {
    padding-right: 44px;
}

.bbc-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    color: #888;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bbc-toggle-pw:hover { opacity: 1; }

.bbc-sub-error {
    font-size: 12px;
    color: #c0392b;
    min-height: 16px;
    display: block;
}

#bbc-sub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #5b4de0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

#bbc-sub-btn:hover  { background: #4a3cc8; }
#bbc-sub-btn:active { transform: scale(0.98); }
#bbc-sub-btn:disabled { background: #a09ad4; cursor: not-allowed; }

.bbc-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bbc-spin 0.7s linear infinite;
}

.bbc-loading .bbc-btn-spinner { display: inline-block; }
.bbc-loading .bbc-btn-text    { opacity: 0.7; }

@keyframes bbc-spin {
    to { transform: rotate(360deg); }
}

/* ---- Popup ---- */
#bbc-sub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999998;
}

#bbc-sub-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px 32px;
    text-align: center;
    z-index: 999999;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#bbc-sub-popup.bbc-modal-open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.bbc-sub-popup-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #eaf3de;
    color: #3b6d11;
    font-size: 28px;
    line-height: 60px;
    margin: 0 auto 16px;
}

#bbc-sub-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
}

#bbc-sub-popup p {
    font-size: 15px;
    color: #555;
    margin: 0 0 24px;
}

.bbc-sub-popup-close {
    background: #5b4de0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bbc-sub-popup-close:hover { background: #4a3cc8; }

/* Admin notice banner */
.bbc-admin-notice {
    background: #fff8e1;
    border-left: 4px solid #f0ad00;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #5a4000;
    border-radius: 0 4px 4px 0;
}

.bbc-already-logged-in {
    color: #555;
    font-style: italic;
}

/* ---- Subscriber List ---- */
.bbc-sub-list-wrap {
    margin-top: 48px;
    border-top: 2px solid #e0e0e0;
    padding-top: 28px;
    max-width: 100%;
}

.bbc-sub-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.bbc-sub-list-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbc-sub-count {
    background: #5b4de0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
}

#bbc-sub-search {
    padding: 8px 12px;
    font-size: 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    outline: none;
    width: 220px;
    transition: border-color 0.2s;
}

#bbc-sub-search:focus {
    border-color: #5b4de0;
    box-shadow: 0 0 0 3px rgba(91,77,224,0.10);
}

.bbc-sub-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.bbc-sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bbc-sub-table thead tr {
    background: #f5f3ff;
}

.bbc-sub-table th {
    text-align: left;
    padding: 11px 14px;
    font-weight: 600;
    color: #3d2fa0;
    border-bottom: 1.5px solid #e0e0e0;
    white-space: nowrap;
}

.bbc-sub-table td {
    padding: 10px 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.bbc-sub-table tbody tr:last-child td { border-bottom: none; }
.bbc-sub-table tbody tr:hover { background: #faf9ff; }

.bbc-sub-table a { color: #5b4de0; text-decoration: none; }
.bbc-sub-table a:hover { text-decoration: underline; }

.bbc-sub-table tr.bbc-hidden { display: none; }
.bbc-sub-empty { color: #888; font-style: italic; padding: 12px 0; }

.bbc-sub-table tr.bbc-new-row {
    animation: bbc-highlight 2s ease forwards;
}
@keyframes bbc-highlight {
    0%   { background: #ede9ff; }
    100% { background: transparent; }
}

/* Avatar in table */
.bbc-td-avatar { width: 52px; }

.bbc-table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    display: block;
}

/* ---- Action buttons ---- */
.bbc-actions { white-space: nowrap; }

.bbc-btn-edit, .bbc-btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    border: 1.5px solid;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-right: 4px;
}

.bbc-btn-edit { background: #f0eeff; color: #4a3cc8; border-color: #c5bcf5; }
.bbc-btn-edit:hover { background: #e0dbff; }

.bbc-btn-delete { background: #fff0f0; color: #c0392b; border-color: #f5bcbc; }
.bbc-btn-delete:hover { background: #ffe0e0; }

/* ---- Status badge ---- */
.bbc-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.bbc-status-active {
    background: #eaf3de;
    color: #3b6d11;
}

.bbc-status-suspended {
    background: #fff0f0;
    color: #c0392b;
}

/* ---- Suspended row ---- */
.bbc-sub-table tbody tr.bbc-row-suspended td {
    opacity: 0.55;
}

/* ---- Suspend / Activate button ---- */
.bbc-btn-toggle-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    border: 1.5px solid;
    cursor: pointer;
    transition: background 0.15s;
    margin-right: 4px;
    background: #fff8e1;
    color: #7a5800;
    border-color: #f0d080;
}

.bbc-btn-toggle-status:hover { background: #fff0c0; }

/* ---- Pagination ---- */
.bbc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.bbc-page-btn {
    display: inline-block;
    padding: 6px 13px;
    border-radius: 6px;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #5b4de0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.bbc-page-btn:hover {
    background: #f0eeff;
    border-color: #c5bcf5;
    text-decoration: none;
}

.bbc-page-btn.bbc-page-current {
    background: #5b4de0;
    color: #fff;
    border-color: #5b4de0;
    pointer-events: none;
}

/* ---- Modals ---- */
/* Ensure overlays/modals are truly gone when hidden — theme resets can strip the browser default */
#bbc-sub-overlay[hidden],
#bbc-edit-overlay[hidden], #bbc-delete-overlay[hidden],
#bbc-my-edit-overlay[hidden], #bbc-my-delete-overlay[hidden],
#bbc-sub-popup[hidden],
#bbc-edit-modal[hidden], #bbc-delete-modal[hidden],
#bbc-my-edit-modal[hidden], #bbc-my-delete-modal[hidden] {
    display: none !important;
}

#bbc-edit-overlay, #bbc-delete-overlay,
#bbc-my-edit-overlay, #bbc-my-delete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999998;
}

#bbc-edit-modal, #bbc-delete-modal,
#bbc-my-edit-modal, #bbc-my-delete-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.93);
    background: #fff;
    border-radius: 12px;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#bbc-edit-modal, #bbc-my-edit-modal { max-width: 480px; }
#bbc-delete-modal, #bbc-my-delete-modal { max-width: 360px; padding: 36px 28px; text-align: center; }

#bbc-edit-modal.bbc-modal-open,
#bbc-delete-modal.bbc-modal-open,
#bbc-my-edit-modal.bbc-modal-open,
#bbc-my-delete-modal.bbc-modal-open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.bbc-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    margin-bottom: 16px;
}

.bbc-edit-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.bbc-edit-modal-x {
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.bbc-edit-modal-x:hover { color: #333; }

#bbc-edit-form, #bbc-my-edit-form {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bbc-edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.bbc-btn-cancel {
    background: #f5f5f5;
    color: #555;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bbc-btn-cancel:hover { background: #ebebeb; }

.bbc-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #5b4de0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bbc-btn-save:hover { background: #4a3cc8; }
.bbc-btn-save:disabled { background: #a09ad4; cursor: not-allowed; }

.bbc-optional {
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-left: 4px;
}

/* ---- Delete Modal ---- */
.bbc-delete-icon { background: #fff0f0; color: #c0392b; font-size: 24px; }

#bbc-delete-modal h3, #bbc-my-delete-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 12px 0 6px;
}

#bbc-delete-modal p, #bbc-my-delete-modal p {
    font-size: 14px;
    color: #555;
    margin: 0 0 20px;
}

.bbc-delete-modal-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.bbc-btn-delete-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bbc-btn-delete-confirm:hover { background: #a93226; }
.bbc-btn-delete-confirm:disabled { background: #e08070; cursor: not-allowed; }

.bbc-row-deleted { animation: bbc-fadeout 0.4s ease forwards; }
@keyframes bbc-fadeout {
    from { opacity: 1; background: #ffe0e0; }
    to   { opacity: 0; }
}

/* ================================================
   MY ACCOUNT – Profile Card
================================================ */
.bbc-my-account-wrap {
    max-width: 580px;
}

.bbc-profile-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.bbc-profile-avatar-wrap {
    flex-shrink: 0;
}

.bbc-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c5bcf5;
    display: block;
}

.bbc-profile-info {
    flex: 1;
    min-width: 0;
}

.bbc-profile-name {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

.bbc-profile-username {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
}

.bbc-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px;
}

.bbc-profile-meta span {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bbc-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bbc-btn-profile-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #5b4de0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bbc-btn-profile-edit:hover { background: #4a3cc8; }

.bbc-btn-profile-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff0f0;
    color: #c0392b;
    border: 1.5px solid #f5bcbc;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bbc-btn-profile-delete:hover { background: #ffe0e0; }

/* Responsive profile card */
@media (max-width: 480px) {
    .bbc-profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .bbc-profile-meta { align-items: center; }
    .bbc-profile-actions { justify-content: center; }
}
