/* فونت وزیر برای کل افزونه */
.upf-container *,
.upf-classic-container *,
.user-private-files-wrapper *,
.upf-admin-wrap *,
.upfp_row *,
#upfp_container *,
.upfp-content * {
    font-family: Vazir, Tahoma, sans-serif !important;
}

/* راست‌چین کردن اصلی */
.upf-container,
.upf-classic-container,
.user-private-files-wrapper,
.upf-admin-wrap,
.upfp_row,
#upfp_container,
.upfp-content {
    direction: rtl !important;
    text-align: right !important;
}

/* تنظیمات فونت و خط */
.upf-container,
.upf-classic-container,
.upfp_row {
    font-family: Vazir, Tahoma, sans-serif;
    line-height: 1.8;
}

/* راست‌چین کردن ناوبری */
#upfp_nav ul li a {
    padding: 3px 40px 3px 0 !important;
    border-left: none !important;
    border-right: 3px solid transparent;
}

#upfp_nav ul li.upfp_li_active a {
    border-left: none !important;
    border-right: 3px solid #0071a1;
}

#upfp_nav ul li i {
    left: auto !important;
    right: 0;
    margin: 2px 15px 0 5px !important;
}

/* راست‌چین کردن بنر و ابزارها */
.upfp_banner,
.upfp_folder_banner {
    flex-direction: row-reverse;
}

.upfp_search_bar {
    margin-left: 0 !important;
    margin-right: auto;
}

.upfp_folder_tool {
    margin-left: 0 !important;
    margin-right: auto;
    flex-direction: row-reverse;
}

.upfp_folder_tool a {
    margin: 0 7px;
}

/* راست‌چین کردن محتوا */
.upfp_content {
    justify-content: flex-end;
}

/* راست‌چین کردن اطلاعات کاربر */
.upfp_user_info_panel {
    text-align: left !important;
    width: calc(100% - 80px);
}

.upfp_user_info_avtar {
    margin: 10px auto 5px 10px !important;
}

.upfp_storage_info {
    text-align: left !important;
}

/* راست‌چین کردن لیست دسترسی */
.upfp_file_access_list li,
.upfp_folder_access_list li {
    text-align: right;
}

.rmv-file-acs,
.rmv-fldr-acs {
    float: left !important;
}

.upfp_file_access_list li a {
    float: left !important;
    margin-right: 0 !important;
    margin-left: 10px;
}

/* راست‌چین کردن فرم‌ها */
.fill-dets,
#upvf-new-fldr,
#upf_allow_folder_access_frm,
#upf_allow_access_frm,
#upvf-rename-file,
#upvf-move-file,
#upvf-delete-file,
#upvf-delete-fldr,
#upvf-file-dsc,
#top_search_frm,
#upvf-rename-fldr,
#upvf-move-bulk-files {
    flex-direction: row-reverse;
}

.upfp-popup input,
.upfp-popup select {
    margin: auto 5px;
}

/* راست‌چین کردن دکمه‌ها */
.upf_inner .uploader button,
.upf_inner .fill-dets #submitFile,
.upfp-popup input:is([type="submit"]) {
    margin-left: 5px;
    margin-right: 0;
}

input#upvf-file-dlt-sbmt,
input#upvf-fldr-dlt-sbmt {
    margin-left: 0 !important;
    margin-right: auto;
}

/* راست‌چین کردن کامنت‌ها */
.upfp_file_comments img.avatar {
    float: right !important;
}

span.cmnt_usr_email {
    float: right !important;
    padding: 0px 5px;
}

span.cmnt_usr_cmnt {
    text-align: right;
    padding: 5px 10px;
}

/* راست‌چین کردن فیلترها */
.swm_fltr_frm #upfp_swm_fltr_box {
    float: right !important;
}

.swm_fltr_frm input[type="submit"],
.swm_fltr_frm button {
    float: right !important;
    margin: 0 1px;
}

.swm_fltr_frm button {
    margin-left: 10px !important;
    margin-right: 0 !important;
}

/* راست‌چین کردن پیش‌بارگذاری */
.upfp_pre_title {
    text-align: right;
}

/* راست‌چین کردن پاپ‌آپ‌ها */
.upvf-popup .closePopup,
.upfp-popup .closePopup,
.upfp-popup .close_edit_popup {
    right: auto !important;
    left: 0;
}

.upf_clsc_edit_pp .upf_clsc_popup_close_btn {
    right: auto !important;
    left: 0;
}

/* تنظیمات مارجین و پدینگ برای راست‌چین */
.upfp_file_info p {
    padding: 0 15px 0 5px !important;
}

.upfp_folder_info p#folder_name,
p.upfp_folder_shared_by {
    padding: 0 15px 0 0 !important;
}

/* راست‌چین کردن سوئیچ گروه‌بندی */
#grp_by:before {
    left: auto !important;
    right: 0;
}

#grp_by:checked:before {
    left: auto !important;
    right: 32px;
}

/* راست‌چین کردن آپلودر کلاسیک */
.uploaded-doc {
    float: right !important;
}

.fill-dets input {
    margin: 0 1.3%;
}

/* راست‌چین کردن ابزارهای سند در کلاسیک */
.doc_tool {
    text-align: right;
}

#upf_allowed_usr_sbmt {
    float: left !important;
}

#dlt-doc-file {
    float: right !important;
}

/* رسپانسیو برای موبایل */
@media only screen and (max-device-width: 767px) {
    .upfp_user_info {
        right: auto !important;
        left: 0;
        text-align: left;
    }
    
    a#upfp_newfolder_btn,
    a#upfp_upload_btn {
        float: right !important;
    }
    
    .upfp_folder_tool {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }
}

@media only screen and (max-width: 950px) {
    #upf_allowed_usr_sbmt {
        float: right !important;
    }
    
    #dlt-doc-file {
        float: left !important;
    }
}

/* رفع مشکل شرت کد و نمایش قاطی */
.user-private-files-wrapper,
.upf-shortcode-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* رفع مشکل اسکرول */
.upf-shortcode-container .upfp_content_wrapper {
    min-height: 500px !important;
    max-height: none !important;
    overflow: visible !important;
}

/* رفع مشکل نمایش در برگه */
.page .entry-content .user-private-files-wrapper,
.page .entry-content .upf-shortcode-container {
    float: none !important;
    clear: both !important;
}

/* رفع مشکل با تم‌های مختلف */
body .user-private-files-wrapper *,
body .upf-shortcode-container * {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* رفع مشکل با تم‌هایی که container دارند */
.container .user-private-files-wrapper,
.container .upf-shortcode-container,
.entry-content .user-private-files-wrapper,
.entry-content .upf-shortcode-container {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px !important;
}