﻿/* ═══════════════════════════════════════════════════════════════
   اعلان‌های سایت — مودال Bootstrap + زنگوله (لایت/دارک + رنگ سازمانی)
   ═══════════════════════════════════════════════════════════════ */


.site-ann-header :is(h1,h2,h3,h4,h5,h6) {
    color: var(--C1, #294a41);
    font-weight: 700;
}
.site-ann-body {
    font-size: 0.95rem;
    line-height: 1.75;
}
.site-ann-title {
    color: var(--C1, #294a41);
    font-weight: 700;
}
.site-ann-image-wrap {
    overflow: hidden;
    line-height: 0;
}
.site-ann-image-wrap.site-loader-wrap {
    position: relative;
    min-height: min(100px, 21vh);
    border-radius: inherit;
}
.site-ann-image-wrap.site-loader-wrap:not(.loading) {
    min-height: 0;
}
.site-ann-image-wrap.site-loader-wrap.loading .site-ann-image {
    opacity: 0;
}
.site-ann-image-wrap.site-loader-wrap:not(.loading) .site-ann-image {
    opacity: 1;
    transition: opacity 0.22s ease;
    border-radius: .875rem;
}
.site-ann-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(420px, 55vh);
    object-fit: cover;
}
.site-ann-image-link {
    line-height: 0;
    text-decoration: none;
}
.site-ann-image-link:hover .site-ann-image {
    opacity: 0.92;
}

body.site-ann-open {
    overflow: hidden;
}

/* ── مودال اعلان ── */
.site-ann-modal-content--no-header .site-ann-modal-body {
    border-top-left-radius: var(--bs-modal-inner-border-radius, 0.5rem);
    border-top-right-radius: var(--bs-modal-inner-border-radius, 0.5rem);
}
.site-ann-modal-footer-split {
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
}
.site-ann-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-inline-start: auto;
}
.site-ann-modal-close-footer {
    min-width: 4.25rem;
}

