/*
 * In the name of God
 *
 * Copyright (c) 2023 Bonyan Ltd at bonyan.co>
 */

html {
    direction: rtl;
}

/* fix direction bug in print dialog*/
@media print{
    html {
        direction: ltr;
    }
}

#wrapper3 {
    direction: rtl
}

/***** Layout *****/
#top-menu {
    padding-left: 2px;
    padding-right: 6px;
}

#top-menu li {
    float: right;
}

#top-menu #loggedas {
    float: left;
}

#account {
    float: left;
}

#header h1:before {
    content: "\ea28\200f"
}

#header h1 .breadcrumbs .separator:after {
    -ms-transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    transform: rotate(270deg);
}

#quick-search {
    float: left;
}

#quick-search #q {
    padding-left: 2.5em;
    padding-right: 1em;
}

#quick-search #q:-moz-placeholder {
    direction: rtl;
}

#quick-search #q:-ms-input-placeholder {
    direction: rtl;
}

#quick-search #q::-webkit-input-placeholder {
    direction: rtl;
}

#main-menu li {
    float: right;
}

#sidebar .contextual {
    float: left;
}

* html #content {
    padding-right: 0;
}

#login-form input[type="text"],
#login-form input[type="password"] {
    padding-right: 5em;
    padding-left: 1.5em;
}

#login-form {
    background: var(--pg-purple) url('../images/login.png') no-repeat calc(100% - 4em) 3em;
}

#login-form a.lost_password {
    float: left;
}

#login-form label[for=autologin] {
    float: right;
}

p.buttons a.icon {
    padding: .3em 1em .2em 2em !important;
}

/***** Links *****/
a.collapsible.collapsed {
    background: none;
}

a.collapsible.collapsed:before {
    -ms-transform: rotate(270deg);
    -webkit-transform: rotate(270deg);
    transform: rotate(270deg);
}

/***** Tables *****/
tr.project.idnt td.name:before {
    -ms-transform: rotate(-90deg); /* IE 9 */
    -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */
    transform: rotate(-90deg);
}

tr.issue td.subject, tr.issue td.relations {
    text-align: right;
}

tr.issue td.tags{
    text-align: right !important;
}

/*tr.issue.idnt td.subject a { background: url(/images/bullet_arrow_left.png) no-repeat 100% 50%; padding-right: 16px; padding-left: 0; }*/
tr.issue.idnt td.subject a:before {
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

tr.entry td.size, tr.entry td.age, tr.entry td.author {
    direction: rtl
}

tr.entry td.comments {
    text-align: left;
}

tr.entry td.age {
    text-align: left;
}

tr span.expander {
    background: no-repeat center center;
    padding-left: 0;
    margin-right: 0
}

table.files tbody th {
    text-align: right;
}

table.files tr.file td.filename {
    text-align: right;
    padding-left: 0;
    padding-right: 24px;
}

tr.message td.subject {
    padding-left: 0;
    padding-right: 20px;
}

tr.message.locked td.subject {
    background-position: 100% 1px;
}

tr.message.sticky td.subject {
    background-position: 100% 1px;
}

tr.version td.name {
    padding-left: 0;
    padding-right: 20px;
}

tr.version.shared td.name {
    background-position: 100% 70%;
}

tr.user td.username, tr.user td.firstname, tr.user td.lastname {
    text-align: right;
}

tr.user td.username .gravatar {
    float: right;
}

tr.user td.email {
    direction: ltr;
}

tr.time-entry td.issue, tr.time-entry td.comments {
    text-align: right;
}

td.hours {
    text-align: left;
    padding-right: 0;
    padding-left: 0.5em;
}

table.plugins {
    direction: ltr
}

table.plugins td.configure {
    text-align: center;
}

table.plugins td.name {
    text-align: left;
}

tr.group span.name:after {
    content: "\200f";
}

tr.group span.name:before {
    content: "\200f";
}

table.attributes th {
    text-align: right;
}

table.boards td.last-message {
    text-align: right;
}

table.messages td.last_message {
    text-align: right;
}

h3.version, div.issues h3, div.members h3, div.news h3, div.projects h3 {
    /*background-position: 100% 50%;*/
}

div.issue div.subject h3 {
    border-right: 5px solid var(--pg-issue-title-border);
    border-left: 2px solid var(--pg-issue-bg);
    padding: .4em 1em .6em;
}

div.details div.subject a.parent {
    padding-right: 1em;
    padding-left: unset;
}

#watchers li {
    margin: 0 0 0 2px;
    padding: 0 0 0 0;
}

