.storygroup-browser {
    overflow: hidden;
    height: 100%;
    .navigation, .ui.input.navigation {
        display: flex;
        position: absolute;
        justify-content: space-between;
        width: 100%;
        top: 0;
        height: 36px;
        z-index: 9;

        .button {
            padding: 0.8em 0;
            border-radius: 0px !important;
            border-left: solid #ccc 2px;
        }
        & + * {
            position: relative;
            top: 36px;
        }
        input {
            border-radius: 0;
        }
    }

    #storygroup-tree {
        height: ~"calc(100% - 36px)";
        overflow-y: auto;
        overflow-x: hidden;
    }

    .side-by-side .drag-handle {
        visibility: hidden;
        padding-right: 20px;
        margin-right: 0 !important;

        &.dragging {
            visibility: visible;
        }
    }

    .ui.menu.vertical.pointing.secondary {
        width: 100% !important;
        border-radius: 0;
        padding-bottom: 50px;

        .item-focus-holder {
            outline: none;
            .item-name{
                font-weight: normal;
                &:before {
                    font-family: monospace;
                    color: #666;
                    padding-right: 0.75ch;
                    letter-spacing: -2px;
                }
            }
            &[type='story-group'] .item-name {
                font-weight: bold;
            }
            &[type='story'] .item-name:before {
                content: '##';
            }
            &[type='rule'] .item-name:before {
                content: '>>';
            }
            &[type='test_case'] .item-name:before {
                content: '✔✔';
            }
            &[type='test_case'] .item-name.failing-test-case-title:before {
                content: '✘✘';
                color: #db2828;
            }
            &[type='form'] .item-name:before {
                content: '\1F4DD\0020';
            }
            &[type='form-slot'] {
                .item-name {
                    font-weight: normal;
                    color: @botfront-blue;
                }
            }

            .createcolorclasses(@i:1) when(@i <= length(@basic-colors)) {
                @name: extract(extract(@basic-colors, @i), 1);
                @color: extract(extract(@basic-colors, @i), 2);
                &.@{name} {
                    .item-name {
                        color: @color;
                        &:before {
                            content: '\2728\0020';
                        }
                    }
                }
                .createcolorclasses(@i + 1);
            }
            
            .createcolorclasses();
        }

        .item {
            padding: 3px 5px;
            border-bottom: 1px solid #eee !important;
            &.active,
            &.active:hover {
                background-color: rgba(33, 133, 208, 0.08);
                border-right-color: @blue !important;
                color: @botfront-blue;
            }
            .eye.icon,
            .ellipsis.icon,
            .plus.icon,
            .toggle.on.icon,
            .trash.icon {
                visibility: hidden;
                &.focused {
                    visibility: visible;
                    color: @botfront-blue;
                    opacity: 1;
                }
            } 
            .toggle.off.icon {
                opacity: 0.3;
            }


            &:hover {
                .eye.icon,
                .ellipsis.icon,
                .plus.icon,
                .toggle.icon,
                .trash.icon {
                    visibility: visible;
                    opacity: 0.3;
                    &.focused {
                        opacity: 1;
                    }
                }
                .drag-handle {
                    visibility: visible;
                }
            }
            .item-chevron {
                width: 16px;
                border: 1px solid transparent;
                color: @botfront-blue;
                i {
                    padding: 4px 0 4px 8px;
                }
            }
            .item-name,
            .item-edit-box input {
                white-space: nowrap;
                height: 1.75em;
                text-overflow: ellipsis;
                overflow: hidden;
                padding: 4px;
                background-color: transparent;
                border: 1px solid transparent;
                border-radius: 4px;

                &:hover:not(.uneditable),
                &:focus:not(.uneditable) {
                    background-color: #fff;
                    border-color: #ccc;
                    font-weight: normal;
                    color: #000;
                    cursor: text;
                }
                &.grey{
                    color: #8e8e8e;
                }
            }
            .item-edit-box input {
                width: 100%;
            }
            .item-actions {
                white-space: nowrap;
                margin-left: auto !important;
                .item.add-form-item {
                    padding-left: 1em !important; // overide sematic ui
                    i.wpforms.icon {
                        margin-right: 0 !important; // overide sematic ui
                    }
                    .text {
                        padding-left: 0.7ch;
                    }
                }
            }
            &:hover {
                .item-actions { max-width: max-content; }
            }
        }

        &.dragging .item:hover {
            .icon.ellipsis,
            .icon.eye,
            .drag-handle,
            .plus.icon,
            .trash.icon {
                visibility: hidden;
            }
        }
    }
}

