@import "bourbon";
@import "compass/css3/transform";
@import "solarized_light";
@import "base/variables";
@import "mixins/hidpi";

/* The CSS in this file is for the inline examples on the home page.  */

.example-app pre,
code {
  padding:0 3px 2px;
  font-size:12px;
  color:#333333;
  border-radius: 3px;
}

.example-loading {
  ul {
    margin-left: 0 !important;

    li {
      padding: 10px 0;

      .issue-number {
        float: left;
        padding-right: 15px;
        color: #555;
      }

      .author-name {
        font-size: 12px;
        margin-top: 6px;

        a {
          color: black;

          &:hover {
            border-bottom: none;
          }
        }
      }
    }
  }
}

#content .example-highlight {
  @include hidpi('code_background', 'gif');
  box-shadow: 0 1px $white, inset -1px 1px 4px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  font-family: Menlo, monospace;
  line-height: 16px;
  overflow: hidden;
  position: relative;
}

.example-arrow {
  margin: 17px auto;
  width: image-width('about/example-arrow.png');
  height: image-height('about/example-arrow.png');
  @include hidpi('about/example-arrow', png);
}

.name-input {
  background-color: transparent;
  border: none;
  border-bottom: 1px dotted #999;
  text-align: center;
  min-width: 50px;
  display: inline-block;
}

.example-output label {
  vertical-align: bottom;
}

.example-output .text {
  padding-top: 20px;
}

.example-output input {
  background-color: transparent;
  border: none;
  border-bottom: 1px dotted #999;
  text-align: center;
  min-width: 150px;
  display: inline-block;
  font-size: 14px;
  border-radius: 0;
  background-clip: padding-box;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 1px;
  outline: none;
}

.example-viewer .example-highlight {
  margin-top:0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top:0;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}
.CodeRay td.line-numbers {
  border-top-left-radius: 0;
}

.example-app p {
  margin-bottom: 20px;
}