#watchers img.gravatar {
    margin: 0 0 2px 4px;
}
span.search_for_watchers {
    float: left;
}
span.search_for_watchers a, span.add_attachment a {
    padding-right: 16px;
    padding-left: 0;
    background-position: 100% 50%;
}

#attachments_form {
    padding-left: 2em;
}

div.square {
    float: right;
}

.contextual {
    float: left;
}

.controller-issues.action-show #content > .contextual {
    float: left;
}

#issue_is_private_wrap {
    float: left;
}

div#issue-changesets {
    float: left;
}

.journal ul.details img {
    margin: 0 4px -3px 0;
}

div#search-results-counts {
    float: left;
}

div#search-results-counts li {
    float: right;
}

div#version-summary {
    float: left;
}

#projects-index ul.projects .header {
    padding: .5em .75em .5em .2em
}

.grouped_attr.collapsed:before,
fieldset.collapsible.collapsed > legend:before {
    -ms-transform: rotate(270deg); /* IE 9 */
    -webkit-transform: rotate(270deg); /* Chrome, Safari, Opera */
    transform: rotate(270deg);
}

.attachments_fields input.filename,
#existing-attachments .filename{
    background-position: 100% 50%;
    margin-left: .5em;
    margin-right: unset;
}

.attachments_fields .ajax-waiting input.filename {
    background-position: 100% 50%;
}

.attachments_fields .ajax-loading input.filename {
    background-position: 100% 50%;
}

input.autocomplete.ajax-loading {
    background-position: .5em center;
}

input.autocomplete {
    padding: .5em 1em .5em 2.5em;
    background-position-x: .5em;
}

a.remove-upload {
    background-position: 100% 50%;
}

p.other-formats {
    float: left;
}

a.atom {
    background-position: 100% 50%;
    padding: 2px 16px 3px 0;
}

/***** Ajax indicator ******/
#ajax-indicator {
    direction: rtl;
}

#ajax-indicator span {
    background-position: 100% 40%;
}

/***** Calendar *****/
table.cal td.nwday:not(.odd):before,
table.cal td.holiday:not(.odd):before {
    float: right;
}

/***** Tooltips ******/
div.tooltip:hover span.tip {
    left: unset;
    right: 24px;
    direction: rtl;
}

/***** Progress bar *****/
table.progress {
    float: right;
    margin: 1px 0 1px 6px;
}

p.progress-info {
    clear: right;
}

/***** Tabs *****/
#content .tabs ul li {
    float: right;
}

div.tabs-buttons {
    right: unset;
    left: 0;
}

button.tab-left {
    right: unset;
    left: 20px;
    border-top-left-radius: unset;
    border-top-right-radius: 3px;
}

button.tab-right {
    right: unset;
    left: 0;
    border-top-right-radius: unset;
    border-top-left-radius: 3px;
}

button.tab-left:before {
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    transform: rotate(90deg);
}

button.tab-right:before {
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

/***** Wiki *****/
div.wiki pre {
    direction: ltr;
    margin: 1em 1.6em 1em 1em;
}

div.wiki ul.toc.right {
    float: left;
}

div.wiki ul.toc.left {
    float: right;
}

[lang="fa"] .wiki ol > li{
    list-style-type: persian;
}

/***** Gantt chart *****/
.version.marker {
    margin-left: 0;
    margin-right: -4px;
}

.project.marker {
    margin-left: 0;
    margin-right: -4px;
}

/***** Icons *****/
.icon {
    background-position: 100% 50%;
}

.icon-user:before {
    content: "\e9de\200f";
}

.icon-checked:before {
    content: "\e9c3\200f";
}

div.issue img.gravatar {
    float: right;
    margin: 0 0 0 6px;
}

div.gravatar-with-child > img.gravatar:nth-child(2) {
    left: unset;
    right: 30px;
}

div.issue table img.gravatar {
    float: right;
    margin: 0 0 0 0.5em;
}

h2 img.gravatar {
    margin: -2px 0 -4px 4px;
}

h3 img.gravatar {
    margin: -4px 0 -4px 4px;
}

h4 img.gravatar {
    margin: -6px 0 -4px 4px;
}

td.username img.gravatar {
    margin: 0 0 0 0.5em;
}

#activity dt img.gravatar {
    float: right;
}

