@import "base";

a.phpdoc-link,
a.phpdoc-class-link,
a.phpdoc-popover-link {
    text-decoration: none;
}

.popover.popover-phpdoc {
    max-width: 100%;
    > .popover-title {
        font-weight: normal;
        padding: 15px 14px 12px 14px;
        font-size: 13px;
    }
    > .popover-content {
        font-size: 11px;
        padding: 0;
        p:last-child {
            margin-bottom: 0;
        }
    }
    .popover-phpdoc-description {
        font-style: italic;
        margin-top: 10px;
    }
    .popover-phpdoc-type {
        font-size: 10px;
        position: absolute;
        top: 1px;
        right: 6px;
        color: #ada1a1;
    }
}

.modal.modal-phpdoc .modal {
    &-header { display: none; }
    &-body { padding: 0 }
    &-footer { padding: 0 5px 5px 0; border-top: none; }
}

@include media-breakpoint-up(lg) {
    .modal.modal-phpdoc .modal-full { max-width: none; }
}


.tooltip.tooltip-phpdoc {
    > .tooltip-inner {
        max-width: 100%;
    }
}

// Helper classes
.phpdoc {

    // @formatter:off
    &-visibility {
        &-public    { color: $phpdoc-visibility-color-public; }
        &-protected { color: $phpdoc-visibility-color-protected }
        &-private   { color: $phpdoc-visibility-color-private }
    }
    &-modifier {
        &-static    { color: $phpdoc-modifier-color-static }
        &-abstract  { color: $phpdoc-modifier-color-abstract }
        &-inherited { color: $phpdoc-modifier-color-inherited }
        &-final     { color: $phpdoc-modifier-color-final }
    }
    &-type {
        font-family: 'Source Code Pro', monospace, sans-serif;
        padding: 0;
        text-decoration: none;

        &-class     { color: $phpdoc-type-color-class }
        &-trait     { color: $phpdoc-type-color-trait }
        &-interface { color: $phpdoc-type-color-interface }
        &-external  { color: $phpdoc-type-color-external }
        &-simple    { color: $phpdoc-type-color-simple; }
    }
    // @formatter:on
}

// Icon helper classes
i.phpdoc {

    // @formatter:off
    &-visibility {
        &-public    { @include fa-icon(); &:before { content: $phpdoc-visibility-icon-public; } }
        &-protected { @include fa-icon(); &:before { content: $phpdoc-visibility-icon-protected; } }
        &-private   { @include fa-icon(); &:before { content: $phpdoc-visibility-icon-private; } }
    }
    &-modifier {
        &-static    { @include fa-icon(); &:before { content: $phpdoc-modifier-icon-static; } }
        &-abstract  { @include fa-icon(); &:before { content: $phpdoc-modifier-icon-abstract; } }
        &-inherited { @include fa-icon(); &:before { content: $phpdoc-modifier-icon-inherited; } }
        &-final     { @include fa-icon(); &:before { content: $phpdoc-modifier-icon-final; } }
    }
    &-type {
        &-class     { @include fa-icon(); &:before { content: $phpdoc-type-icon-class; } }
        &-interface { @include fa-icon(); &:before { content: $phpdoc-type-icon-interface; } }
        &-trait     { @include fa-icon(); &:before { content: $phpdoc-type-icon-trait; } }
    }
    // @formatter:on
}

%phpdoc-component {
    &.boxed {
        border: 1px solid #c5d0dc;
    }
}

