@import "defs.less";


body {
  background-color: white;
  color: black;
  font-family: Verdana, Arial, Helvetica, Sans-Serif;
  font-size: 8pt;
  margin: 0;
  padding: 0;
}

form th {
  text-align: right;
  vertical-align: top;
}

h1 {
  font-size: 10pt;
}

h3 {
  margin-top: 2em;
}

img {
  border: 0;
}

label.required:after {
  content: ' *';
  font-weight: bold;
  font-size: 10px;
  color: @required-flag-color;
}

pre, textarea, .CodeMirror, .editable.field-text-area {
  font-size: @textarea-font-size;
  font-family: @textarea-font-family;
  line-height: @textarea-line-height;
}

span {
  &.label-draft {
    color: #008000;
  }

  &.label-submitted {
    color: #b7a93e;
  }

  &.label-discarded {
    color: #fe5757;
  }
}

td.help {
  font-size: 10px;
  color: #333;
  padding-top: 0;
}

textarea {
  resize: none;
}

ul.errorlist {
  color: #DD0000;
  display: inline;
  font-weight: bold;
  margin: 0 0 0 15px;
  padding: 4px 8px;

  li {
    display: inline;
  }
}

.loading img {
  margin-right: 4px;
  vertical-align: text-bottom;
}


/****************************************************************************
 * Buttons
 ****************************************************************************/

.btn,
input[type="button"],
input[type="submit"] {
  // Button Base
  cursor: pointer;
  display: inline-block;
  #gradient > .vertical-three-colors(#ffffff, #ffffff, 25%, darken(#ffffff, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
  padding: 3px 8px;
  text-shadow: 0 1px 1px rgba(255,255,255,.75);
  color: #333;
  font-size: 13px;
  line-height: normal;
  border: 1px solid #ccc;
  border-bottom-color: #bbb;
  .border-radius(4px);
  .box-shadow(inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05));

  &:hover {
    background-position: 0 -15px;
    color: #333;
    text-decoration: none;
  }

  // Primary Button Type
  &.primary, &.default {
    color: white;
    text-shadow: none;

    .gradientBar(@btn-primary-color1, @btn-primary-color2);
  }

  // Transitions
  .transition(.1s linear all);

  // Active and Disabled states
  &:active {
    .box-shadow(inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05));
  }

  &.disabled {
    cursor: default;
    background-image: none;
    .reset-filter();
    .opacity(65);
    .box-shadow(none);
  }

  &[disabled] {
    // disabled pseudo can't be included with .disabled
    // def because IE8 and below will drop it ;_;
    cursor: default;
    background-image: none;
    .reset-filter();
    .opacity(65);
    .box-shadow(none);
  }

  // Button Sizes
  &.large {
    font-size: 130%;
    line-height: normal;
    padding: 9px 14px 9px;
    .border-radius(6px);
  }

  &.small {
    padding: 7px 9px 7px;
    font-size: 11px;
  }

  &.danger {
    color: white !important;
    .gradientBar(#ee5f5b, #c43c35);
  }
}


// Help Firefox not be a jerk about adding extra padding to buttons
button.btn,
input[type=submit].btn {
  &::-moz-focus-inner {
    padding: 0;
    border: 0;
  }
}


/****************************************************************************
 * Banners
 ****************************************************************************/
.banner {
  background: @draft-bg-color;
  border: 1px @draft-border-color solid;
  margin-bottom: 10px;
  padding: 8px 10px;
  z-index: @z-index-banner;

  &>h1 {
    display: inline;
    margin-right: 0.2em;
    padding: 0;
  }

  &>input {
    margin-left: 10px;
  }
}


/****************************************************************************
 * Box classes
 ****************************************************************************/
.box, .modalbox {
  background-color: @box-bg;
  background-image: url('../images/box_top_bg.png');
  background-position: top left;
  background-repeat: repeat-x;
  border: 1px @box-border-color solid;
  .border-radius(@box-border-radius);
  .box-shadow(@box-shadow);
}