.story-title-prefix {
    color: #666;
    font-family: monospace;
    transform: scale(1.5);
    letter-spacing: -2px;
    font-style: normal;
    font-weight: lighter;
    padding-right: 1ch;
    &.small {
        transform: unset;
    }
}

.count-tooltip {
    left: 30px;
    height: 30px;
    width: 30px;
    padding: 5px 0 0 0;
    background-color: #ff0000;
    color: #fff;
    font-weight: bold;
    font-size: 12pt;
    font-family: @fontFamily;
    border-radius: 50%;
    display: inline-block;
    z-index: 100;
}

.story-editor {
    margin-bottom: 20px;
    box-shadow: 0 1px 5px rgba(34, 36, 38, 0.1);
    .ui.attached.menu.top {
        border-color: #eeeeee;
        background-color: #f9f9f9;
        .item {
            padding: 0px 16px;
        }
        &.test-case-failing{
            background-color: #db2828;
            .header.item {
                input {
                    color: rgb(250, 250, 250);
                    &:hover,
                    &:focus {
                        background-color: rgba(255,255,255,0.5);
                    }
                }
            }
            .story-title-prefix {
                color: rgb(250, 250, 250);
            }
            .icon.top-menu-clickable {
                color: rgb(245, 245, 245);
                opacity: 1;
                &:hover {
                    color: rgb(240, 240, 240);
                }
            }
        }

        .trigger-editor-modal-trigger {
            margin-bottom: 2px;
            cursor: pointer;
        }
        
        .icon.top-menu-clickable {
            color: #767676;
            &:hover {
                color: #5c5c5c;
                cursor: pointer;
            }
            &.disabled {
                color: #767676;
                &:hover {
                    color: #767676;
                    // cursor: not-allowed;
                }
            }
        }

        .test-case-buttons-container {
            .ui.basic.button.remove-test-button,
            .ui.basic.button.overwrite-expected-button {
                font-size: 0.8rem;
                margin-right: 0.5em;
                background-color: white !important;
                &:hover {
                    background-color: white !important;
                }
            }
        }

        .header {
            width: ~"calc(100% - 425px)";
            padding-right: 0;
            margin-left: 10px;
            input {
                margin: 0 5px;
                border-style: solid;
                font-size: 16px;
                border-color: rgba(176, 176, 176, 0);
                border-radius: 6px;
                padding: 4px 9px;
                padding-left: 2px;
                border-width: 1px;
                background-color: rgba(0,0,0,0);
                color: #212121;
                outline: none;
                &:hover, &:focus {
                    border-color: rgba(176, 176, 176, 0.4);
                    background-color: rgba(255, 255, 255, 0.699);
                    color: rgba(0, 0, 0, 1);
                }
            }
            .label{
                margin-left:0.7rem
            }
        }

        .icon {
            margin-left: 8px;
        }

        .unpublish{
            margin-bottom: 5px;
            font-size: 16px;
            color: #212121;
            font-weight: 400
        }

        //removes borders b/w menu items
        .item::before {
            width: 0;
        }
        .test-case-actions {
            top: -2px;
            margin-right: 0.25em;
            .dropdown.icon {
                margin-left: 0;
            }
            &.icon.file {
                margin-top: -2px;
            }
        }
    }

    .ui.segment.attached {
        border-color: #eeeeee;
        padding: 0;

        .ui.segment.attached {
            border-top: none;
        }

        .pointing.secondary.menu {
            margin: 0;
            flex-wrap: wrap;
            min-height: 0;
            background-color: #f9f9f9;
            a.item {
                padding: 0.25rem 0.5rem;
                white-space: nowrap;
                min-width: ~'calc(3ch + 40px)';
                max-width: ~'calc(20ch + 40px)';
                &.add-tab {
                    min-width: 0;
                    &:hover {
                        background-color: transparent;
                        border-color: transparent;
                    }
                    i {
                        position: relative;
                        bottom: 2px;
                    }
                }
                &:hover, &.active {
                    background-color: darken(#f9f9f9, 5%);
                    border-color: darken(#f9f9f9, 30%);
                }
                &:hover {
                    input {
                        border: solid 1px darken(#f9f9f9, 30%);
                        background-color: #ffffff;
                    }
                }
                input {
                    max-height: 14pt;
                    outline: none;
                    border: solid 1px transparent;
                    background-color: transparent;
                    border-radius: 4px;
                    padding: 1px;
                    color: rgba(0, 0, 0, 0.87);
                    font-family: inherit;
                    font-weight: inherit;
                }
                .trash {
                    color: rgba(0, 0, 0, 0.4);
                    padding: 0 10px;
                    margin: 0;
                    visibility: hidden;
                }
                &.active:hover {
                    .trash {
                        opacity: 1;
                        visibility: visible;
                    }
                }
            }
        }

        &.bottom {
            background-color: #f9f9f9;
            &.linked {
                background-color: rgba(0, 181, 173, 0.06);
            }
        }

        .story-error-wrapper {
            min-height: 100px;
            padding: 10px;
        }
    }
}

.slot-editor {
    .icon.trash {
        margin-left: 14px;
        animation-name: fadein;
        animation-duration: 0.2s;
    }

    .ui.form label {
        font-size: 14px;
    }

    b {
        display: inline-block;
        margin-bottom: 14px;
    }
}

.ui.segment.slot-editor.new {
    border-style: dashed;
    margin-bottom: 100px;
}

#add-slot-container {
    margin-bottom: 350px;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.8;
    }
}

@keyframes warningPopup {
    from {
        transform: scale(1, 0);
    }

    to {
        transform: scale(1, 1);
    }
}

.story-line .label-container {
    margin-left: 24px;
}

.label-container {
    cursor: pointer;
    display: block;
    width: max-content;
    border: solid 1px;
    border-radius: 4px;
    line-height: 1.1;
    margin: 0px 3px 3px;
    font-family: monospace;

    div {
        display: inline-block;
        background-color: white;
        padding: 3px 6px;
        font-size: inherit;
        font-weight: normal;
        &:not(:first-of-type) {
            border-radius: 0px 4px 4px 0px;
            color: @black;
        }
        &:first-of-type {
            color: white;
        }
    }

    .slot-content {
        color: #2185d0;
    }
}

.createlabelcolorclasses(@i:1) when(@i <= length(@basic-colors)) {
    @name: extract(extract(@basic-colors, @i), 1);
    @color: extract(extract(@basic-colors, @i), 2);

    .label-container.@{name} {
        border-color: @color;
        div:first-of-type {
            background-color: @color;
        }
        &:hover {
            div:first-of-type {
                background-color: darken(@color, 3%);
            }
        }
    }
    .createlabelcolorclasses(@i + 1);
}

.createlabelcolorclasses();

.stories-toggles {
    display: flex;
    justify-content: space-between;
    .message {
        min-height: 40px;
    }
    .buttons {
        height: 40px;
    }

    button.ui.basic.icon.button {
        border-style: solid;
        border-width: 1px;
        border-color: @black;
    }

    button.ui.basic.icon.button.not-selected-editor {
        border-style: solid;
        border-width: 1px;
        border-color: #eeeeee;
        &:hover {
            opacity: 0.9;
        }
    }
}
.story-path-popup {
    color: rgba(0, 0, 0, 0.5);
    padding: 0px;
    display: flex;
    flex-wrap: wrap;
    .section {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .divider {
        padding-left: 0.6ch;
        padding-right: 0.6ch;
    }
}
.ui.mini.segment.footer-segment {
    display: flex;
    padding: 0px;
    padding-left: 1em;
    background-color: #00000005;
    color: rgba(0, 0, 0, 0.4);
    &.linked {
        color: #666666;
    }
    .ui.mini.menu {
        margin-top: 0px;
        margin-left: 1em;
        border-style: none;
        border-left: 1px solid #dddddd;
        box-shadow: none;
        border-radius: 0;
        background-color: transparent;
        .item.footer-option-button {
            background-color: rgba(0, 0, 0, 0);
            border-style: none;
            border-radius: 0px;
            padding-top: 0;
            padding-bottom: 0;
            &:hover {
                background-color: rgba(0, 0, 0, 0.02);
            }
            &.color-grey {
                color: rgba(0, 0, 0, 0.4);
                &:hover {
                    background-color: rgba(0, 0, 0, 0);
                    cursor: not-allowed;
                }
            }
        }
    }
    .breadcrumb-container {
        display: flex;
        align-self: center;
        max-height: 20px;
        white-space: nowrap;
        .section {
            max-width: 10vw;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
            &.collapsed-path {
                min-width: 0px;
            }
        }
        .divider {
            padding-left: 0.6ch;
            padding-right: 0.6ch;
        }
    }
}

.ui.attached.segment.single-story-container {
    border-bottom-style: none;
}

.ui.red.label.exception-label {
    .times.circle.icon {
        padding-left: 0px;
        margin-left: 0px;
        margin-right: 0.5em;
    }
    padding: 0px;
}
.ui.yellow.label.exception-label {
    .exclamation.circle.icon {
        padding-left: 0px;
        margin-left: 0px;
        margin-right: 0.5em;
    }
    padding: 0px;
}

.ui.attached.message.top-menu-banner.warning,
.ui.attached.message.top-menu-banner.error {
    box-shadow: none;
    border-style: solid;
    border-color: rgb(238, 238, 238);
    border-width: 1px;
    padding-top: 0.6em;
    padding-bottom: 0.75em;
}

.ui.attached.message.top-menu-banner.warning {
    padding: 0.75em 0;
    min-height: 0;
    &.with-popup {
        padding-left: 1em;
    }
    &.with-popup:hover {
        cursor: pointer;
        background-color: #fff8ef;
    }
    &.condition-container {
        &.empty {
            height: 0;
            * {
                opacity: 0;
                transition: opacity 0.2s ease-in-out;
            }
            &:hover {
                height: max-content;
                animation-name: height-change;
                animation-duration: 0.3s;
                * { opacity: 1; }
                .ace_editor {
                    min-height: 4em;
                }
                .story-visual-editor {
                    min-height: 1.75em;
                }
            }
        }
        &:not(:hover) {
            .story-visual-editor {
                min-height: 0;
                .add-story-line {
                    height: 0;
                    margin: 0;
                }
            }
        }
    }
    .header {
        padding-left: 24px;
    }
}


@keyframes height-change {
    0%   { height: 0; }
    40%  { height: 0; }
    99%  { height: 8em; }
    100% { height: max-content; }
}

.ui.popup.connected-stories-popup {
    padding: 13px 17px;
    text-align: left;
    overflow-y: auto;
    max-height: 200px;
    min-width: 250px;
    .ui.header {
        margin-bottom: 4px;
        margin-top: 0em;
    }
}

.ui.active.loader {
    z-index: 50;
}

.ui.toggle.checkbox.story-box-toggle label {
    padding-top: 0 !important;
}
