/* [cssnext](http://cssnext.io/) syntax */

@keyframes spin {
    from {
        transform: rotate(0deg)
    }
    to {
        transform: rotate(360deg)
    }
}

button.ChuckNorrisButton {
    background: transparent;
    margin: 10px;
    border: 1px solid #d8d8d8;
    color: black;
    font-family: "Courier New", monospace;
    font-size: 0.8em;

    &:hover {
        background: #d8d8d8 !important;
        color: #f15a24 !important;
    }
}

i.ChuckNorrisSpinner {
    color: #f15a24;
    animation: spin 1s infinite;
    margin-top: 20px;
}

.ChuckNorrisDemo {
    border: 2px solid #d8d8d8;
    padding: 1em;
    font-family: "Courier New", monospace;
    line-height: 2em;
    background: #FFF;

    & ng-component {
        order: 1;
    }
    & .opener {
        cursor: pointer;
        margin-right: 10px;
        &::after {
            content: '+';
            display: block;
            transition: all 0.25s;
        }
        &:hover::after { color: #f15a24; }
    }

    & ul {
        list-style: none;
        padding: 1em;

        &.depth-0 {
            padding: 0;
            margin: 0;
            & > li {
                &.folded { border-bottom: 1px solid #d8d8d8; }
                & > .item > .value, & > .item > ng-component > .value {
                    color: #f15a24;
                }
            }
        }

        &.depth-1 {
            & > li {
                color: #444;
            }
        }

        & li {
            & > span.item {
                display: inline-flex;
            }

            &.category {
                & > span.item {
                    cursor: pointer;
                    & > .value, & > ng-component > .value {
                        order: 2;
                        & > i {
                            margin-left: 10px;
                            color: #888;
                            transition: color .25s;
                            &:hover{ color: #f15a24 }
                            &.loading{ animation: spin 1s infinite; }
                        }
                    }
                }

                &:not(.folded) > span.item > .opener::after {
                    transform: rotate(45deg);
                }

                &.async > span.item, &.folded > span.item {
                    & > .value > i, & > ng-component > .value > i {
                        display: none;
                    }
                }
                &.loading > span.item {
                    & > .value > i, & > ng-component > .value > i {
                        display: none;
                    }
                    & > .opener::after {
                        animation: spin 1s infinite;
                    }
                }
            }
        }
    }
}
