/**
 *  Copyright (c) 2009 David Cramer and individual contributors.
 *  All rights reserved.
 *  
 *  Redistribution and use in source and binary forms, with or without modification,
 *  are permitted provided that the following conditions are met:
 *  
 *      1. Redistributions of source code must retain the above copyright notice,
 *         this list of conditions and the following disclaimer.
 *  
 *      2. Redistributions in binary form must reproduce the above copyright notice,
 *         this list of conditions and the following disclaimer in the documentation
 *         and/or other materials provided with the distribution.
 *  
 *      3. Neither the name of the Sentry nor the names of its contributors may be
 *         used to endorse or promote products derived from this software without
 *         specific prior written permission.
 *  
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 *  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 *  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 *  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
 */

@import url("bootstrap/less/bootstrap.less");

@baseFontSize: 13px;
@grayDark: #404f60;
@gray: #6d757e;

@linkColor: #4593DE;

@linkColorHover: darken(#1783c8, 10%);


/* =============================  Global  ============================== */

body {
  margin: 0;
  font-family: @baseFontFamily;
  font-size: @baseFontSize;
  line-height: @baseLineHeight;
  color: @gray;
  -webkit-font-smoothing: antialiased;
  font-family: "helvetica neue", helvetica, sans-serif;
  background: @gray;
}

.container {
  width: auto;
}


// LINKS
// -----

a {
  color: @linkColor;
  text-decoration: none;
  .transition(color linear .2s);
}
a:hover {
  color: @linkColorHover;
}

p {
  font-family: "proxima-nova", "helvetica neue", helvetica, sans-serif;
  font-size: 14px;
  line-height: 22px;
}


h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

h2 {
  font-size: 24px;
  line-height: 36px;
}
h3 {
  line-height: 27px;
  font-size: 18px;
}

/* =============================  Layout  ============================== */

.navbar {
  margin-bottom: 0;
  .navbar-inner {
    padding-left: 0;
    .clearfix();
    .border-radius(0);
    height: 50px;
    background: url(../src/images/navbar-bg.gif);
    border: 0;
    border-bottom: 1px solid #2c333a;
    .box-shadow(0 1px 0 rgba(255,255,255, .5));

    .container {
      padding: 0 20px;
    }
  }

  #logo {
    float: left;
    display: block;
    width: 73px;
    height: 25px;
    margin: 15px 0 0;
    background: url(../images/dashboard/logo.png) top left no-repeat;
    text-indent: -1000em;
  }

  .navbar-search {
    margin: 10px 0 0 20px;
    .pull-left;

    .search-query {
      .border-radius(3px);
      #gradient > .vertical(rgba(0,0,0, .3), rgba(0,0,0, .1));
      padding: 5px 8px;
      @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
      .box-shadow(@shadow);
      .placeholder(#b4bdc5);
      text-shadow: 0 1px 3px rgba(0,0,0, .45);
      color: #fff;
      width: 240px;

      &:focus {
        #gradient > .vertical(rgba(0,0,0, .4), rgba(0,0,0, .1));
        border: 1px solid #111;
        padding: 5px 8px;
        @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
        .box-shadow(@shadow);
        color: #fff;
        text-shadow: 0 1px 3px rgba(0,0,0, .45);
      }

      :-moz-placeholder {
        color: #b4bdc5;
        text-shadow: 0 1px 3px rgba(0,0,0, .45);
        line-height: 1.2;
      }
      ::-webkit-input-placeholder {
        color: #b4bdc5;
        text-shadow: 0 1px 3px rgba(0,0,0, .45);
        line-height: 1.2;
      }
    }
  }

  .nav {
    margin: 12px 0 0 10px;

    > li {
      margin: 0 0 0 20px;
      > a {
        color: #dde2e7;
        display: block;
        padding: 3px 0;
        text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
        font-size: 13px;
      }
      > .dropdown-toggle {
        background: inherit !important;
      }
      > .dropdown-menu {
        a {
          .transition(none);
        }
      }
      &.active > a,
      &:hover > a,
      &:focus > a {
        background: none;
        font-weight: inherit;
        font-size: inherit;
        color: #fff;
        .border-radius(3px);
      }

    }
  }
}

.toolbar {
  .clearfix();
  background: #f4f4f4 url(../src/images/toolbar-bg.png);
  padding: 0 20px;
  height: 49px;
  border-bottom: 1px solid #b6b9bd;
  .box-shadow(0 1px 2px rgba(0,0,0, .07));

  .breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: normal;
    line-height: 52px;
    font-family: "proxima nova", "proxima-nova", "heletica-neue", sans-serif;

    > li {
      position: relative;
      a {
        color: @gray;
      }

      &:last-child > a {
        color: @grayDark;
      }

      .action {
        .btn;
        .btn-small;
        position: relative !important;
        padding: 3px 7px;
        margin-left: 5px;
        top: -1px;
        line-height: 13px;
        font-size: 11px;
      }

    }
  }

  h2 {
    font-size: 16px;
    font-weight: 600;
    line-height: 52px;
    font-family: "proxima nova", "proxima-nova", "heletica-neue", sans-serif;
  }

  .pull-right {
    margin: 10px 0 0;
    .btn {
      border-color: #b6b9bd;
      min-width: 70px;
      &.active{
        color : #111 !important;
        .box-shadow(~"inset 0 1px 3px rgba(0,0,0, .1), 0 1px 0 rgba(255,255,255, .5)");
      }
    }
  }
}