.example-tabs {
  .tabs-footer {
    display: block;
    padding: 2px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-top-color: #ccc;
  }

  a {
    line-height: 18px;
    display: inline-block; //vertical-align:top;
    position: relative;
    padding: 6px 12px 5px 12px;
    color: #666;
    font-size: 12px;
    text-decoration: none;
    border-top: 1px solid #ddd;
    border-radius: 5px;
    margin: 0 8px -1px 0;
    background-color: #eee;

    &:first-child {
      margin-left: 21px;
    }

    &:focus {
      outline: none;
    }

    &:hover, &.active {
      background-color: #f7f7f7;
      border-bottom: none;
    }

    &.active {
      border-bottom: 1px solid #f7f7f7;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }

    &:hover:before,
    &:hover:after,
    &.active:before,
    &.active:after {
      border-bottom-color: #bbb;
      background-color: #f7f7f7;
    }

    &.active:before,
    &.active:after {
      padding-bottom: 1px;
    }

    &:before,
    &:after {
      content:'';
      display: block;
      position: absolute;
      top: -1px;
      z-index: 0;
      height: 100%;
      width: 15px;
      background-color: #eee;
      border: 1px solid #ddd;
      border-bottom:none;
    }

    &:before {
      right:-7px;
      border-left:none;
      @include transform(skew(27deg, 0deg));
      border-radius: 0 5px 0 0;
      box-shadow: 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 $white;
    }

    &:after {
      left:-7px;
      border-right:none;
      @include transform(skew(-27deg, 0deg));
      border-radius: 5px 0 0 0;
      box-shadow: -1px 0 0 rgba(0,0,0,.1), inset 1px 0 $white;
    }

    // reverse z-index natural ordering (works for 10 tabs max)
    &:nth-child(1)  { z-index:22; }
    &:nth-child(2)  { z-index:21; }
    &:nth-child(3)  { z-index:20; }
    &:nth-child(4)  { z-index:19; }
    &:nth-child(5)  { z-index:18; }
    &:nth-child(6)  { z-index:17; }
    &:nth-child(7)  { z-index:16; }
    &:nth-child(8)  { z-index:15; }
    &:nth-child(9)  { z-index:14; }
    &:nth-child(10) { z-index:13; }
    &:nth-child(11) { z-index:11; }
    &:nth-child(12) { z-index:10; }
    &:nth-child(13) { z-index:9; }
    &:nth-child(14) { z-index:8; }
    &:nth-child(15) { z-index:7; }
    &:nth-child(16) { z-index:6; }
    &:nth-child(17) { z-index:5; }
    &:nth-child(18) { z-index:4; }
    &:nth-child(19) { z-index:3; }
    &:nth-child(20) { z-index:2; }
    &:nth-child(21) { z-index:1; }
    &.active { z-index:100; }
  }
}

.example-app {
  margin: 70px 0;

  p {
    font-size: 1.2em;
    line-height: 1.5em;
    width: 700px;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 55px;
  }
}

.example-viewer .tabs {
  width: 100%;

  li {
    cursor: pointer;
  }

  a {
    font-family: Menlo, monospace;
  }
}

.example-gravatar {
  list-style-type: none;
  margin: 0;
  padding: 0;

  text-align: center;

  .email-input input {
    width: 210px;
  }

  li {
    margin: 0 30px;
    display: inline-block;
  }

  img {
    padding: 5px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 210px;
    height: 210px;
    border: 1px solid #ddd;
  }
}

.example-viewer img {
  display: block;
  margin: 17px auto;
}

.example-output {
  display: inline-block;
  width: 100%;
  padding: 17px;
  background-color: $white;
  border-radius: 6px;
  box-shadow: 0 1px #ffffff, inset -1px 1px 4px rgba(0, 0, 0, 0.1);
}

#routing-example .example-output {
  h1 {
    font-size: 2em;
    margin-bottom: 1em;
  }

  h2 {
    margin-bottom: 1em;
  }

  h4 {
    font-size: 1.5em;
    margin-bottom: 1em;
    font-weight: bold;
  }

  .loading {
    position: absolute;
    top: 50%;
    bottom: 50%;
    left: 50%;
    right: 50%;

    width: 100px;
    height: 50px;

    color: $white;
    background-color: rgba(0,0,0,0.5);

    margin-left: -50px;
    margin-top: -25px;

    border-radius: 10px;
    text-align: center;
    line-height: 50px;
  }

  aside {
    float: left;
    background-color: #f7f7f7;
    width: 180px;
    height: 430px;
    border: 1px solid #ccc;
  }

  aside ul {
    list-style-type: none;
  }

  aside ul li {
    padding-bottom: 10px;
  }

  aside h2 {
    text-transform: uppercase;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-shadow: 1px 1px 0px #eee;
    padding: 15px;
    margin-bottom: 0;
  }

  aside a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 15px;
  }

  aside a.active {
    background-color: #eee;
  }

  aside a:hover {
    background-color: #eee;
    border-bottom: 0;
  }

  span.count {
    float: right;
    color: #505f71;
    padding: 0.2em 0.2em;
    border-radius: 40%;
    font-size: 1.1em;
    position: relative;
    top: -3px;
  }

  section.main {
    height: 430px;
    border-bottom: 1px solid #ccc;
    margin-left: 180px;
    border-right: 1px solid #ccc;
    border-top: 1px solid #ccc;
  }

  .index {
    padding-top: 5em;
    text-align: center;
    height: 100%;
  }

  table {
    width: 100%;
    border-bottom: 1px solid #999;
    border-collapse: collapse;
  }

  td, th {
    padding: 0.5em;
  }

  th {
    font-weight: bold;
    font-size: 0.8em;
  }

  tr {
    border-bottom: 1px solid #ccc;
    cursor: pointer;
  }

  td a {
    text-decoration: none;
    color: #333;
  }

  tr.active {
    @include background(linear-gradient(to bottom, #7db9e8, #267dc9));
    color: $white;
    text-shadow: 1px 1px 0px #666;
  }

  .mailbox-index {
    padding-top: 5em;
    text-align: center;
    color: #eee;
    font-style: italic;
  }

  .mail {
    padding: 1em;
  }

  dl {
    width: 100%;
    border-bottom: 1px solid #333;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
  }

  dt {
    font-weight: bold;
    font-size: 0.8em;
    width: 60px;
  }

  dd {
    margin-bottom: 0.5em;
  }

  .url {
    font-family: sans-serif;
    padding: 0 0 2em 0.4em;
    width: 100%;
    height: 25px;
    font-family: 'Maven Pro';
    font-weight: bold;
    text-transform: uppercase;
  }
}

body.about,
body.index {
  .tabs ul {
    border-bottom-color: #d1d1d1;
  }
}
