@import "../colors";

@import "colors";
@import "fonts";

.operation-theme(@color) {
  border: 1px solid @color;
  background-color: @background;

  .http-method{
    background-color: @color;
    color: @white;
  }
  >header {
    background-color: fade(@color, 10%);
    @media print {
      background-color: lighten(@color, 10%) !important;
      -webkit-print-color-adjust: exact;
    }
  }
  h4 {
    color:@color;
  }
}


ul.operations {
  list-style-type: none;
  padding: 0;
}
li.operation {
  .sw-font;
  @operation-border-radius: 3px;
  list-style-type: none;
  margin: 0.4em 0em 1em 1em;
  border-radius: @operation-border-radius;
  position: relative;

  >header {
    overflow: hidden;
    cursor: pointer;
    display: table;
    width: 100%;
    min-height: 31px;

    .focus-editor {
      position: absolute;
      right: 0px;
      top: 0;
      height: 24px;
      width: 24px;
      padding: 10px;
      display: none;
    }

    .deprecated {
      float: left;
      margin: 8px;
      color: @white;
      background: @deprecated-background;
      padding: 0px 7px;
      border: 1px solid @white;
    }

    &:hover .focus-editor {
      display: inline-block;
      background-image: url("../images/jump-icon.svg");
      background-repeat: no-repeat;
      background-position: 0px 3px;
      background-size: 22px;
      text-decoration: none;
    }

    .http-method  {
      font-family: 'Source Code Pro';
      font-size: 16px;
      padding: .5em .5em;
      display: table-cell;
      float: left;
      border-top-left-radius: @operation-border-radius - 2;

      margin-right: .4em;
      min-width: 68px;
      text-align: center;
    }

    .summary {
      padding: .4em;
      display: table-cell;
      font-size: 0.9em;
      vertical-align: middle;
      float: left;
    }
  }

  .operation-theme(@http-default);
  &.get     { .operation-theme(@http-get);     }
  &.post    { .operation-theme(@http-post);    }
  &.delete  { .operation-theme(@http-delete);  }
  &.patch   { .operation-theme(@http-patch);   }
  &.put     { .operation-theme(@http-put);     }
  &.options { .operation-theme(@http-options); }
  &.head    { .operation-theme(@http-head);    }
  &.trace   { .operation-theme(@http-trace);   }

  .content >section {
    margin: 1em;
    font-family: "Open Sans";
    font-size: 0.9em;

    >h4 {
      font-family: "Open Sans";
      font-weight: 600;
    }

    >div {
      margin: .3em 0 .5em;
      line-height: 120%;
    }

    button.close-try {
      float: right;
    }
  }


  table.params, table.respns, table.security, table.examples {
    width: 100%;

    >thead {
      >tr {

        >th {
          padding: 0.3em;
          font-weight: 600;
          background-color: @table-th;
        }
      }
    }

    >tbody {
      >tr {
        border-bottom: 1px solid @silver;
        font-size: 16px;

        >td {
          padding: 0.3em;

          // remove margin for schema in operation tables
          .schema-model {
            margin-left: 0;
          }

          &.mono {
            font-family: "source code pro";
            font-weight: bold;
            font-size: 1.0em;
            white-space: pre;
          }

          .security-value {
            padding: 0 1em 0 0;
          }

          span.resp-code {
            border-radius: 3px;
            color: @code-default;
            padding: 3px 0;
            letter-spacing: 0.5px;
            font-weight: 700;
            display: inline-block;

            &.green { color: @code-200; }
            &.red { color: @code-500; }
            &.blue { color: @code-300; }
            &.yellow{ color: @code-400; }
          }
        }
      }
    }
  }

  .respnse-headers {
    font-size: 85%;

    th, td {
      padding: 4px;
    }
  }

  &.collapsed {
    .content {
      display: none;
    }
  }

  &.hidden {
    display: none;
  }
}
