/* ── Notification Bell Dropdown ──────────────────────────────── */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    margin-right: 12px;
}

/* Prevent notification dropdown from causing body horizontal scroll */
.notif-details-page,
.notif-details-card,
.notif-details-header,
.notif-details-body,
.notif-details-actions,
.notif-user-details-card,
.notif-user-header,
.notif-user-body,
.notif-details-desc,
.notif-quill-content {
    box-sizing: border-box;
}

.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    font-size: 22px;
    color: #545cd8;
    padding: 8px 10px;
    transition: color 0.2s, transform 0.15s;
    border-radius: 50%;
}

.notif-bell-btn:hover {
    color: #3a44c4;
    transform: scale(1.1);
}

.notif-bell-btn:focus {
    outline: none;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff4757 0%, #d92550 100%);
    border-radius: 10px;
    padding: 0 5px;
    display: none;
    box-shadow: 0 2px 6px rgba(217, 37, 80, .35);
    animation: notif-pulse 2s infinite;
}

@keyframes notif-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notif-dropdown {
    display: none;
    position: fixed;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(84, 92, 216, .16), 0 4px 12px rgba(0, 0, 0, .06);
    z-index: 9999;
    overflow: hidden;
    border: 1px solid rgba(84, 92, 216, .1);
    direction: rtl;
}

@keyframes notif-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eef0fb;
    background: linear-gradient(135deg, #f7f8ff 0%, #eef0fb 100%);
    font-weight: 700;
    font-size: 15px;
    color: #2c2f6b;
}

.notif-dropdown-header a {
    font-size: 12px;
    color: #545cd8;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.notif-dropdown-header a:hover {
    background: rgba(84, 92, 216, .1);
    text-decoration: none;
    color: #3a44c4;
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.notif-list::-webkit-scrollbar {
    width: 5px;
}

.notif-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* ── Individual item ── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f5f5fa;
    cursor: pointer;
    transition: background 0.18s, transform 0.12s;
    text-align: right;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f0f2ff;
}

/* Unread dot */
.notif-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    background: transparent;
    transition: background 0.2s, box-shadow 0.2s;
}

.notif-unread .notif-dot {
    background: linear-gradient(135deg, #545cd8 0%, #6c63ff 100%);
    box-shadow: 0 0 0 4px rgba(84, 92, 216, .12);
}

.notif-item.notif-unread {
    background: linear-gradient(90deg, #f7f8ff 0%, #fff 100%);
    border-right: 3px solid #545cd8;
}

.notif-item.notif-read {
    opacity: 0.75;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-weight: 700;
    font-size: 13px;
    color: #2c2f6b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.notif-item-desc {
    font-size: 12px;
    color: #7a7a9e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-item-date {
    font-size: 11px;
    color: #b0b0c8;
    font-weight: 500;
}

.notif-empty {
    text-align: center;
    padding: 48px 16px;
    color: #c0c0d8;
    font-size: 14px;
}

.notif-empty i {
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    color: #dde;
}

/* ── Footer "View All" link ── */
.notif-dropdown-footer {
    text-align: center;
    padding: 12px;
    border-top: 1px solid #eef0fb;
    background: linear-gradient(135deg, #fafbff 0%, #f5f6ff 100%);
}

.notif-dropdown-footer a {
    font-size: 13px;
    color: #545cd8;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    transition: background 0.15s;
    display: inline-block;
}

.notif-dropdown-footer a:hover {
    background: rgba(84, 92, 216, .08);
    text-decoration: none;
}

/* ── Notification Details Page ──────────────────────────────── */
.notif-details-page {
    padding: 0;
    overflow-x: hidden;
    max-width: 100%;
}

.notif-details-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(84, 92, 216, .08), 0 1px 4px rgba(0, 0, 0, .04);
    overflow: hidden;
    margin-bottom: 24px;
    max-width: 100%;
}

.notif-details-header {
    background: linear-gradient(135deg, #545cd8 0%, #6c63ff 100%);
    padding: 28px 32px;
    color: #fff;
    direction: rtl;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notif-details-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.notif-details-header .notif-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 13px;
    opacity: 0.9;
}

.notif-details-header .notif-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notif-details-header .notif-meta-item i {
    font-size: 14px;
}

.notif-details-body {
    padding: 28px 32px;
    direction: rtl;
    text-align: right;
}

.notif-details-section {
    margin-bottom: 24px;
}

.notif-details-section:last-child {
    margin-bottom: 0;
}

.notif-details-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c2f6b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eef0fb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-details-section-title i {
    color: #545cd8;
    font-size: 16px;
}

.notif-details-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    padding: 14px 18px;
    background: #f9f9ff;
    border-radius: 10px;
    border: 1px solid #eef0fb;
}

/* Quill content container */
.notif-quill-content {
    background: #fafbff;
    border-radius: 10px;
    border: 1px solid #eef0fb;
    line-height: 1.8;
    font-size: 14px;
    color: #333;
}

/*!* ── Quill: toolbar stays LTR, content area is RTL ─────────────── *!
#quillEditor {
    direction: ltr; !* keeps toolbar buttons rendering left → right *!
}*/

.ql-toolbar.ql-snow {
    direction: ltr !important;
    text-align: left !important;
}


/* RTL list indentation in the editor: gutter must be on the RIGHT */
#quillEditor .ql-editor ol,
#quillEditor .ql-editor ul {
    padding-right: 0;
    padding-left: 0;
}

#quillEditor .ql-editor li {
    padding-right: 1.5em !important;
    padding-left: 0 !important;
}