.box.important {
  background-color: #fdf2a0;
  background-image: url('../images/gold_box_top_bg.png');
  border: 1px #b7a93e solid;
  padding: 0 10px;

  .box-inner {
    background: url("../images/important.png") no-repeat top left;
    padding: 0 0 0 50px;
  }
}

.box.tip {
  background-color: #fdf2a0;
  background-image: url('../images/gold_box_top_bg.png');
  border: 1px #b7a93e solid;
  padding: 0 10px;

  .box-inner {
    background: transparent;
  }

  h1 {
    padding-left: 0;
  }
}

.box.yay {
  background-color: #fdf2a0;
  background-image: url('../images/gold_box_top_bg.png');
  border: 1px #b7a93e solid;
  padding: 0 10px;

  .box-inner {
    background: transparent;
    position: relative;
  }

  h1 {
    padding-left: 2.5em;
  }

  img {
    float: left;
    left: -5px;
    margin: 0;
    padding: 0;
    position: absolute;
    top: -20px;
  }
}

.box .star {
  cursor: pointer;
}

.admin h1.title,
.box-head,
.modalbox-title {
  background: @box-title-bg;
  border-bottom: 1px #728eac solid;
  margin: 0;
  padding: 0.4em 0.6em;
  .border-radius(@box-border-radius @box-border-radius 0 0);
}

.box-title,
.modalbox-title {
  font-size: 120%;
}

.box-title {
  margin: 0;
  padding: 0;
}

.box-main {
  padding: 5px;
}

.box-container {
  margin-bottom: 10px;
  width: 100%;
}

.box-inner,
.modalbox-inner {
  background-image: url('../images/box_bottom_bg.png');
  background-position: bottom left;
  background-repeat: repeat-x;
  .border-radius(@box-border-radius);

  padding-bottom: 1px\9; /* IE wants this. The \9 targets IE 7,8,9. */
}

.box-inner form {
  margin: 0;
}

.modalbox, .modalbox-bg {
  z-index: @z-index-dialog;
}

.datagrid-title,
.datagrid-titlebox {
  background: @box-title-bg !important;
  .border-radius(@box-border-radius @box-border-radius 0 0);
}

.datagrid-main {
  .border-radius(@box-border-radius);
}

.datagrid-header {
  border-top: 0 !important;

  &:last-child {
    border-right: 0;
  }
}

.datagrid-menu {
  border: 1px #888A85 solid;
}

.datagrid {
  tr:last-child {
    td:first-child {
      .border-radius(0 0 0 @box-border-radius);
    }

    td:last-child {
      .border-radius(0 0 @box-border-radius 0);
    }
  }

  td:last-child {
    border-right: 0;
  }

  .issue-count,
  .shipit-count {
    display: inline-block;
    font-weight: bold;
    padding: 0.05em 0.8em;
    white-space: nowrap;
    .border-radius(10px);
  }

  .issue-count {
    border: 1px darken(@issue-opened-bg, 50%) solid;
    color: #205003;
    #gradient > .vertical-three-colors(@issue-opened-bg, @issue-opened-bg, 25%,
                                       darken(@issue-opened-bg, 30%));

    .issue-icon {
      color: darken(@issue-opened-bg, 60%);
      display: inline-block;
      padding: 0 3px 0 1px;
      text-align: center;
    }
  }

  .shipit-count {
    background-image: url("../images/shipit_bg.png");
    background-position: top left;
    background-repeat: repeat-x;
    background-color: #6bc810;
    border: 1px #478a06 solid;
    color: #205003;
  }
}

.server-error-box .response-data {
  margin-top: 2em;
}


/****************************************************************************
 * Modal Boxes
 ****************************************************************************/
.modalbox {
  margin: 10px;

  .modalbox-contents {
    margin: 10px;
    position: relative; /* Makes this the offsetParent for calculations. */
  }

  .modalbox-buttons {
    position: absolute;
    margin: 10px;
    text-align: right;
    bottom: 0;
    right: 0;

    input {
      margin-left: 10px;
    }
  }
}

/****************************************************************************
 * Inline editor forms
 ****************************************************************************/
.editicon {
  margin-left: @edit-icon-margin;

  .rb-icon {
    vertical-align: bottom;
  }
}

