/* BBC Subscriber Form – bbc-sub-style.css v2.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.bbc-invalid {
    border-color: #c0392b;
}

/* 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: 9998;
}

#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: 9999;
    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-popup-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 (admin only) ---- */
.bbc-sub-list-wrap {
    margin-top: 48px;
    border-top: 2px solid #e0e0e0;
    padding-top: 28px;
}

.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; }
}

/* ---- Action buttons in table ---- */
.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; }

/* ---- Edit Modal ---- */
#bbc-edit-overlay, #bbc-delete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}

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

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

#bbc-edit-modal.bbc-modal-open,
#bbc-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 {
    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 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 12px 0 6px;
}

#bbc-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; }
}
