@import 'provider/colors';
@import 'cms_intro';

.formtastic.cms_template, .formtastic.cms_section, .formtastic.cms_file {

  #cms_template_published_input {
   .cm-s-neat {
     background-color: $codemirror-bg-readonly;
     color: white;

     .CodeMirror-cursor { border-left: none !important; }
   }
  }

  .codemirror {
    list-style: none;

    // we have labels before codemirror inputs, this hides them
    // labels are there because of cucumber
    label[for=cms_template_draft], label[for=cms_template_published] {
      display: none;
    }
  }

  .inline-hints a { text-decoration: underline;  }

  .important-button, .dangerous-button, .less-important-button {
    font-size: 12px;
    font-weight: bold;

    i {
      vertical-align: middle;

      position: relative;
      top: -1px;
      padding-right: 2px;

      // if you change this, change max-height of buttons in .button-bar
      font-size: 18px;
      line-height: 14px;
      height: 12px;

      // trash looks always a bit off
      &.fa-trash {
        padding-right: 3px;
        top: -2px;
      }
    }
  }

  .buttons {
    margin-bottom: -5px;
  }

  .buttons-stripe {
    position: relative;

    .buttons {
      width: 70%;
      margin-top: -10px;
    }

    .buttons-left {
      position: absolute;
      top: 15px;
      left: 5px;
      li { display: inline; }
    }
  }
}

#cms-template-editor-tabs {
  @include inline-block-list;
}


#cms-template-editor {
  position: relative;

  ul.ui-tabs-nav {
    display: inline-block;
    @include inline-block-list;
    vertical-align: middle;

    li {
      font-size: 14px;
      text-align: center;


      border: 1px solid darken($border-color, 10%);
      border-bottom: none;

      @include border-top-radius(5px);
      background-color: darken($codemirror-border, 20%);

      a {
        color: lighten(black,15%);
        @include inline-block;
        padding: 5px;
        width: 6em;
      }

      &.ui-state-active {
        font-weight: bold;
        border-color: $border-color;
        background-color: $codemirror-border;
      }
    }
  }

  .ui-tabs-hide { display: none; }

  ul.links {
    vertical-align: middle;
    font-size: 1.2em;
    display: inline-block;
    @include inline-block-list;

    li {
      height: 29px;
      line-height: 32px;
    }

    a i {
      font-size: 20px;
      vertical-align: middle;
    }
  }

  textarea {
    border: 1px solid $border-color;
    width: 650px;
    font-size: 14px;
  }
}

#open-portal-to-public {
  width: 50%;
  //margin-top: 8em;
  //clear: both;
  float: right;
  margin-top: 3.6em;


  .button {
    margin-left: 0;
    clear: both;
  }
}

#cms-new-content-button {
  position: absolute;
  top: 12px; // same as padding-top of #tab-content
  right: 12px; // also
}

#cms-preview-button, #cms-new-content-button {
  font-size: 12px;
  a.important-button { height: 1.2em; }

  .dropdown {
     li {
       min-width: 9em;

       & > a { color: black; }
       &:hover a { color: white; }
     }
  }
}

html {
  height: 100%;
  overflow: auto;
}

body.popup {
  height: 100%;
  overflow: auto;

  .CodeMirror {
    height: auto;
  }
  .button-bar {
    overflow:  hidden;
  }
}