/* RTL padding on lists also for the details-page viewer */
.notif-quill-content ol,
.notif-quill-content ul {
    padding-right: 1.5em !important;
    padding-left: 0 !important;
}

/*
 * Details-page list markers
 * ─────────────────────────
 * Content is saved as quill.root.innerHTML which keeps Quill's internal
 * markup: <ol><li data-list="bullet|ordered" class="ql-align-right">
 *           <span class="ql-ui">•</span>text</li></ol>
 *
 * The ql-ui spans use position:absolute with LTR-based offsets, so they
 * appear on the WRONG (left) side for RTL content.
 * Fix: hide ql-ui spans and restore native browser list-style markers,
 * scoped to .notif-quill-content so the live editor is NOT affected.
 */

/* 1. Hide the editor-only ql-ui decorator spans */
.notif-quill-content .ql-ui {
    display: none !important;
}

/* 2. Reset Quill's LTR padding on li (no longer needed since ql-ui is hidden) */
.notif-quill-content li {
    padding-left: 0 !important;
    direction: rtl; /* ensure RTL for every list item */
    list-style-position: outside;
}

/* 3. Bullet lists — data-list="bullet" (root.innerHTML) or plain <ul><li> (getSemanticHTML) */
.notif-quill-content li[data-list="bullet"],
.notif-quill-content ul li {
    list-style-type: disc !important;
}

/* 4. Ordered lists — data-list="ordered" (root.innerHTML) or plain <ol><li> (getSemanticHTML) */
.notif-quill-content li[data-list="ordered"],
.notif-quill-content ol li:not([data-list="bullet"]) {
    list-style-type: decimal !important;
}

/* Receivers table in details */
.notif-receivers-section .listing_table {
    margin-top: 8px;
}

/* Status badge in header */
.notif-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
}

.notif-status-badge.status-pending {
    background: rgba(255, 255, 255, .2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
}

.notif-status-badge.status-processing {
    background: rgba(255, 193, 7, .9);
    color: #333;
}

.notif-status-badge.status-sent {
    background: rgba(40, 167, 69, .9);
    color: #fff;
}

.notif-status-badge.status-failed {
    background: rgba(220, 53, 69, .9);
    color: #fff;
}

/* Action buttons */
.notif-details-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px 32px;
    border-top: 1px solid #eef0fb;
    background: #fafbff;
}

/* The "Send" button is nested inside a <form> — make the form a flex item too */
.notif-details-actions form {
    display: contents; /* form becomes transparent to flex layout */
}

/* Override global .main-cta (display:block; width:100%) inside this section */
.notif-details-actions .main-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto !important;
    min-width: 160px;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(84, 92, 216, .25);
    margin: 0;
}

.notif-details-actions .main-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(84, 92, 216, .35);
    color: #fff;
    text-decoration: none;
}

.notif-details-actions .main-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(84, 92, 216, .2);
}

/* User notification details — simpler version */
.notif-user-details-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(84, 92, 216, .08);
    overflow: hidden;
    margin-bottom: 24px;
    max-width: 100%;
}

.notif-user-header {
    background: linear-gradient(135deg, #545cd8 0%, #6c63ff 100%);
    padding: 24px 28px;
    color: #fff;
    direction: rtl;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
}

.notif-user-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, .15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.notif-user-header-text {
    flex: 1;
    min-width: 0;
}

.notif-user-header-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notif-user-header-text .notif-user-meta {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    gap: 14px;
    align-items: center;
}

.notif-user-body {
    padding: 24px 28px;
    direction: rtl;
    text-align: right;
}

/* Responsive */
@media (max-width: 576px) {
    .notif-dropdown {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: 12px !important;
    }

    .notif-details-header,
    .notif-details-body,
    .notif-details-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .notif-details-header h2 {
        font-size: 18px;
    }

    .rcv-row {
        flex-wrap: wrap;
    }

    .rcv-field-type {
        flex: 1 1 100% !important;
    }

    .rcv-field-ids {
        flex: 1 1 100% !important;
    }
}

/* ── Receivers Editor ──────────────────────────────────────── */
.rcv-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 16px;
    margin: 0 0 8px 0;
    background: #f9f9ff;
    border: 1px solid #eef0fb;
    border-radius: 10px;
    direction: rtl;
}

.rcv-row:last-child {
    margin-bottom: 0;
}

.rcv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rcv-field > label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 0;
    white-space: nowrap;
}

.rcv-field-type {
    flex: 0 0 180px;
}

.rcv-field-all {
    flex: 0 0 50px;
    align-items: center;
}

.rcv-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
}

.rcv-checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #545cd8;
}

.rcv-field-ids {
    flex: 1 1 auto;
    min-width: 200px;
}

.rcv-field-remove {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.rcv-field-remove .btn {
    height: 38px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
}

.rcv-field-remove .btn i {
    margin: 0;
    font-size: 14px;
}

#receiversContainer {
    padding: 8px;
}

#receiversContainer:empty {
    padding: 0;
}

/* Semantic UI dropdown inside receiver rows */
.rcv-field-ids .ui.dropdown {
    min-height: 38px !important;
    border-radius: 8px !important;
}

.rcv-field-ids .ui.dropdown > .text {
    font-size: 13px;
}

.rcv-field .form-control {
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
}

