// Typography
// -------------------------
@rtl-font-family-sans-serif:  "Helvetica Neue", Helvetica, Arial, sans-serif;
@rtl-font-family-serif:       Georgia, "Times New Roman", Times, serif;
@rtl-font-family-base:        @rtl-font-family-sans-serif;

@rtl-headings-font-family:    @rtl-font-family-base;


body {
    direction: rtl;
    font-family: @rtl-font-family-base;
}

// Headings
// -------------------------

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: @rtl-headings-font-family;
}


// Tabs
// -------------------------

// Tabs
// -------------------------

// Give the tabs something to sit on
.nav-tabs {
  border-bottom: 1px solid @nav-tabs-border-color;
  > li {
    float: right;
    // Make the list-items overlay the bottom border
    margin-bottom: -1px;

    // Actual tabs (as links)
    > a {
      margin-right: -2px;
      border-radius: @border-radius-base @border-radius-base 0 0;
    }
  }
  // pulling this in mainly for less shorthand
  &.nav-justified {
    .nav-justified();
    .nav-tabs-justified();
  }
}

.nav-tabs-justified {

  > li > a {
    // Override margin from .nav-tabs
    margin-left: 0;
  }

  @media (min-width: @screen-sm-min) {
    > li > a {
      border-radius: @border-radius-base @border-radius-base 0 0;
      color:blue;
    }
  }
}


// progress-bar
// Bar of progress
.progress-bar {
  float: right;
}

// Alerts

// Dismissable alerts
//
// Expand the right padding and account for the close button's positioning.

.alert-dismissable {
 //padding-left: (@alert-padding + 20);

  // Adjust close link position
  .close {
    font-family: @font-family-base;
    top: -2px;
    left: 21px;
    right: 0px;
  }
}

//
// Close icons
// --------------------------------------------------

.close {
  font-family: @font-family-base;
  float: left;
}


//
// Dropdown menus
// --------------------------------------------------


// Dropdown arrow/caret
.caret {
  margin-right: 2px;
}

// The dropdown menu (ul)
.dropdown-menu {
  right: 0;
  float: left;
  left: auto;

  // Aligns the dropdown menu to left
  &.pull-left {
    left: 0;
    float: right;
    right: auto;
  }
}

// Left aligned dropdowns
.pull-left > .dropdown-menu {
  left: 0;
  float: right;
  right: auto;
}

// Right aligned menus need alt position
.navbar-nav.pull-left > li > .dropdown-menu,
.navbar-nav > li > .dropdown-menu.pull-left {
  right: auto;
  left: 0;
}

// Justified navbar

.nav-tabs-justified {

  > li > a {
    margin-left: 0;
  }

  @media (min-width: @screen-sm-min) {
    > li > a {
    }
  }
}

// Give the tabs something to sit on
.nav-tabs {
  > li {
    float: right;

    // Actual tabs (as links)
    > a {
      margin-left: 2px;
    }
  }
}


// Pills
// -------------------------
.nav-pills {
  > li {
    float: right;

    // Links rendered as pills
    > a {
      border-radius: @nav-pills-border-radius;
    }
    + li {
      margin-right: 2px;
      margin-left: 0px;
    }
  }
}


// Stacked pills
.nav-stacked {
  > li {
  float: none;
    + li {
      margin-right: 0; // no need for this gap between nav items
    }
  }
}

// Base nav class

.nav {
  padding-right: 0; // Override default ul/ol
}


// Justified nav links
// -------------------------

.nav-tabs.nav-justified,
.nav-pills.nav-justified {
  width: 100%;
  > li {
    float: none!important;
     > a {
      text-align: center;
      margin-bottom: 5px;
    }
  }

  > .dropdown .dropdown-menu {
    top: auto;
    left: auto;
  }

  @media (min-width: @screen-sm-min) {
    > li {
      display: table-cell;
      width: 1%;
      > a {
        margin-bottom: 0;
      }
    }
  }
}

.nav-tabs.nav-justified > li > a {
  color:@link-color;
}


// Reverse input group round corners in RTL

// Reset rounded corners
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
  .border-right-radius(@border-radius-base);
  .border-left-radius(0);
}
.input-group-addon:first-child {
  border-right: 1px solid @input-group-addon-border-color;
  border-left: 0px;
}

.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
  .border-left-radius(@border-radius-base);
  .border-right-radius(0);
}

.input-group-addon:last-child {
  border-left: 1px solid @input-group-addon-border-color;
  border-right: 0px;
}

// Button input groups
// -------------------------
.input-group-btn {
  // Negative margin to only have a 1px border between the two
  &:first-child > .btn {
    margin-left: -1px;
  }
  &:last-child > .btn {
    margin-right: -1px;
  }
}

.input-group-btn > .btn {
  position: relative;
  // Jankily prevent input button groups from wrapping
  + .btn {
    margin-right: -4px;
  }
  // Bring the "active" button to the front
  &:hover,
  &:active {
    z-index: 2;
  }
}

.radio,
.checkbox {
  padding-right: 20px;
}

.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
  float: right;
  margin-right: -20px;
}

.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
  margin-right: 10px; // space out consecutive inline controls
}

.form-inline {

    // Remove default margin on radios/checkboxes that were used for stacking, and
    // then undo the floating of radios and checkboxes to match (which also avoids
    // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
    .radio,
    .checkbox {
      padding-right: 0;
    }
    .radio input[type="radio"],
    .checkbox input[type="checkbox"] {
      margin-right: 0;
    }
}

// Horizontal forms
//
.form-horizontal {
  // Only right align form labels here when the columns stop stacking
  @media (min-width: @screen-sm-min) {
    .control-label {
      text-align: left;
    }
  }
}

// Popovers
// -------------------------
.popover.top,
.popover.bottom {
  direction:ltr
}

.popover.top .popover-title,
.popover.top .popover-content,
.popover.bottom .popover-title,
.popover.bottom .popover-content  {
  direction:rtl;
  text-align:right;
}

// Tables
// -----------------
th {
  text-align: right;
}

.list-group
{
  padding-right: 0;
}