/* Used on 12px Gravatar img tags without the icon background */
.icon-gravatar {
    float: right;
}

#activity dt, .journal {
    clear: right;
}

.journal-link {
    float: left;
}

/* Custom JQuery styles */
.ui-dialog .ui-dialog-titlebar-close {
    right: unset;
    left: .5em;
}
/* Accessibility specific styles */
.hidden-for-sighted {
    left: auto;
    right: -10000px;
}

table.query-columns td {
    direction: rtl;
}

.query-columns .buttons .move-left,
.query-columns .buttons .move-right {
    transform: scaleX(-1);
}

table.progress td.closed, table.progress td.done, table.progress td.todo {
    background-position: 100%;
}

select {
    background-position: 12px 50%;
    padding: .3em 1em .3em 2.5em;
}


.controller-repositories div.autoscroll form input {
    float: right;
}

.controller-repositories.action-committers table.list th:first-child,
.controller-repositories.action-committers .table-list th:first-child {
    border-radius: 0 8px 0 0;
    -moz-border-radius: 0 8px 0 0;
    -webkit-border-radius: 0 8px 0 0;
}

.controller-repositories.action-committers table.list th:last-child,
.controller-repositories.action-committers .table-list th:last-child {
    border-radius: 8px 0 0 0;
    -moz-border-radius: 8px 0 0 0;
    -webkit-border-radius: 8px 0 0 0;
}

.controller-repositories.action-committers tbody td:first-child {
    direction: ltr
}


tr.changeset td.comments {
    text-align: left;
}

tr.changeset td.committed_on, tr.changeset td.author {
    direction: rtl;
    text-align: center;
}

.enabled_scm table {
    direction: ltr;
    text-align: left
}

.gantt-table .gantt_subjects {
    direction: rtl;
}

.gantt_content .pagination ul.pages,
#settings_per_page_options,
#settings_search_results_per_page,
#settings_attachment_max_size,
#settings_bulk_download_max_size,
#project_homepage,
#project_identifier,
#version_wiki_page_title,
#user_login,
#wiki_start_page,
#repository_identifier,
#settings_activity_days_default,
table.query-columns,
input[type="password"],
input#username,
.filecontent,
table.entries,
table.changesets,
.controller-repositories div.autoscroll,
div.changeset div.wiki,
div.changeset-changes,
div.box pre,
#settings_default_language, #user_language,
#settings_host_name,
#settings_repositories_encodings,
#settings_mail_from,
#branch, #tag, #rev,
#pref_time_zone,
#user_mail,
#email_address_address,
#custom_field_url_pattern,
#auth_source_form input[type='text'],
#time_entry_hours,
#issue_estimated_hours,
#footer,
.gantt-table,
#settings_mail_handler_body_delimiters,
#settings_mail_handler_excluded_filenames,
#settings_commit_ref_keywords,
#settings_commit_update_keywords_keywords_,
#pref_recently_used_projects,
#settings_attachment_extensions_denied,
#settings_attachment_extensions_allowed,
#settings_password_min_length,
#settings_timelog_max_hours_per_day,
#custom_field_min_length,
#custom_field_max_length,
#custom_field_regexp,
#custom_field_extensions_allowed,
input[type="text"]#custom_field_default_value,
#commit-keywords input[name="settings[commit_update_keywords][keywords][]"],
#settings_max_additional_emails,
input.int_cf,
input.float_cf,
input.link_cf,
#settings_feeds_limit,
#settings_file_max_size_displayed,
#settings_diff_max_lines_displayed,
#settings_thumbnails_size,
#settings_issues_export_limit,
#settings_gantt_items_limit,
#settings_gantt_months_limit,
#settings_mail_handler_api_key,
#settings_sys_api_key,
#settings_repository_log_display_limit,
#settings_protocol,
#settings_text_formatting,
#settings_wiki_compression,
#settings_ui_theme,
#settings_gravatar_default,
#values_estimated_hours_1,
#values_done_ratio_1,
#values_relates,
#values_duplicates,
#values_duplicated,
#values_blocks,
#values_blocked,
#values_precedes,
#values_follows,
#values_copied_to,
#values_copied_from,
.action-lost_password #mail {
    direction: ltr
}
.int_cf >.value,
.float_cf >.value{
    direction: ltr;
    text-align: end;
}
#pref_time_zone,
#settings_ui_theme,
#settings_default_language,
#user_language,
#settings_protocol,
#settings_text_formatting,
#settings_wiki_compression,
#settings_ui_theme,
#settings_gravatar_default {
    background-position: calc(100% - 12px) 50%;
    padding: .3em 2.5em .3em 1em;
}

