@import "transitions.less";
@import "icons.less";
@import "prism.css";

*, *:before, *:after {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-size: 10px;
  font-family: MozTT, sans-serif;
}

body, .content, .page {
  margin: 0;
  font-size: 1rem;
  position: absolute;
  overflow: hidden;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

code {
  font-size: 1.5rem;
  line-height: 1.8rem;
}

.page (@top, @bottom) {

  ul.content li {
    &:hover {
      background-color: fadeout(mix(@top, @bottom), 90%);
    }
    &:active {
      background-color: fadeout(mix(@top, @bottom), 70%);
    }
  }

  top: 0;
  height: 100%;
  bottom: 0;
  &> header {
    background: linear-gradient(to bottom, @top 0%, @bottom 100%);
    background-color: @bottom;
    border-bottom: 1px solid darken(@bottom, 10%);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    height: 5rem;
    line-height: 5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    h1 {
      margin: 0 2rem;
      padding: 0;
      font-size: 2.5rem;
    }
    button {
      font-size: 25px;
      text-shadow: inherit;
      color: inherit;
      line-height: inherit;
      background: none;
      border: 0;
      height: 5rem;
      width: 5rem;
      padding: 0;
      z-index: 5;
      float: right;
      &.back {
        text-align: left;
        float: left;
        margin-left: -0.5rem;
        margin-right: -1.5rem;
      }
      &:hover {
        background-color: rgba(0, 0, 0, 0.1);
      }
      &:active {
        background-color: rgba(0, 0, 0, 0.7);
        color: #fff;
      }
    }
  }
}

.form(@normal, @hover, @active) {
  // width: 100%;
  display: block;
  padding-left: 2rem;
  padding-right: 2rem;
  label, button {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: block;
  }
  label {
    clear: left;
    font-size: 1.8rem;
    line-height: 2.2rem;
    color: #000;
    padding: 1rem 0 0;
  }
  progress {
    display: block;
    margin: 0 0;
    height: 4rem;
    padding: 0 1rem;
    width: 100%;
  }
  p {
    font-size: 1.5rem;
  }
  input, button {
    display: block;
    margin: 0 0;
    height: 4rem;
    padding: 0 1rem;
    width: 100%;
    line-height: 4rem;
    font-size: 1.7rem;
    border: 1px solid #bbb;
  }
  input[type=radio] {
    float: left;
    width: 4rem;
    &+ label {
      float: left;
      padding-right: 1em;
      padding-left: 0.5em;
      clear: inherit;
    }
  }
  input[type=text], button {
    -webkit-appearance: none; -moz-appearance: none;
    border-radius: 0.5rem;
  }
  input[type=submit], button {
    border-radius: 1rem;
    margin: 1rem 0;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, @normal 0%, darken(@normal, 10%) 100%);
    &:hover {
      background: linear-gradient(to bottom, @hover 0%, darken(@hover, 10%) 100%);
    }
    &:active {
      background: linear-gradient(to top, @active 0%, darken(@active, 10%) 100%);
    }
    &[disabled] {
      background: #888;
      opacity: 0.5;
    }

  }
}

.content {
  overflow-x: hidden;
  overflow-y: auto;
  &.header {
    margin-top: 5rem;
  }
}

ul.content {
  list-style-type: none;
  margin: 0;
  padding: 0;
  li {
    height: 6rem;
    line-height: 6rem;
    padding: 0 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    .icon {
      line-height: 6rem;
      font-size: 2rem;
      &.right {
        float: right;
        margin-right: -10px;
        margin-left: 10px;
      }
      &.left {
        float: left;
        margin-left: -10px;
        margin-right: 10px;
      }
    }
    button {
      font-size: 2rem;
      color: inherit;
      line-height: inherit;
      background: none;
      border: 0;
      height: 100%;
      width: 5rem;
      float:right;
      margin-right: -15px;
      padding: 0;
      &:hover {
        background-color: rgba(0,0,0,0.1);
      }
      &:active {
        background-color: rgba(0,0,0,0.8);
        color: #fff;
      }
    }
    p {
      color: #5b5b5b;
      font-size: 1.5rem;
      line-height: 2rem;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      display: block;
      margin: 0;
    }
    p:first-of-type {
      font-size: 1.8rem;
      line-height: 2.2rem;
      color: #000;
      padding: 1rem 0 0;
    }
    &> :first-child {
      margin-top: 0;
    }
    &> :last-child {
      margin-bottom: 0;
    }
    p.progress {
      display: none;
      span {
        margin-left: 0.5em;
      }
    }
    &.active {
      height: 8rem;
      p.progress {
        display: inherit;
      }
    }
  }
}