[data-bs-theme="dark"] .site-ann-header :is(h1,h2,h3,h4,h5,h6),
[data-bs-theme="dark"] .site-ann-title {
    color: var(--C6, #e5e7eb);
}
[data-bs-theme="dark"] .site-ann-footer-text {
    color: var(--C6, #e5e7eb);
}

/* ── زنگوله ── */
.site-ann-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.site-ann-bell-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.4rem 0.55rem;
    color: inherit;
    text-decoration: none;
    border: none;
    background: transparent;
    line-height: 1;
    border-radius: 0.55rem;
    transition: background 0.18s ease, color 0.18s ease;
}
.site-ann-bell-trigger:hover,
.site-ann-bell-trigger:focus,
.site-ann-bell-trigger.show {
    background: color-mix(in srgb, var(--C3, #08a379) 12%, transparent);
    color: var(--C1, #294a41);
}
.site-ann-bell-trigger .ti {
    font-size: 1.35rem;
}
.site-ann-bell-badge {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.22rem;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
    color: #fff;
    background: #dc3545;
    border-radius: 999px;
    border: 2px solid var(--bs-body-bg, #fff);
}
.site-ann-bell-menu {
    width: min(360px, calc(100vw - 1.5rem));
    max-height: min(440px, calc(100vh - 6rem));
    overflow: hidden;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--C3, #08a379) 18%, var(--bs-border-color, #dee2e6) 82%);
    border-radius: 0.85rem !important;
    box-shadow: 0 16px 40px -12px rgba(5, 42, 20, 0.2), 0 0 0 1px color-mix(in srgb, var(--C3, #08a379) 6%, transparent);
    background: var(--bs-body-bg, #fff);
    z-index: 10055 !important;
}
.site-ann-bell-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--C1, #294a41);
    background: color-mix(in srgb, var(--C2, #e0fbf4) 35%, var(--bs-body-bg, #fff) 65%);
}
.site-ann-bell-head a {
    margin-inline-start: auto;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--C3, #08a379);
}
.site-ann-bell-mark-all {
    font-size: 0.72rem !important;
    padding: 0 !important;
    color: var(--bs-secondary-color, #6c757d) !important;
}
.site-ann-bell-list {
    max-height: min(340px, calc(100vh - 10rem));
    overflow-y: auto;
}
.site-ann-bell-loading.panel-loader-wrap {
    min-height: 88px;
    border-radius: 0;
}
.site-ann-bell-loading.panel-loader-wrap.loading::before {
    border-radius: 0;
}
.site-ann-bell-item {
    padding: 0.8rem 0.95rem;
    border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color, #dee2e6) 65%, transparent);
    cursor: pointer;
    transition: background 0.15s ease;
}
.site-ann-bell-item:last-child { border-bottom: none; }
.site-ann-bell-item:hover {
    background: color-mix(in srgb, var(--C2, #e0fbf4) 45%, transparent);
}
.site-ann-bell-item--unread {
    background: color-mix(in srgb, var(--C3, #08a379) 9%, var(--bs-body-bg, #fff) 91%);
    border-inline-start: 3px solid var(--C3, #08a379);
    padding-inline-start: calc(0.95rem - 3px);
}
.site-ann-bell-item-top {
    margin-bottom: 0.3rem;
}
.site-ann-bell-item-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0;
    line-height: 1.45;
    color: var(--C6, #052a14);
}
.site-ann-bell-item-cat {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 0.3rem;
    opacity: 0.92;
    --bs-btn-padding-y: 0.1rem;
    --bs-btn-padding-x: 0.45rem;
    --bs-btn-font-size: 0.62rem;
}
.site-ann-bell-item-body {
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0 0 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}
.site-ann-bell-item-preview {
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0.15rem 0 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.site-ann-bell-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.65rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #697a8d);
    margin-top: 0.35rem;
}
.site-ann-bell-item-date {
    flex-shrink: 0;
}
.site-ann-bell-item-cta-wrap {
    margin-inline-start: auto;
}
.site-ann-bell-item-actions {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid color-mix(in srgb, var(--bs-border-color, #dee2e6) 55%, transparent);
}
.site-ann-bell-item--unread .site-ann-bell-item-actions {
    border-top-color: color-mix(in srgb, var(--C3, #08a379) 14%, var(--bs-border-color, #dee2e6) 86%);
}
.site-ann-bell-item-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
    border: 1px solid color-mix(in srgb, var(--C3, #08a379) 35%, var(--bs-border-color, #dee2e6) 65%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--C3, #08a379) 6%, var(--bs-body-bg, #fff) 94%);
    color: var(--C3, #08a379);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.site-ann-bell-item-mark .ti {
    font-size: 0.85rem;
}
.site-ann-bell-item-mark:hover {
    background: color-mix(in srgb, var(--C3, #08a379) 14%, var(--bs-body-bg, #fff) 86%);
    border-color: var(--C3, #08a379);
}
.site-ann-bell-item-read-label {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--bs-secondary-color, #6c757d);
    opacity: 0.72;
}
.site-ann-bell-item-read-label .ti {
    font-size: 0.82rem;
    opacity: 0.85;
}
.site-ann-bell-item-cta {
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.site-ann-bell-item-cta-wrap .btn {
    pointer-events: auto;
}
.site-ann-bell-empty {
    padding: 0;
}
.site-ann-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.75rem 1.25rem 1.5rem;
    gap: 0.35rem;
}
.site-ann-empty-state--bell {
    min-height: 9rem;
}
.site-ann-empty-state--page {
    padding: 2.5rem 1.5rem;
    margin: 0.5rem 0 0.25rem;
    border-radius: 0.75rem;
    border: 1px dashed color-mix(in srgb, var(--C3, #08a379) 18%, var(--bs-border-color, #dee2e6) 82%);
    background: color-mix(in srgb, var(--C2, #e0fbf4) 22%, var(--bs-body-bg, #fff) 78%);
}
.site-ann-empty-state__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.35rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--C3, #08a379) 12%, var(--C2, #e0fbf4) 88%);
    color: var(--C3, #08a379);
    font-size: 1.45rem;
    line-height: 1;
}
.site-ann-empty-state__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--C1, #294a41);
}
.site-ann-empty-state__desc {
    margin: 0;
    max-width: 22rem;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--bs-secondary-color, #6c757d);
}
.site-ann-empty-state__action {
    margin-top: 0.65rem;
    border-radius: 0.55rem;
    font-size: 0.82rem;
}
.profile-panel[data-bs-theme="dark"] .site-ann-empty-state--page {
    background: color-mix(in srgb, var(--C8, #0b1411) 88%, var(--C3, #047b54) 12%);
    border-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .site-ann-empty-state__icon-wrap {
    background: color-mix(in srgb, var(--C3, #047b54) 18%, var(--C8, #0b1411) 82%);
    color: var(--C6, #e5e7eb);
}
.profile-panel[data-bs-theme="dark"] .site-ann-empty-state__title {
    color: var(--C6, #e5e7eb);
}
.profile-panel[data-bs-theme="dark"] .site-ann-empty-state__desc {
    color: var(--C5, #9ca3af);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-empty .site-ann-empty-state__title {
    color: var(--C6, #e5e7eb);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-empty .site-ann-empty-state__desc {
    color: var(--C5, #9ca3af);
}
.site-ann-bell-more {
    padding: 0.65rem 0.9rem;
    text-align: center;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    background: color-mix(in srgb, var(--C2, #e0fbf4) 25%, var(--bs-body-bg, #fff) 75%);
}
.site-ann-bell-more a {
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--C3, #08a379) !important;
}
.site-ann-bell-more a:hover {
    text-decoration: underline;
}

/* ── پروفایل: هدر موبایل — زنگوله سمت چپ ── */
.profile-mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    min-height: 52px;
}
.profile-mobile-topbar .navbar-toggler {
    order: 1;
    flex-shrink: 0;
}
.profile-mobile-topbar .navbar-brand {
    order: 2;
    flex: 1 1 auto;
    text-align: center;
    margin: 0 !important;
    padding: 0.35rem 0;
    font-weight: 700;
}
.profile-mobile-topbar .profile-mobile-bell {
    order: 3;
    flex-shrink: 0;
    margin-inline-start: 0;
}
.profile-mobile-topbar .site-ann-bell-trigger {
    padding: 0.45rem;
    border-radius: 0.65rem;
}
.profile-panel[data-bs-theme="dark"] .profile-mobile-topbar .site-ann-bell-trigger:hover,
.profile-panel[data-bs-theme="dark"] .profile-mobile-topbar .site-ann-bell-trigger.show {
    background: rgba(255, 255, 255, 0.08);
    color: var(--C6, #e5e7eb);
}
.profile-panel[data-bs-theme="light"] .profile-mobile-topbar .site-ann-bell-trigger:hover,
.profile-panel[data-bs-theme="light"] .profile-mobile-topbar .site-ann-bell-trigger.show {
    background: color-mix(in srgb, var(--C3, #08a379) 12%, #fff 88%);
    color: var(--C1, #294a41);
}

/* ── پروفایل: anchor مشترک dropdown اعلان ── */
.profile-ann-anchor--desktop {
    position: relative;
    z-index: 30;
}
.profile-ann-anchor--desktop .site-ann-bell {
    position: static;
}
.profile-ann-anchor--desktop .site-ann-bell-menu.dropdown-menu {
    position: absolute !important;
    top: calc(100% + 0.35rem) !important;
    inset-inline: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: none !important;
    margin: 0 !important;
    max-height: min(500px, calc(100vh - 8rem));
    z-index: 1055 !important;
}
/* پروفایل: سایه لیست اعلان — جدا شدن از محتوای زیر */
.profile-panel .site-ann-bell-menu.dropdown-menu {
    box-shadow:
        0 2px 4px rgba(5, 42, 20, 0.06),
        0 8px 20px -4px rgba(5, 42, 20, 0.14),
        0 18px 36px -6px rgba(5, 42, 20, 0.2),
        0 0 0 1px color-mix(in srgb, var(--C3, #08a379) 8%, var(--bs-border-color, #dee2e6) 92%);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-menu.dropdown-menu {
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.25),
        0 10px 24px -4px rgba(0, 0, 0, 0.45),
        0 22px 44px -8px rgba(0, 0, 0, 0.55),
        0 0 0 1px var(--C4, #1f3a2d);
}
.profile-ann-anchor--desktop .site-ann-bell-list {
    max-height: calc(500px - 7.5rem);
    overflow-y: auto;
}

/* زنگوله داخل باکس کاربر — دسکتاپ */
.profile-userbox-bell {
    flex-shrink: 0;
    align-self: center;
}
.profile-userbox-bell .site-ann-bell-trigger {
    padding: 0.45rem;
    border-radius: 0.65rem;
}
.profile-panel[data-bs-theme="dark"] .profile-userbox-bell .site-ann-bell-trigger:hover,
.profile-panel[data-bs-theme="dark"] .profile-userbox-bell .site-ann-bell-trigger.show {
    background: rgba(255, 255, 255, 0.08);
    color: var(--C6, #e5e7eb);
}
.profile-panel[data-bs-theme="light"] .profile-userbox-bell .site-ann-bell-trigger:hover,
.profile-panel[data-bs-theme="light"] .profile-userbox-bell .site-ann-bell-trigger.show {
    background: color-mix(in srgb, var(--C3, #08a379) 12%, #fff 88%);
    color: var(--C1, #294a41);
}
.profile-panel[data-bs-theme="dark"] .profile-userbox-bell .site-ann-bell-trigger {
    color: var(--C6, #e5e7eb);
}

.profile-panel[data-bs-theme="dark"] .site-ann-bell-more {
    background: color-mix(in srgb, var(--C2, #10261e) 60%, var(--C8, #0b1411) 40%);
    border-top-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-menu {
    background: var(--C8, #0b1411);
    border-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-head {
    background: color-mix(in srgb, var(--C2, #10261e) 80%, #000 20%);
    color: var(--C6, #e5e7eb);
    border-bottom-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-title { color: var(--C6, #e5e7eb); }
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-cat,
[data-bs-theme="dark"] .site-ann-bell-item-cat {
    color: var(--C5, #9ca3af);
    border-color: var(--C4, #1f3a2d);
    background: color-mix(in srgb, var(--C2, #10261e) 70%, transparent);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-mark {
    background: rgba(255, 255, 255, 0.04);
    border-color: color-mix(in srgb, var(--C3, #047b54) 40%, var(--C4, #1f3a2d) 60%);
    color: color-mix(in srgb, var(--C3, #08a379) 85%, #fff 15%);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-mark:hover {
    background: color-mix(in srgb, var(--C3, #047b54) 18%, var(--C8, #0b1411) 82%);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-read-label {
    color: var(--C5, #9ca3af);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item-actions {
    border-top-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .site-ann-bell-item--unread {
    background: color-mix(in srgb, var(--C3, #047b54) 14%, var(--C8, #0b1411) 86%);
}

@media (max-width: 991.98px) {
    .profile-mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
    }
    .profile-ann-anchor--mobile .site-ann-bell {
        position: static;
    }
    .profile-ann-anchor--mobile .site-ann-bell-menu.dropdown-menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 0 0 0.85rem 0.85rem !important;
        border-top: none;
        max-height: min(500px, calc(100dvh - 3.5rem));
        z-index: 1025 !important;
        box-shadow:
            0 6px 16px -2px rgba(5, 42, 20, 0.12),
            0 14px 32px -6px rgba(5, 42, 20, 0.2),
            0 24px 48px -10px rgba(5, 42, 20, 0.24);
    }
    .profile-panel[data-bs-theme="dark"] .profile-ann-anchor--mobile .site-ann-bell-menu.dropdown-menu {
        box-shadow:
            0 6px 18px -2px rgba(0, 0, 0, 0.35),
            0 16px 36px -6px rgba(0, 0, 0, 0.5),
            0 28px 52px -10px rgba(0, 0, 0, 0.58);
    }
    .profile-ann-anchor--mobile .site-ann-bell-list {
        max-height: min(400px, calc(100dvh - 9rem));
        overflow-y: auto;
    }
}

@media (max-width: 992px) and (orientation: landscape) {
    .profile-ann-anchor--mobile .site-ann-bell-menu.dropdown-menu {
        border-radius: 0 0 0 0.85rem !important;
    }
    .profile-page .profile-mobile-topbar {
        padding-right: calc(66px + 0.85rem);
    }
}

/* تاریخچه پروفایل */
.ann-history-card {
    border: 1px solid color-mix(in srgb, var(--C3, #08a379) 10%, var(--bs-border-color, #dee2e6) 90%);
    border-radius: 0.65rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.ann-history-card:hover {
    border-color: var(--C3, #08a379);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--C3, #08a379) 12%, transparent);
}
.ann-history-card--unread {
    border-inline-start: 3px solid var(--C3, #08a379);
}
.profile-panel[data-bs-theme="dark"] .ann-history-card {
    border-color: var(--C4, #1f3a2d);
}
.profile-panel[data-bs-theme="dark"] .ann-history-card--unread {
    border-inline-start-color: var(--C3, #08a379);
}
.ann-history-card .ann-badges-row .badge {
    font-weight: 600;
    font-size: 0.72rem;
}