.editable, .editicon {
  line-height: 14px;
}

.inline-editor-form,
.text-editor {
  textarea {
    border: 1px @textarea-border-color solid;
    margin: 0;
    outline: none;
    padding: 10px;
    .box-sizing(border-box);

    /*
     * This prevents extra spacing below a text area in different browsers.
     * See http://stackoverflow.com/questions/7144843/extra-space-under-textarea-differs-along-browsers
     */
    vertical-align: top;
  }
}

.inline-editor-form {
  display: block;
  margin: 0;
  padding: 0;
  white-space: nowrap;

  .buttons input[type='button'] {
    margin-left: 6px;
    margin-right: 0;

    &:first-child {
      margin-left: 0;
    }
  }

  input[type="text"] {
    border: 1px #888a85 solid;
    padding: 1px 2px;
  }

  input[type] + .buttons {
    padding-left: 6px;
  }

  textarea {
    margin-top: 5px;
  }

  textarea + .buttons,
  .text-editor + .buttons {
    margin-top: 6px;
    white-space: normal;
  }

  .enable-markdown {
    margin-left: 1em;

    label {
      color: black;
      font-size: 8pt !important;
      font-weight: normal;
    }
  }
}

.loading-indicator {
  display: inline;
}

.text-editor {
  margin: @textarea-editor-margin;

  textarea, .CodeMirror {
    margin: 0;
  }
}


/****************************************************************************
 * Forms
 ****************************************************************************/
form table td {
  padding: 8px 8px 4px 4px;

  &.label {
    text-align: right;
    font-weight: bold;
  }
}

.formdlg {
  tr {
    padding-top: 4px;
  }

  td.label {
    white-space: nowrap;
  }

  .error {
    color: #DD0000;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 4px 8px;
  }

  .errorlist {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;

    li {
      display: list-item;
      padding: 2px 4px;
    }
  }

  .spinner {
    float: left;

    img {
      vertical-align: top;
    }

    h1 {
      display: inline;
      margin-left: 10px;
    }
  }
}


/****************************************************************************
 * Account page
 ****************************************************************************/
.prefsbuttons {
  padding: 1em;
  text-align: center;
}

.prefsgroup ul {
  list-style: none;
  padding-left: 0;
  margin: 5px;
}

.section {
  margin-bottom: 20px;

  .title {
    background: #DDDDDD;
    border: 1px black solid;
    padding: 4px 8px;
  }

  .body {
    margin-left: 20px;
    padding: 10px;
  }
}

#headerbar {
  background: @headerbar-bg;
  border-bottom: 1px #DDDDDD solid;
  color: white;
  margin: 0;
  padding: @headerbar-padding;

  br {
    clear: both;
    height: 0;
  }

  #title {
    color: white;
    display: inline;
    font-weight: normal;
    font-size: 120%;
    vertical-align: middle;
    margin: 0;
    padding: 0;

    a {
      color: white;
      font-size: 120%;
      text-decoration: none;
    }

    .version {
      color: #E0E0E0;
      font-weight: normal;
      font-size: 90%;
    }
  }

  #logo {
    position: absolute;
    top: -2px;
    left: @headerbar-logo-padding-horiz;
  }

  #search {
   float: right;
   margin: 0 1em;

   input {
     border: 1px black solid;
     margin: 0;
     padding: 2px;
     .border-radius(6px);
     background-color: #EEEEEE;
     font-size: 1.2em;
   }
  }
}

#rbinfo {
  float: left;
  position: absolute;
  left: 0;
  padding-top: 0.2em;
  padding-left: @headerbar-padding-left;

  img {
    display: inline;
    vertical-align: middle;
  }
}

