/* RB Colors */

@light-yellow: #FFF47C;
@dark-yellow: #A89C00;
@light-grey: #EAEAEA;
@grey: #D0D0D0;
@light-blue: #C6DCF3;
@dark-blue: #3465A4;

@link-color: #0000C0;

@required-flag-color: darkred;

@btn-primary-color1: #7E9BC6;
@btn-primary-color2: darken(@btn-primary-color1, 20%);

@page-container-padding: 1em;

@headerbar-logo-padding-horiz: 6px;
@headerbar-logo-width: 60px;
@headerbar-padding-left: @headerbar-logo-width +
                         2 * @headerbar-logo-padding-horiz;
@headerbar-bg: #333333;
@headerbar-bg-active: #555555;
@headerbar-padding: 0.5em;
@headerbar-menu-min-width: 9em;

@navbar-bg: @light-blue;
@navbar-border-color: @dark-blue;
@navbar-text-color: #0000AA;

@box-border-color: #888A85;
@box-border-radius: 6px;
@box-inner-border-radius: @box-border-radius - 1px;
@box-title-bg: @light-blue;
@box-shadow: 1px 1px 2px rgba(0, 0, 0, .15);
@box-padding: 10px;
@box-bg: #FFFFFF;

@edit-icon-margin: 4px;

@draft-bg-color: #CDFF9C;
@draft-border-color: darken(@draft-bg-color, 50%);

@review-request-actions-bg: @review-request-action-primary-bg;
@review-request-actions-border-color:
  darken(@review-request-action-primary-bg, 40%);

@review-request-action-bg: #E5D7A8;
@review-request-action-border-color: @review-request-actions-border-color;
@review-request-action-active-bg: darken(@review-request-action-bg, 20%);
@review-request-action-hover-bg: darken(@review-request-action-bg, 12%);

@review-request-action-primary-bg: @review-request-action-bg;
@review-request-action-primary-active-bg: @review-request-action-active-bg;
@review-request-action-primary-hover-bg: @review-request-action-hover-bg;

@review-request-action-menu-border-color: @review-request-actions-border-color;
@review-request-action-menu-bg: @review-request-action-active-bg;
@review-request-action-menu-item-hover-bg: @review-request-action-hover-bg;

@review-request-label-color: #575012;
@review-request-link-color: #0000EE;

@review-request-warning-bg: #F5A9A9;
@review-request-warning-border-color: #FF0000;

@admin-sidebar-width: 22em;

@admin-msg-banner-bg: #FFC;
@admin-msg-banner-border-color: darken(@admin-msg-banner-bg, 50%);

@issue-opened-bg: #fff49C;
@issue-opened-border-color: darken(@issue-opened-bg, 40%);
@issue-opened-link-color: darken(@issue-opened-bg, 60%);
@issue-discarded-bg: #ECECEC;
@issue-discarded-border-color: darken(@issue-discarded-bg, 20%);
@issue-discarded-link-color: darken(@issue-discarded-bg, 60%);
@issue-resolved-bg: #FAFAFA;
@issue-resolved-border-color: darken(@issue-resolved-bg, 10%);
@issue-resolved-link-color: darken(@issue-resolved-bg, 60%);

/*
 * At least on Chrome, using points instead of pixels does not reliably
 * result in identical sizings when there are elements positioned inside
 * a <pre>. Pixels fixes this.
 */
@textarea-font-size: 13px;
@textarea-font-family: monospace;
@textarea-line-height: (@textarea-font-size + 2px);
@textarea-border-color: #b8b5a0;
@textarea-border: 1px #b8b5a0 solid;
@textarea-editor-background: white;
@textarea-editor-margin: 5px 0 0 0;
@textarea-editor-padding: 10px;

@z-index-base: 1;
@z-index-deco: 20;
@z-index-event-overlay: 30;
@z-index-filter-overlay: 40;
@z-index-banner: 90;
@z-index-dialog: 100;
@z-index-diff-collapse-btn: 100;
@z-index-menu: 110;
@z-index-page-overlay: 130;
@z-index-spinner: 140;