#content {
  background: #fff;

  &.with-sidebar {
    background: #fff url(../images/dashboard/sidebar-bg-right.png) top right repeat-y;
    .content {
      padding-right: 300px;
    }
  }
  &.with-left-sidebar {
    background: #fff url(../src/images/sidebar-bg-left.png) top left repeat-y;  
    .content {
      padding-left: 300px;
    }
    .main {
      float: right;
    }
    .sidebar {
      margin-right: 0;
      margin-left: -300px;
    }
  }

  .content {
    .clearfix();
    position: relative;
  }
  .main {
    width: 100%;
    position: relative;
    float: left;
  }
  .body {
    padding: 20px;
  }
  .btn-toolbar {
    .clearfix();
    margin: 0;
    list-style: none;
    padding: 15px 20px;
    .btn-group {
      .btn {
        float: none;
      }
      .dropdown-toggle small {
        color: #888;
      }
      .dropdown-menu li small {
        color: #aaa;
        display: inline-block;
      }
    }
  }
  section.body .btn-toolbar {
    padding: 15px 0;
  }
  .sidebar {
    position: relative;
    width: 260px;
    float: left;
    padding: 18px 20px;
    margin-right: -300px;

    h6 {
      display: block;
      font-size: 12px;
      text-transform: uppercase;
      font-weight: 600;
      line-height: 1.2;
      color: #aaaaaa;
      text-shadow: 0 1px 0 rgba(255,255,255, .5);
      padding: 3px 15px;
      margin: 0 -15px 0;
      font-family: "proxima nova", "proxima-nova", "helvetica neue", helvetica, sans-serif;
      font-size: 11px;
      font-weight: bold;
      line-height: @baseLineHeight;
      color: @grayLight;
    }

    dl {
      margin-top: 0px;
      margin-bottom: 8px;
    }

    .nav.nav-tabs.nav-stacked,
    .nav.counted-list {
      margin-bottom: 8px;
      list-style: none;
      &.counted-list {
        li {
          position: relative;
          a {
            padding-left: 55px;
          }
          .count {
            position: absolute;
            left: 0;
            line-height: 23px;
          }
        }
      }
      li {
        position: relative;
        margin-left: 0;
        padding-left: 0;
        .count {
        text-align: center;
          width: 35px;
          position: absolute;
          display: block;
          left: 0;
        }
      }
    }

    .nav.nav-tabs.nav-stacked {
      .box-shadow(0 2px 0 rgba(255,255,255, .8));
      li {
        position: relative;
        .action {
          .btn;
          .btn-small;
          padding: 3px 7px;
          position: absolute;
          right: 12px;
          top: 5px;
          font-size: 11px;
        }
        a {
          background-color: #fff;
          color: #9ba0a3;
          border-color: #ccc !important;
          &:hover {
            color: @linkColor;
          }
        }
        &.active a {
          position: relative;
          #gradient > .vertical(#f7f7f7, #f0f0f0);
          color: @linkColor;
          border-color: #ccc !important;
          .box-shadow(inset 0 1px rgba(255,255,255, .6));
          font-weight: 500;
          text-shadow: 0 1px rgba(255,255,255, .75);
        }
      }
    }
    .nav-list {
      margin: 0 -19px 8px -20px;
      li.active a {
        background-color: #56AFE8;
      }
    }
    .filter {
      margin-bottom: 20px;
      .select2-container {
        display: block;
      }
    }
  }
}