#time_entry_issue_id {
    direction: ltr;
    padding-right: unset !important;
    padding-left: 2em !important;
}

div.issue .attribute .label {
    float: right !important;
    text-align: left;
}

#project-jump.drdn {
    float: left;
}

.drdn-content {
    left: 0;
    right: unset;
}

#projects-index ul.projects .header .expander:before {
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

.ui-datepicker .ui-datepicker-next {
    top: 0;
    right: unset;
}

input.hasDatepicker {
    text-align: right;
    padding-left: 2em !important;
    padding-right: 1em !important;
}

table.list th:first-child,
.table-list th:first-child {
    border-radius: 0 8px 0 0;
    -moz-border-radius: 0 8px 0 0;
    -webkit-border-radius: 0 8px 0 0;
}

table.list th:last-child,
.table-list th:last-child {
    border-radius: 8px 0 0 0;
    -moz-border-radius: 8px 0 0 0;
    -webkit-border-radius: 8px 0 0 0;
}

.add-filter label {
    margin: .8em 1.7em 0 -10em;
    float: right;
}

.rdb-menu-active .rdb-container-right, .rdb-container-right.rdb-visible {
    left: unset !important;
}

span.checklist-item.show .checklist-subject:after {
    content: "\200f";
}

@media screen and (max-width: 899px) {
    .flyout-is-active .flyout-menu {
        right: 0;
        left: unset;
        -webkit-transition: right .5s;
        -moz-transition: right .5s;
        -o-transition: right .5s;
        transition: right .5s;
    }

    .flyout-menu {
        left: unset;
        right: -250px;
        -webkit-transition: right .5s;
        -moz-transition: right .5s;
        -o-transition: right .5s;
        transition: right .5s;
    }

    .flyout-is-active .flyout-menu {
        right: 0;
        -webkit-transition: right .5s;
        -moz-transition: right .5s;
        -o-transition: right .5s;
        transition: right .5s;
    }

    .flyout-is-active #wrapper,
    .flyout-is-active #header {
        /*right: 250px*/
    }

    .mobile-toggle-button {
        float: right;
    }

    #project-jump.drdn {
        padding: 5px 72px 5px 20px;
    }

    .search-magnifier--flyout {
        right: unset;
        left: .5em;
    }

    .flyout-menu__search input[type='text'] {
        padding: .5em 1em .5em 2.5em;
    }

    #wrapper {
        right: 0;
        transition: right .5s;
    }

    #header {
        right: 0;
        transition: right .5s;
    }

    #issue_tree .issue > td:not(.checkbox),
    #relations .issue > td:not(.checkbox) {
/*      display: block;
        float: right;
        text-align: right;
        padding-left: 5px;
        padding-right: unset;*/
    }

    tr.issue td.done_ratio {
        width: 100% !important;
    }

    tr.issue td.done_ratio table.progress {
        max-width: 100%;
    }

    .tabular input[type="checkbox"] {
        /*float: right;*/
    }

    .flyout-menu .query::before {
        content: "\e94d\200f";
    }

    #project-jump .drdn-trigger:before {
        -ms-transform: rotate(270deg);
        -webkit-transform: rotate(270deg);
        transform: rotate(270deg);
    }

}

#context-menu.reverse-xx li.folder ul {
    right: auto;
    left: 180px;
}

#context-menu.reverse-xx li.folder > ul {
    left: 180px;
}

.select2-container--default{
    direction: rtl;
}
.float-start{
    float: right;
}
.float-end{
    float: left;
}
