$primary:             #0F9B8E;
$secondary:           #343837;
$success:             #19647e;
$info:                #03719C;
$warning:             #fa9f42; //#1f271b;
$danger:              #721817;

@import '../bootstrap';

.bg-dark
{
    background: $info;
}

@mixin wiki-page-header{
    @extend .pb-2;
    @extend .mt-4;
    @extend .mb-2;
    @extend .border-bottom;
}

.wiki-article .thumbnail
{
    clear: both;
    margin-bottom: 15px;
    margin-left: 10px;
    margin-right: 10px;
    text-align: center;
}


/* WIKI ARTICLE FORM ELEMENTS */
#div_id_title .asteriskField{display:none}
#id_title {
    font-size: 20px;
    height: 40px;
    padding: 6px;
    display: block;
    width: 98%;
}
#id_summary {width: 98%; padding: 6px;}
#id_content {width: 100%; padding: 6px;}

h1#article-title {font-size: 2.5em; margin-top: 0;}

.article-edit-title-link {font-size: $font-size-base; padding-left: 8px}

.wiki-label label { font-size: 16px; font-weight: normal; color: $info;}

.controls ul
{
  margin-left: 0;
  list-style: none;
}

#attachment_form #id_description
{ width: 95% }

.wiki-article div.toc,
.wiki-article div.article-list {
    max-width: 340px;
    clear: left;
    display: inline-block; /* Fix height problem when next to floating elements */
    .nav-header {
        padding: 3px 10px;
        border-bottom: 1px solid $gray-200;
        font-weight: bold;
    }
}

.wiki-article div.toc ul,
.wiki-article div.article-list ul {
    @include list-unstyled;
}

.wiki-article div.toc > ul,
.wiki-article div.article-list > ul {
    border-radius: 5px;
    background-color: $gray-100;
    padding-top: 5px;
}

.wiki-article div.toc ul li ul li,
.wiki-article div.article-list ul li ul li {
    padding-left: 10px;
}
.wiki-article div.toc ul li a,
.wiki-article div.article-list ul li a {
    padding: 5px 10px;
    display: block;
    border-bottom: 1px solid $gray-200;
}

.wiki-article div.toc ul li:last-child,
.wiki-article div.article-list ul li:last-child {
    margin-bottom: 7px;
}

.wiki-article div.toc .toctitle
{
     @extend .dropdown-toggle;
}

.wiki-article a.linknotfound {color: $warning;}

.wiki-broken {
  color: darken($danger, 20%);
}

.wiki-article pre {
    max-width: 700px;
    max-height: 150px;
    overflow: auto;
    word-wrap: normal;
    white-space: pre;
}

.wiki-article .codehilitetable {
  max-width: 700px;
  max-height: 150px;
  background-color: #f5f5f5;
  border-color: #ccc;
  border-radius: 4px;
  border-collapse: separate;
  display: block;
  overflow: auto;
}

.wiki-article .codehilitetable td:first-child {
    border-left: none;
    border-top: none;
    border-bottom: none;
}

.wiki-article .codehilitetable td:last-child {
    border: none;
}

.wiki-article .codehilitetable td {
    padding: 0;
}

.wiki-article .codehilitetable pre {
    margin-bottom: 0;
}

.wiki-article table
{
    @extend .table;
    @extend .table-bordered;
}

.wiki-article h1,
.wiki-article h2,
.wiki-article h3,
.wiki-article h4,
.wiki-article h5,
.wiki-article h6
{
    overflow: hidden;
    margin-right: 5px;
}

.wiki-article h1
{
    font-size: $font-size-base * 2;
    @include wiki-page-header;
    clear: both;
}

.wiki-article h2
{
    font-size: $font-size-base * 1.75;
    @include wiki-page-header;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.wiki-article h3
{
    font-size: $font-size-base * 1.50;
    margin: 15px 0 10px;
    line-height: 30px;
}

.wiki-article h4
{
    font-size: $font-size-base * 1.25;
}

.wiki-article h5,
.wiki-article h6
{
    font-size: $font-size-base;
}

.wiki-article blockquote p,
.wiki-article blockquote
{
    font-size: $font-size-base;
}

#wiki-edit-sidebar
{
    .card {
        margin-bottom: 5px;
    }
    .card-body
    {
        font-size: $font-size-base*0.8;
    }
}


input[type=file] {float: none; width: auto;}
.asteriskField { font-size: 20px; margin-left: 5px;}

.notification-item .since {
  font-size: 80%;
  color: #CCC;
}

.directory-toolbar .filter-clear { margin-right: 10px; position: relative; top: 5px; }

.panel-heading h3 {margin: 0;}

.diff-container {
    overflow-x: scroll;
}

.breadcrumb .icon-bar {
    display: block;
    width: 18px;
    height: 2px;
    background-color: rgb(245, 245, 245);
    border-radius: 1px 1px 1px 1px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    margin-top: 3px;
}
.breadcrumb .icon-bar:first-child{margin-top: 0;}

#article-menu
{
  border-bottom: 1px solid #EEE;
  padding-bottom: 0;
  margin-bottom: 20px;
  padding-left: 0;
}

#article-container
{
  margin-top: 20px;
}

#article-breadcrumbs {
    margin: 0;
}

#wiki-footer
{
  padding: 30px 0;
  clear: both;
}