// Component classes
.phpdoc {

    &-tree {
        float: left;
        padding-top: 10px;
        width: 100%;
        border-right: 1px solid #f0f2f1;
        overflow: hidden;
    }
    &-tree-context-menu {
        background: #fafafa;
        border: 1px solid #bdbdbd;
        box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
        display: block;
        list-style: none;
        margin: 0;
        padding: 0;
        position: absolute;
        width: 250px;
        z-index: 999999;
        li {
            border-bottom: 1px solid #e0e0e0;
            margin: 0;
            padding: 5px 35px;

            &:last-child {
                border-bottom: none;
            }

            &:hover {
                background: #1e88e5;
                color: #fafafa;
            }
        }
    }

    &-entity {
        @extend %phpdoc-component;
    }

    &-source {
        code { white-space: pre; }
    }

    &-content {
        width: 80%;
        float: left;
        font-size: 14px;

        i.inherited-icon {
            @include fa-icon;
            float: right;
            margin-right: -5px;
            margin-top: 3px;
            font-size: 12px;
            color: #ffc107;
            &:before {
                content: $fa-var-arrow-up;
            }
        }
    }

    &-header {
        border-bottom: 1px solid #f0f2f1;
        margin-bottom: 10px;
        padding-left: 20px;
        > i {
            line-height: 22px;
            font-size: 22px;
            padding-right: 20px;
            float: left;
        }
        > .header-title {
            font-weight: 200;
            margin-top: 15px;
            margin-bottom: 13px;
            font-size: 18px;
            line-height: 24px;
        }

        &.compact {
            > i { line-height: 20px; font-size: 13px; }
            > .header-title { font-size: 13px; line-height: 15px; }
        }
    }

    &-block {
        padding: 0 20px;
        p {
            font-size: 0.9rem;
        }
        .table {
            font-size: 12px;

            th, td {
                padding: 0;
            }
        }
    }

    &-tabs {
        margin-left: 20px;
        margin-right: 20px;
        > .tab-content {
            padding: 0;
            border: none;
            background-color: transparent;
            border-top: 1px solid #c5d0dc;
        }
    }

    &-tabs-nav {
        .nav-item {
            &:first-child { margin-left: 10px; }
            .nav-link {
                text-decoration: none;
                height: 35px;
            }
            &.active .nav-link {
                color: $color-codex-alt;
            }

            &.tab-filters-toggler .nav-link {
                padding: 8px;
                border-left: none;
            }
            &.tab-filters-toggler.active .nav-link {
                cursor: pointer;
                &:hover { //, &:focus {
                    color: black;
                }
            }
        }
    }

    &-tags {
        @extend %phpdoc-component;

        table.table-tags {
            th, td {
                padding: 3px 0 1px 0;
                font-size: 12px;
                border-top: none;
                border-bottom: 1px solid #eceeef;
            }

        }

    }

    &-list-settings {
        @extend %phpdoc-component;
        padding: 10px;

        .filter-title:not(.empty) {
            font-size: 1.2rem;
            padding-bottom: 5px;
            border-bottom: 1px solid #ebe6e6;
            margin-bottom: 10px;
            text-indent: 3px;
        }
        .pretty {
            display: block;
            label { font-size: 0.9rem; }
            i {
                margin-right: 4px;
                &:after {
                    top: -1px;
                    left: -1px;
                }
            }
        }
    }

    &-method-list,
    &-property-list {
        @extend %phpdoc-component;
        list-style-type: none;
        padding-left: 0;
        margin-bottom: 0;
        .nav-item {
            background-color: $phpdoc-method-list-color-bg;
            border: 1px solid material-color(blue-grey, '200');
            &:not(:first-child) {
                border-top: none;
            }
            &.active {
                background-color: $phpdoc-method-list-color-bg-active;
                > .nav-link {
                    color: $phpdoc-method-list-color-fg-active;
                }
            }
            &.seperator {
                > span {
                    display: block;
                    font-weight: bold;
                    padding: 4px 10px;
                    text-decoration: none;
                    border: 1px solid #c5d0dc;
                    margin: 0 -1px 0 0;
                    color: darkgray;
                    text-align: center;
                }
            }
        }

        .nav-link {
            padding: 4px 10px; // for .phpdoc-method-signature
            font-size: 0.9rem;
            text-decoration: none;
            display: block;
            color: $phpdoc-method-list-color-fg;
            border-left: none;
            i.fa {
                margin-right: 10px;
            }

            &:hover:not(.no-hover) {
                color: $phpdoc-method-list-color-fg-hover;
                background-color: $phpdoc-method-list-color-bg-hover;
            }

            &.no-click {
                cursor: default;
                &:hover {
                    color: $phpdoc-method-list-color-fg;
                    background-color: transparent;
                }
            }

            > span.description {
                font-size: 10px;
                p { margin-bottom: 0 }
            }
        }

        .nav-link .phpdoc-method-signature {
            display: inline;
            font-family: $font-family-base;
            padding: 0;
            font-size: 0.9rem;
        }

        .nav-link-modifier {
            float: right;
            background-color: $phpdoc-method-list-color-bg;
            position: relative;
            top: -26px;
        }

        &.compact {
            .nav-item {
                background-color: transparent;
                border: none;
            }

            .nav-link {
                padding: 1px 10px;
                &:hover {
                    background-color: transparent;
                    color: $phpdoc-method-list-color-fg;
                }
            }
            .nav-link-modifier {
                background-color: transparent;
                float: left;
                top: 0;
            }
        }
    }

    &-method-signature {
        padding: 12px 15px;
        font-family: $font-family-monospace;
        font-size: 12px;
        margin: 0;
        small.visibility {
            margin-right: 15px;
        }
    }

    &-method {
        @extend %phpdoc-component;
        .method {
            &-details {
                padding: 10px 20px 10px 20px;
            }

            &-block-title {
                font-size: 0.7rem;
                border-bottom: 1px solid #e2e2e2;
                padding-left: 5px;
                margin: 10px -20px 10px 0px;
                text-transform: uppercase;
                color: rgba(black, 0.5);
                position: relative;
                left: -20px;
                &:first-child {
                    margin-top: 0;
                }
            }

            &-block {
                padding-left: 5px;
            }

            &-arguments {
                list-style-type: none;
                margin-left: 0;
                &:first-child {
                    counter-reset: customlistcounter;
                }
                > li {
                    counter-increment: customlistcounter;
                }
                > li:before {
                    content: counter(customlistcounter) " ";
                    position: relative;
                    left: -15px;
                    font-size: 0.7rem;
                    color: lightgrey;
                    top: 9px;
                    float: left;
                }
            }

            &-argument {
                border-top: 1px dashed #f1f1f1;
                border-bottom: 1px dashed #f1f1f1;
                border-left: 2px solid #e6e4e4;
                padding: 3px 0 3px 5px;
            }

            &-argument + .method-block {
                border-left: 2px solid #e6e4e4;
                //padding-left: 10px;
                //padding-bottom: 10px;
                margin-bottom: 10px;

                p {
                    margin: 0;
                    font-size: 0.9rem;
                    padding-top: 2px;
                }
            }

        }

        .phpdoc-method-signature + .method-details {
            border-top: 1px solid #c5d0dc;
        }
    }

    &-app {
        @extend %phpdoc-component;

        .zone {
            width: 100%;
            margin: 0 auto;
            position: relative;
            clear: both;
            display: flex;
        }

        .zone .handle {
            width: 6px;
            background: material-color(blue-grey, '50'); //#ECEFF1;
            &:hover {
                background: material-color(blue-grey, '200');
            }
        }

        .zone .item {
            width: calc((100% - 30px) / 2);
        }
    }

    &-class-link {
        font-size: 11px;
        line-height: 11px;
        vertical-align: middle;
        background: rgba(238, 238, 238, 0.35);
        direction: ltr;
        text-align: left;
        white-space: pre;
        word-spacing: normal;
        word-break: normal;
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
        background: $color-codex-grey;
        color: $color-codex;
        padding: 1px 5px;
        border-radius: 3px;
        tab-size: 4;
        margin: 0 3px;
        font-family: "Source Code Pro", monospace;
        text-decoration: none !important;
    }
}