// Icon dimensions
@rb-icon-edit-width: 20px;

// Comment flags
@comment-flag-color: #a1c0e3;
@comment-flag-hover-color: #a5caf3;
@comment-flag-border-color: #204a87;
@comment-flag-border-radius: 4px;

@comment-flag-draft-color: #aceb6f;
@comment-flag-draft-hover-color: #b6f37c;
@comment-flag-draft-border-color: #3e7b01;

@comment-flag-ghost-color: #eeeeec;
@comment-flag-ghost-border-color: #888a85;


/* Diff styles */
@diff-file-color: #F0F0F0;
@diff-border-color: #A0A0A0;
@diff-file-border-color: darken(@diff-file-color, 15%);
@diff-line-border-color: #D0D0D0;
@diff-error-color: #FFF6A6;
@diff-error-border-color: darken(#FFF6A6, 35%);

// Diff headers
@diff-header-color: #e4d9cb;

// Moved line information
@diff-moved-from-bg-color: #b0d0ff;
@diff-moved-to-bg-color: darken(@diff-moved-from-bg-color, 3%);

// Equals lines
@diff-linenum-color: #F0F0F0;
@diff-selected-color: #E2E2E2;

// Delete lines
@diff-delete-color: #ffe0e5;
@diff-delete-border-color: desaturate(darken(@diff-delete-color, 7%), 55%);
@diff-delete-linenum-color: desaturate(darken(@diff-delete-color, 5%), 35%);
@diff-delete-linenum-border-color:
  desaturate(darken(@diff-delete-linenum-color, 7%), 55%);
@diff-delete-selected-color: darken(@diff-delete-linenum-color, 4%);
@diff-delete-dot-color: desaturate(darken(@diff-delete-color, 30%), 35%);

// Insert lines
@diff-insert-color: #dfffd7;
@diff-insert-border-color: desaturate(darken(@diff-insert-color, 7%), 55%);
@diff-insert-linenum-color: desaturate(darken(@diff-insert-color, 7%), 35%);
@diff-insert-linenum-border-color:
  desaturate(darken(@diff-insert-linenum-color, 7%), 35%);
@diff-insert-selected-color: darken(@diff-insert-linenum-color, 5%);
@diff-insert-dot-color: desaturate(darken(@diff-insert-color, 35%), 35%);

// Replace lines
@diff-replace-color: #fdfecc;
@diff-replace-border-color: desaturate(darken(@diff-replace-color, 20%), 30%);
@diff-replace-linenum-color: desaturate(darken(@diff-replace-color, 7%), 25%);
@diff-replace-linenum-border-color:
  desaturate(darken(@diff-replace-linenum-color, 10%), 30%);
@diff-replace-selected-color: darken(@diff-replace-linenum-color, 10%);
@diff-replace-dot-color: darken(@diff-replace-color, 50%);

// Diff line counts
@diff-insert-line-count-color: darkgreen;
@diff-delete-line-count-color: darkred;

// Revisions selector
@revisions-border-color: #999999;
@revisions-hover-color: #E7E0A2;
@revisions-hover-border-color: #003366;
@revisions-text-color: black;

// Pagination
@paginate-border-color: #DDDDDD;
@paginate-bg-color: #417690;
@paginate-text-color: #f4f379;

// Binary Files
@inline-actions-bg: darken(@diff-file-color, 3%);
@inline-actions-hover-bg: darken(@inline-actions-bg, 5%);

// Dashboard
@dashboard-sidebar-bg: #E9E9E9;
@dashboard-sidebar-horiz-padding: 0.8em;
@dashboard-sidebar-vert-padding: 0.4em;
@dashboard-sidebar-item-vert-padding: 6px;
@dashboard-sidebar-section-vert-padding: 8px;
@dashboard-sidebar-active-bg: darken(@dashboard-sidebar-bg, 5%);
@dashboard-sidebar-count-border-radius: 2 * @box-border-radius;
@dashboard-sidebar-count-bg: lighten(@dashboard-sidebar-bg, 15%);
@dashboard-sidebar-count-border-color: darken(@dashboard-sidebar-bg, 10%);
@dashboard-sidebar-count-zero-bg: lighten(@dashboard-sidebar-bg, 3%);
@dashboard-sidebar-count-zero-border-color: darken(@dashboard-sidebar-bg, 5%);
@dashboard-sidebar-count-vert-padding: 0px;
@dashboard-sidebar-count-horiz-padding: 8px;


.border-radius (...) {
  -moz-border-radius: @arguments;
  -webkit-border-radius: @arguments;
  border-radius: @arguments;
}

.box-shadow (...) {
  -moz-box-shadow: @arguments;
  -webkit-box-shadow: @arguments;
  box-shadow: @arguments;
}

.box-sizing (...) {
  -moz-box-sizing: @arguments;
  -webkit-box-sizing: @arguments;
  box-sizing: @arguments;
}

.opacity (@value) {
  opacity: @value / 100;
  filter:alpha(opacity=@value);
  -moz-opacity: @value / 100;
}

.transition(@transition) {
  -webkit-transition: @transition;
     -moz-transition: @transition;
          transition: @transition;
}

.pre-wrap () {
  white-space: pre-wrap;      /* CSS 3 */
  white-space: -moz-pre-wrap; /* Mozilla, 1999+ */
  white-space: -pre-wrap;     /* Opera 4-6 */
  white-space: -o-pre-wrap;   /* Opera 7 */
  word-wrap: break-word;      /* IE 5.5+ */
}

.unselectable() {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -moz-user-select: -moz-none;
  -ms-user-select: none;
  user-select: none;

  /* These must be defined as two rules, or Firefox will drop them both. */
  &::selection {
    background: transparent;
  }

  &::-moz-selection {
    background: transparent;
  }
}

.ellipsize() {
  /* Ellipsize the text contents. */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

// Reset filters for IE
.reset-filter() {
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}

// Gradient Bar Colors for buttons and allerts
.gradientBar(@primaryColor, @secondaryColor) {
  #gradient > .vertical(@primaryColor, @secondaryColor);
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
}

#gradient {
  .horizontal (@startColor: #555, @endColor: #333) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: -khtml-gradient(linear, left top, right top, from(@startColor), to(@endColor)); // Konqueror
    background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
    background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10
    background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
    background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
    background-image: linear-gradient(left, @startColor, @endColor); // Le standard
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down
  }
  .vertical (@startColor: #555, @endColor: #333) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); // Konqueror
    background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
    background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
    background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
    background-image: linear-gradient(top, @startColor, @endColor); // The standard
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down
  }
  .directional (@startColor: #555, @endColor: #333, @deg: 45deg) {
    background-color: @endColor;
    background-repeat: repeat-x;
    background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
    background-image: -ms-linear-gradient(@deg, @startColor, @endColor); // IE10
    background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
    background-image: linear-gradient(@deg, @startColor, @endColor); // The standard
  }
  .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
    background-color: @endColor;
    background-repeat: no-repeat;
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
    background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
    background-image: -ms-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down, gets no color-stop at all for proper fallback
  }
}


.user-select(@arg) {
  user-select: @arg;
  -moz-user-select: @arg;
  -ms-user-select: @arg;
  -webkit-user-select: @arg;
}


// CSS3 cursors
.grab-cursor() {
  cursor: grab;
  cursor: -moz-grab;
  cursor: -webkit-grab;
}

.grabbing-cursor-important() {
  /*
   * XXX: We should be able in instantiate mixins with !important but for some
   * reason it's not working for me.
   */
  cursor: grabbing !important;
  cursor: -moz-grabbing !important;
  cursor: -webkit-grabbing !important;
}


/* !(*%!(&^ (see http://www.positioniseverything.net/easyclearing.html) */
.clearfix {
  display: inline-block;

  &:after {
    clear: both;
    content: ".";
    display: block;
    height: 0;
    visibility: hidden;
  }
}

/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */


// vim: set et ts=2 sw=2:
