/* --- Global Font & Direction --- */
.betasahm-bell-wrapper, .betasahm-center, .betasahm-follow-btn, #betasahm-toast-container {
    font-family: 'IranSansX', Tahoma, sans-serif !important;
    direction: rtl;
}

/* --- Follow Button --- */
.betasahm-follow-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-light);
    background: var(--card-white);
    color: var(--texts);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
}
.betasahm-follow-btn:hover {
    background: var(--inner-box-gray);
    transform: translateY(-1px);
}
.betasahm-follow-btn.following {
    background: var(--button-dark);
    color: #fff;
    border-color: var(--button-dark);
}
.betasahm-follow-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* --- Bell & Overlay --- */
.betasahm-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.betasahm-bell-icon {
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    outline: none;
}
.betasahm-bell-icon:hover, .betasahm-bell-icon:focus {
    background: var(--inner-box-gray);
}
.betasahm-bell-icon svg {
    stroke: var(--texts);
    transition: stroke 0.2s;
}
.betasahm-bell-icon:hover svg { stroke: var(--headings); }

.betasahm-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--text-danger); 
    color: #fff;
    border-radius: 50%;
    min-width: 18px; height: 18px;
    text-align: center; font-size: 10px; line-height: 18px;
    border: 2px solid var(--card-white);
    font-weight: bold;
}

/* Overlay / Backdrop */
.betasahm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.betasahm-overlay.active {
    display: block;
    opacity: 1;
}

/* --- Dropdown UI --- */
.betasahm-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 45px;
    width: 380px;
    background: var(--card-white);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 99999;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transform-origin: top left;
    animation: betasahm-slide-down 0.25s cubic-bezier(0, 0, 0.2, 1);
}
@keyframes betasahm-slide-down {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.betasahm-dropdown.active { display: block; }

.betasahm-drop-header {
    padding: 16px 20px;
    background: var(--inner-box-light-gray);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.betasahm-drop-header span {
    font-weight: 800;
    font-size: 15px;
    color: var(--headings);
}
.betasahm-mark-all { 
    font-size: 12px; 
    color: var(--button-dark); 
    text-decoration: none; 
    font-weight: 600;
    transition: opacity 0.2s;
}

.betasahm-close-drop {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--texts);
    border-radius: 50%;
    transition: background 0.2s;
}
.betasahm-close-drop:hover { background: var(--inner-box-gray); color: var(--headings); }
.betasahm-mark-all:hover { opacity: 0.8; }

.betasahm-drop-list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}
.betasahm-drop-list::-webkit-scrollbar { width: 4px; }
.betasahm-drop-list::-webkit-scrollbar-thumb { background-color: var(--border-light); border-radius: 10px; }

/* --- Notification Item Row --- */
.betasahm-notif-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--card-white);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    outline: none;
}
.betasahm-notif-item:hover, .betasahm-notif-item:focus { 
    background: var(--inner-box-gray); 
}
.betasahm-notif-item.unread { 
    background: var(--inside-white); 
}
.betasahm-notif-item.unread::before {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--button-dark);
}
.betasahm-notif-item.read { opacity: 0.8; }

.betasahm-notif-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--inner-box-gray);
    color: var(--texts);
}
.betasahm-notif-item.type-asset .betasahm-notif-icon { background: rgba(91, 156, 245, 0.1); color: var(--button-dark); }
.betasahm-notif-item.type-expiry .betasahm-notif-icon { background: var(--danger-tint); color: var(--text-danger); }
.betasahm-notif-item.type-system .betasahm-notif-icon { background: var(--inner-box-gray); color: var(--texts); }

.betasahm-notif-content { flex: 1; }
.betasahm-notif-title { 
    display: block; 
    font-size: 14px; 
    font-weight: 700; 
    margin-bottom: 4px; 
    color: var(--headings); 
    line-height: 1.4;
}
.betasahm-notif-body { 
    font-size: 13px; 
    color: var(--texts); 
    line-height: 1.6; 
    max-height: 42px; 
    overflow: hidden; 
    transition: max-height 0.3s;
}
.betasahm-notif-body.expanded { max-height: 1000px; }
.betasahm-notif-date { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.betasahm-cta-btn { 
    font-size: 11px; 
    padding: 6px 12px; 
    background: var(--inner-box-gray); 
    border: 1px solid var(--border-light); 
    border-radius: 6px; 
    color: var(--headings); 
    text-decoration: none; 
    white-space: nowrap; 
    font-weight: 600;
    transition: all 0.2s;
}
.betasahm-cta-btn:hover { background: var(--border-light); }

.betasahm-drop-footer {
    padding: 12px;
    text-align: center;
    background: var(--inner-box-light-gray);
    border-top: 1px solid var(--border-light);
}
.betasahm-drop-footer a {
    color: var(--texts);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.betasahm-drop-footer a:hover { color: var(--headings); }

/* --- Toast & Center --- */
#betasahm-toast-container { position: fixed; bottom: 30px; left: 30px; z-index: 100000; pointer-events: none; }
.betasahm-toast { 
    pointer-events: auto;
    background: var(--card-white); 
    color: var(--headings); 
    padding: 16px 20px; 
    border-radius: 12px; 
    margin-top: 12px; 
    width: 320px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    border-right: 4px solid var(--button-dark);
    opacity: 0; 
    transform: translateX(-30px); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.betasahm-toast.show { opacity: 1; transform: translateX(0); }
.betasahm-toast-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.betasahm-toast-body { font-size: 13px; color: var(--texts); line-height: 1.5; }

.empty-state, .tab-empty-msg { 
    text-align: center; 
    padding: 40px 20px; 
    color: var(--text-muted); 
    font-size: 14px; 
}
.betasahm-center { 
    max-width: 900px; 
    margin: 40px auto; 
    background: var(--card-white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.betasahm-tabs { 
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-light); 
    margin-bottom: 20px; 
    overflow-x: auto;
    padding-bottom: 2px;
}
.betasahm-tabs button { 
    background: none; 
    border: none; 
    padding: 12px 24px; 
    cursor: pointer; 
    font-family: inherit; 
    border-bottom: 3px solid transparent; 
    color: var(--text-muted); 
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}
.betasahm-tabs button.active { 
    border-bottom-color: var(--button-dark); 
    color: var(--button-dark); 
}
.betasahm-tabs button:hover:not(.active) { color: var(--texts); }

/* --- Responsive (Mobile Optimization) --- */
@media (max-width: 480px) {
    .betasahm-close-drop { display: block; }
    .betasahm-dropdown {
        position: fixed; 
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%; 
        height: 100%;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 99999;
        display: none;
        animation: betasahm-slide-up 0.3s ease-out;
    }
    @keyframes betasahm-slide-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .betasahm-dropdown.active { display: flex; flex-direction: column; }
    
    .betasahm-drop-list {
        flex: 1;
        max-height: none;
    }

    #betasahm-toast-container { left: 15px; right: 15px; bottom: 20px; }
    .betasahm-toast { width: 100%; }
}