#accountnav {
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: @z-index-base;
  float: right;

  li {
    display: block;
    float: right;
    margin: -@headerbar-padding 0;
    padding: 0;
    position: relative;
    white-space: nowrap;

    &:hover {
      background: @headerbar-bg-active;

      ul {
        display: block;
        z-index: @z-index-menu;
      }
    }

    a {
      color: white;
      display: block;
      font-size: 120%;
      margin: 0;
      padding: 0 1em;
      text-decoration: none;
      height: 32px;
      vertical-align: middle;
      line-height: 32px;

      &.user-nav-item {
        padding-left: 0.2em;
      }
    }

    img {
      display: inline;
      vertical-align: top;
      margin: 0;
      padding: 0;
    }

    ul {
      background-color: @headerbar-bg;
      display: none;
      margin: 0;
      min-width: @headerbar-menu-min-width;
      padding: 0;
      position: absolute;
      right: 0;
      .border-radius(0 0 @box-border-radius @box-border-radius);

      li {
        float: none;
        margin: 0;
        padding: 0;
        text-align: right;

        &:last-child {
          .border-radius(0 0 @box-border-radius @box-border-radius);
        }

        a {
          margin: 0;
        }
      }
    }
  }
}

#activity-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  text-align: center;
  font-weight: bold;
  background-color: #fce94f;
  background-image: url("../images/spinner.gif");
  background-position: 0.4em 0.4em;
  background-repeat: no-repeat;
  border: 1px #c4a000 solid;
  border-top: 0;
  margin-left: -3em;
  padding: 0.5em 0.6em 0.5em 2.2em;
  width: 6em;
  z-index: @z-index-spinner;

  &.error {
    background-color: #ffcd9c;
    width: 28em;
    margin-left: -14em;
    background-image: none;
    padding-left: 0.6em;

    a {
      margin-left: 1em;
      color: #0000CC;
      text-decoration: none;
    }
  }
}

#error {
  div {
    background: #ffcd9c;
    border: 1px #9a4306 solid;
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  h1 {
    display: inline;
    margin: 0;
    padding: 0;
  }

  input[type='submit'] {
    margin-left: 10px;
  }
}

#manual-updates {
  padding-top: 1em;

  .box-main {
    padding: 1em;

    h1, h2 {
      margin-top: 2em;
    }
  }

  p {
    font-size: 9pt;
  }
}

#navbar-container {
  margin: 0 0 1em 0;
}

#navbar {
  background: @navbar-bg;
  border-bottom: 1px @navbar-border-color solid;
  list-style: none;
  margin: 0;
  min-height: 1.5em;
  padding: @headerbar-padding;
  padding-left: @headerbar-padding-left;

  li {
    display: inline;
    height: 30px;
    margin: 0 1em 0 0;
  }

  a {
    color: @navbar-text-color;
    font-size: 110%;
    text-decoration: none;
  }

  .newreviewrequest {
    text-align: right;
  }
}

body.admin #navbar {
  background: url("../images/admin/yellow_bg_small.png") repeat-x #F9F2C9;
  margin: 0;

  a {
    color: black;
  }
}

#page-container {
  padding: 0 @page-container-padding @page-container-padding @page-container-padding;
}

#searchbar {
  position: absolute;
  right: 0;
  margin-top: -3px;
}


/****************************************************************************
 * Login/Register pages
 ****************************************************************************/
@auth-section-margin: 2em;
@auth-label-width: 12em;
@auth-field-width: 16em;


#auth_container {
  font-size: 120%;
  margin: 7em 0 0 0;
  text-align: center;

  input[type="text"],
  input[type="password"],
  input[type="email"] {
    border: 1px #aaa solid;
    font-size: inherit;
    margin: 0;
    padding: 0.5em;
    width: @auth-field-width;
    .border-radius(@box-border-radius);
    .box-sizing(border-box);
  }

  .auth-button-container {
    width: 16em;

    input {
      font-size: 120%;
      margin: 0;
      padding: 0.6em;
      width: 100%;
      .box-sizing(border-box);
    }
  }

  .auth-form-row {
    clear: both;
    margin: 1.5em 0;
    padding-left: @auth-label-width;

    &.auth-field-row {
      padding-left: 0;

      label {
        float: left;
        font-weight: normal;
        padding: 0.5em 1em 0.5em 0.5em;
        text-align: right;
        width: @auth-label-width;
        .box-sizing(border-box);
      }

      .errorlist {
        display: block;
        margin: 0.5em 0 0 @auth-label-width;
        width: @auth-field-width;

        li {
          font-weight: normal;
          font-size: 9pt;
        }
      }
    }
  }

  .auth-header {
    margin: 0 0 1em 0;

    h1 {
      font-size: 120%;
      margin: 1em 0;
      padding: 0;
    }

    p {
      color: #444;
      margin: 1em 0;
    }

    .errorbox {
      display: inline-block;
      text-align: center;

      .errorlist {
        text-align: left;
      }
    }
  }

  .auth-section {
    display: inline-block;
    margin: 0 @auth-section-margin;
    text-align: left;
    vertical-align: top;

    &.main-auth-section {
      margin-left: (-@auth-label-width + @auth-section-margin);
    }
  }

  .errorlist {
    margin: 0;
    padding: 0;

    li {
      display: block;
      font-weight: normal;
      margin: 0 0 1em 0;;
    }
  }
}