.wiki-modal .modal-body iframe
{
    width: 100%;
    min-height: 400px;
    height: 100%;
    border: 0;
}

// Resizable modals
.ui-resizable-s {
  bottom: 0;
}
.ui-resizable-e {
  right: 0;
}
.ui-resizable {
  position: fixed !important;
}

@media print
{
    .navbar,
    .nav-tabs li a,
    #article-breadcrumbs
    {display: none;}

    #article-menu li
    {
      display: none;
    }

    #article-title-li
    {
      display: block !important;
    }
}


/******************************
 FORMS - horizontal and vertical
*******************************/

/* Special form class that just has 100% width elements */
.wiki-form-block input[type='text'],
.wiki-form-block select

{
    display: block;
    width: auto;
    @extend .form-control;
}

/* General styling, any kind of form input */
.wiki-control input[type=text],
.wiki-control input[type=email],
.wiki-control input[type=password]
{
    display: inline-block;
    //height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
    //padding: $padding-base-vertical $padding-base-horizontal;
    font-size: $font-size-base;
    line-height: $line-height-base;
    //color: $gray;
    vertical-align: middle;
    width: 280px;
    //display: inline-block;
}

.form-horizontal .wiki-control input[type='text'],
.form-horizontal .wiki-control input[type='password'],
.form-horizontal .wiki-control input[type='email'],
.form-horizontal .wiki-control select,
.form-horizontal .wiki-control textarea
{
    @extend .form-control;
    width: 280px;
    display: inline-block;
}

/* other fields */
.form-horizontal .wiki-control input[type=text],
.form-horizontal .wiki-control input[type=password]
{
    width: 280px;
    display: inline-block;
}

.form-horizontal .wiki-control .input-group
{
    width: 280px;
}

.form-vertical .wiki-control textarea,
.form-horizontal .wiki-control textarea
{
    height: 200px;
}

.form-vertical .wiki-control input[type='text'],
.form-vertical .wiki-control select,
.form-vertical .wiki-control textarea
{
    @extend .form-control;
    width: 95%; /* make room for an asterix */
    display: inline-block;
}

/* Reset column grid layout for vertical forms */
.form-vertical .wiki-control,
.form-vertical .wiki-label
{
    display: block;
    float: none;
    padding: 0; margin: 0;
    width: 100%;
}

.form-actions {
    @include make-row();
    padding: 19px 15px 20px 0;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: rgb(245, 245, 245);
    border-top: 1px solid rgb(229, 229, 229);
    float: none;
}

// Assuming it's a nested icon
.panel-heading .icon
{
    color: #444;
    font-size: 75%;
}

// Fix small select height caused by .form-control
.wiki-control {
    select[multiple],
    select[size] {
        height: auto;
    }
}

.wiki-modal .modal-dialog
    {
        max-width: unset;
    }


/******************************
 RESPONSIVE STUFF
*******************************/

.wiki-modal .modal-content { width: 100%; }

@media (min-width: 980px) {
    .wiki-modal .modal-dialog
    {
        width: 80%;
    }
}
@media (max-width: 979px) {
    .wiki-modal .modal-dialog
    {
        width: 90%;
    }
}
@media (max-width: 767px) {
    .wiki-modal .modal-dialog
    {
        width: 90%;
    }
}
@include media-breakpoint-up(lg) {
    .pull-right-block-on-responsive {
        float: right;
    }
    #wiki-search-form {
        width: 170px;
    }
    .markItUpContainer{
        margin-right: 10em;
    }
}

/******************************
 ICONS
*******************************/

@import "../../../font-awesome/scss/fontawesome";
$fa-font-path: "../../font-awesome/webfonts";
@import "../../../font-awesome/scss/regular";
@import "../../../font-awesome/scss/solid";


/******************************
 CODEHILITE / PYGMENTS
*******************************/

.wiki-article .codehilite-wrap {
    overflow: auto;
    max-height: 250px;
}

.wiki-article .codehilitetable {
    pre {
        max-width: none;
        max-height: none;
        border: 0;
        background-color: transparent;
    }
    .linenos {
        width: 1%;
        white-space: nowrap;
    }
}

@import "codehilite";

/******************************
 TWITTER TYPEAHEAD
*******************************/

@import "typeahead";

/*
Twitter Typeahead does not officially support Bootstrap 3 anymore
https://github.com/twitter/typeahead.js/issues/378
*/
.twitter-typeahead {
  display: block !important;
}


/**
* Allow dropdowns in dropdowns to make nice submenus (for article selection in the tree)
*/

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>.dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    -webkit-border-radius: 0 6px 6px 6px;
    -moz-border-radius: 0 6px 6px;
    border-radius: 0 6px 6px 6px;
}

.dropdown-submenu:hover>.dropdown-menu {
    display: block;
}

.dropdown-submenu>a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px;
}

.dropdown-submenu:hover>a:after {
    border-left-color: #fff;
}

.dropdown-submenu.float-left {
    float: none;
}

.dropdown-submenu.float-left>.dropdown-menu {
    left: -100%;
    margin-left: 10px;
    -webkit-border-radius: 6px 0 6px 6px;
    -moz-border-radius: 6px 0 6px 6px;
    border-radius: 6px 0 6px 6px;
}

#article-container pre {

    padding: 1rem;
    background-color: #f7f7f9;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}