footer {
  .clearfix();
  background: @gray;
  text-align: center;
  padding: 30px;
  color: #fff;
  a {
    color: #f4f4f4;
    font-weight: bold;
    &:hover {
      color: #fff;
    }
  }
}

/* =============================  Modules  ============================== */

.btn {
  color: #404f60;
  font-size: 13px;
  line-height: 18px;
  span {
    text-indent: -1000em;
  }
  &.prev, &.next {
    padding: 6px 8px;
  }
  &.prev span {
    display: block;
    .square(13px);
    background: url(../images/dashboard/pagination.png);
  }
  &.next span {
    display: block;
    .square(13px);
    background: url(../images/dashboard/pagination.png) -13px 0;
  }
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e5e6e7;

  .empty-result {
    padding: 15px 20px;
    min-height: 60px; /* count height */
  }

  &.no-counts {
    .event {
      padding-left: 20px;
    }
  }

  .event {
    position: relative;
    padding: 15px 20px 15px 100px;
    position: relative;
    border: 1px solid #e5e6e7;
    border-width: 0 0 1px 1px;
    min-height: 60px; /* count height */

    &.with-metadata {
      .message {
        padding-right: 124px;
      }
      .meta {
        right: 155px;
      }
    }

    &:hover {
      #gradient > .vertical(#f7fbfe, #eff8fd);
      border-color: #aec9d7;
      @shadow: 0 -1px 0 #aec9d7, 1px 0 0 #aec9d7;
      .box-shadow(@shadow);

      h3 a {
        color: @linkColorHover;
      }
    }

    h3 {
      font-family: "proxima nova", "proxima-nova", "heletica-neue", sans-serif;
      margin: 4px 0 0;
      font-size: 20px;
      color: @gray;
      font-weight: normal;
      width: 85%;
      overflow: hidden;
      span {
        margin-left: 10px;
        font-weight: 300;
        padding: 0 5px;
        font-size: 13px;
      }
    }
    .count {
      color: #fff;
      position: absolute;
      left: 20px;
      .square(60px);
      background: #cfd3da;
      .border-radius(60px);
      line-height: 62px;
      text-align: center;
      font-size: 20px;
      font-weight: 400;
      letter-spacing: -1px;
      font-family: "proxima nova", "proxima-nova", "heletica-neue", sans-serif;
    }
    .message {
      margin-bottom: 0;
      font-size: 14px;
      /*font-family: "proxima nova", "proxima-nova", "heletica-neue", sans-serif;*/
      padding-right: 24px;
      .tag {
        .pull-right;
      }
    }
    .tag {
      margin-left: 5px;
      font-size: 12px;
      .border-radius(6px);
      background: #fff;
      padding: 2px 6px;
      color: #aec9d7;
    }
    .sparkline {
      position: absolute;
      right: 40px;
      top: 25px;
      display: inline-block;
      width: 100px;
      height: 40px;
    }
    .meta {
      position: absolute;
      right: 50px;
      top: 20px;
    }
    .actions {
      position: absolute;
      right: 15px;
      top: 20px;
      list-style-type: none;
      margin: 0;
      padding: 0;
      li {
        margin-bottom: 12px;
        font-size: 14px;
        line-height: 18px;
        text-align: center;
        display: block;
        width: 16px;
        height: 18px;
        > a {
          color: #AEC9D7;
          &:hover {
            text-decoration: none;
          }
        }
        .checked {
          color: orange;
        }
        .disabled {
          color: @gray;
        }
      }
    }

    .row_link {
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      position: absolute;
    }

    &.level-debug .count {}
    &.level-info .count { background: #ffa101; }
    &.level-warning .count { background: #ffa101; }
    &.level-error .count { background: #f0431c; }
    &.level-fatal .count { background: #f0431c; }

    &.resolved {
      h3 {
        text-decoration: line-through;
      }
      .count {
        .opacity(50);
      }
    }

    &.event-small {
      min-height: 30px;
      padding: 10px 10px 10px 60px;

      h3 {
        margin: 0;
        font-size: 14px;
        line-height: 16px;
      }

      .message {
        font-size: 12px;
      }

      .count {
        left: 10px;
        font-size: 12px;
        width: 36px;
        height: 36px;
        line-height: 38px;
        .border-radius(36px);
      }

      .meta {
        right: 120px;
      }

      .sparkline {
        right: 10px;
        top: 18px;
      }

      .tag, .meta {
        font-size: 11px;
      }
    }
  }
}

label { font-weight: bold; }

pre, code {
  span {
    display: inline-block;
  }
}

code {
  border: 0;
  background-color: inherit;
  color: lighten(@black, 40%);
}

.nav-tabs {
  > li.pull-right {
    float: right;
  }
}
.table th {
  vertical-align: top;
}
.table td {
  vertical-align: middle;
}
.clippy {
  display: inline-block;
  vertical-align: middle;
  padding: 3px 5px 1px 23px;
  line-height: 20px;
  position: relative;
  width: auto;
  overflow: hidden;
  background: #f9f9f9;
  border: 1px solid #e9e9e9;
  object {
    .border-radius(3px);
    position: absolute;
    left: 5px;
    top: 5px;
    width: 12px;
    height: 12px;
  }
  &:hover {
   border-color: #bbb;
  }
}
td .clippy {
  border: 0;
}

// Code styles

ol.context {
  margin: 0;
  list-style-position: inside;
  border: 1px solid #ccc;
  border: 1px solid rgba(0,0,0,.15);
  .border-radius(3px);
  > li {
    padding-left: 20px;
    font-family:monospace;
    white-space:pre;
    color:rgba(0,0,0,.75);
    background-color: #f5f5f5;
    > pre {
      background-color: inherit;
      color: rgba(0,0,0,.5);
      margin: 0;
      padding: 0;
      border: 0;
      display: inline;
      line-height: @baseLineHeight;
      font-size: 12px;
      white-space: pre;
      white-space: pre-wrap;
      word-wrap: break-word;
    }
  }
  > li.active {
    background-color: #ddd;
    pre {
      color: @black;
    }
  }
}
ol.context-line {
  > li {
    > span {
      float: right;
    }
  }
}

.expandable {
  cursor: pointer;
  .closed {
    height: 0;
    overflow: hidden;
  }
}


// Vars display
table.vars {
  .table-condensed;
}
td.code {
  > pre {
    background-color: inherit;
    color: rgba(0,0,0,.75);
    padding: 1px 3px;
    border: 0;
  }
}
td table.vars {
  margin-bottom: 0;
}

// Generic module stuff

.module {
  margin-bottom: 20px;
}
.module-content table pre {
  margin-bottom: 0;
}

// Sparkline grid

.innerColumn(@columnSpan: 1) {
  width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 10;
}

#chart { margin-bottom: 15px; overflow: hidden; }

/* tracebacks */
.frame table.vars { margin:5px 0 2px 35px; }
table.vars td.code { overflow: hidden; }
table.vars td.code pre { margin-bottom: 0; }
div.pastebin textarea { padding: 10px; background: #f9f9f9; border-color: #ddd; }

ul.traceback { list-style-type: none; margin-left: 0;}
ul.traceback li.frame { margin-bottom: 1em; overflow: hidden; position: relative; }
div.commands { margin-top: 10px; margin-left: 20px; }
div.commands a { color:black; text-decoration:none; }
div.commands span { font-size: 0.9em; }

#versioninfo th { text-align: left; font-family: monospace; padding-right: 20px; }
#versioninfo tr:nth-child(odd) {
    background: #eee;
}

.error { background: #ffc; padding: 5px; }
.specific { color:#cc3300; font-weight:bold; }
h2 span.commands { font-size:.7em;}
span.commands a:link {color:#5E5694;}
pre.exception_value { font-family: sans-serif; font-weight: normal; color: #333; font-size: 1.5em; }

/* message details */
.server-list, .url-list, .logger-list, .level-list { list-style: none; margin-left: 0; margin-bottom: 0; }
.server-list li, .url-list li { padding-bottom: 10px; }
.url-list li a { line-height: 18px; }

dl.flat {
    margin-bottom: 1em;
}
dl.flat dt {
    float: left;
    clear: left;
    width: 90px;
    padding-bottom: 5px;
}
dl.flat dd {
    padding-bottom: 5px;
}

#full-message {
    line-height: 1.5em;
}

table.inline tr {
    display: inline-block;
}

#popup {
    background: #fff;
    padding: 10px;
    margin: 10px;
}

small {
  font-size: 0.9em;
}

.form-actions {
  p {
    padding: 6px 10px;
    line-height: 15px;
  }
  .note {
    color: @grayLight;
    line-height: 30px;
  }
}

.inputs-list label {
  padding-left: 18px;
}
.inputs-list label input[type="radio"],
.inputs-list label input[type="checkbox"] {
  float: left;
  margin-left: -18px;
}

// Move the options list down to align with labels
.controls > .inputs-list label:first-child,
.controls > .inputs-list label:first-child {
  padding-top: 5px; // has to be padding because margin collaspes
}

legend {
  margin-bottom: 18px;
}


.modal-header small {
  font-size: 0.65em;
}

.btn-primary {
  .buttonBackground(#61C1EF, #4593DE);
  font-weight: bold;
}
// #5e6a77
// #505962

.body .page-header:first-child {
  margin-top: 0;
}
.page-header {
  padding-bottom: 0;
  border-bottom: 0;
  margin: 20px 0;

  .pull-right {
    margin-top: 4px;
  }
  h2 {
    font-weight: normal;
  }
}

.image {
  border: 1px solid #ddd;
  background: #ccc;
  padding: 10px;
  margin-bottom: 10px;
  display: inline-block;
  .border-radius(3px);
}
.image img {
  .border-radius(3px);
  display: block;
}

.datepicker-box {
  position: absolute;
  top:45px;
  left:378px;
  padding: 15px 15px 0px;
  z-index:900;
  background-color: @white;
  border-color: #999;
  border-color: rgba(0, 0, 0, 0.2);
  border-style: solid;
  border-width: 1px;
  .border-radius(4px);
  .box-shadow(0 2px 4px rgba(0,0,0,.2));
  .background-clip(padding-box);
  .time {
    width: 80px;
  }
  .date {
    width: 120px;
  }
  .submit {
    .help-block {
      margin-top: 0;
      padding-top: 5px;
    }
  }
}

#daterange {
  display: none;
}

.avatar {
  vertical-align: middle;
  border-radius: 3px;
}


.nav-pills > li.active > a {
  background-color: lighten(@linkColor, 10%);
}
.nav-small {
  &.nav-pills > li > a {
    padding: 5px 8px;
    font-size: 12px;
  }
}

.page-header h3.pull-left {
  margin-right: 10px;
}

#messages .alert {
  padding: 20px 20px; 
  .border-radius(0);
}

.alert-block {
  padding-bottom: 5px;
  > p {
    margin-bottom: 9px;
  }
  > ul {
    margin-bottom: 9px;
  }
}

[class*="icon-"] {
  background-image: url(../src/less/bootstrap/img/glyphicons-halflings.png);
}
.icon-white {
  background-image: url(../src/less/bootstrap/img/glyphicons-halflings-white.png);
}


.plugin-meta {
  .description {
    p { font-size: 13px; }
  }
}


@media print {
    body {
        color: @black;
    }
    header {
        display: none;
    }
    .sidebar, .toolbar {
      display: none;
    }
    .content {
      padding: 0 !important;
    }
    #CModal, footer { display: none; }
}