#auth_container #login_form {
  .login-links {
    margin-top: 2em;
    text-align: center;

    p {
      width: @auth-field-width;

      a {
        color: blue;
        text-decoration: none;
      }
    }
  }
}

#auth_container #register_form {
  .register-captcha-row {
    padding-left: 0;

    .register-captcha-container {
      float: right;
    }
  }
}


/****************************************************************************
 * Auto-complete widget
 ****************************************************************************/

.ui-autocomplete-results {
  background: #ffffff;
  border: 1px solid #808080;
  overflow: hidden;
  position: absolute;
  width: 100%;
  z-index: @z-index-menu;

  ul {
    margin: 0;
    padding: 0;
    width: 100%;

    li {
      cursor: pointer;
      margin: 0;
      padding: 3px 6px;
      position: relative;
      white-space: nowrap;

      span {
        margin-left: 6px;
        position: absolute;
        right: 6px;
      }
    }
  }

  .ui-autocomplete-over {
    background: #71a5db;
    color: #FFF;
  }
}

.ui-autocomplete-footer {
  background: #ECECEC;
  border-top: 1px #C0C0C0 solid;
  padding: 3px 6px;
}


/****************************************************************************
 * User page hover
 ****************************************************************************/

#user-infobox {
  background: #F9F9F9;
  border: 1px black solid;
  display: block;
  min-height: 12em;
  padding: 1em;
  position: absolute;
  min-width: 30em;
  z-index: @z-index-dialog;
  .border-radius(10px);
  .box-shadow(0px 0px 4px #000);

  &.loading {
    background-image: url("../images/spinner.gif");
    background-position: 1em 1em;
    background-repeat: no-repeat;
  }

  .infobox-pic {
    float: left;
    width: 85px;
    margin-right: 1em;
  }

  .infobox-text {
    color: black;
    float: left;
    max-width: 200px;
    word-wrap: break-word;
  }

  a {
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  p {
    font-size: 1.2em;
    margin: 0.5em 0;
    padding: 0;
  }

  h2 {
    font-size: 1.4em;
    margin: 0 0 0.5em 0;
    padding: 0;

    a {
      color: inherit;
    }
  }

  .logged-in {
    margin-top: 2em;
  }

  .logged-in, .joined {
    font-size: 0.8em;
  }

  #infobox-text h2 {
    margin-top: 0;
    padding-top: 0;
  }
}

#submitter {
  position: relative;
}


/****************************************************************************
 * New Review Request
 ****************************************************************************/
.new-review-request {
  background-color: #fefadf;
  background-image: url('../images/review_request_box_top_bg.png');

  label {
    color: #575012;
    font-weight: bold;
  }

  tr {
    padding-top: 4px;
  }

  .box-inner {
    background-image: url('../images/review_request_box_bottom_bg.png');
  }
}


.new-review-request table,
#id_basedir,
#id_diff_path,
#id_parent_diff_path {
   width: 100%;
}


/****************************************************************************
 * clearfix hacks
 ****************************************************************************/

/*
 * clearfix hack. See http://www.webtoolkit.info/css-clearfix.html
 */
.clearfix {
  display: inline-block;

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

html[xmlns] .clearfix {
  display: block;
}

* html .clearfix {
  height: 1%;
}

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