@import "../../../../css/static/mixin";
@import "../../../../css/static/properties";

$color_client_normal: #cccccc;
$client_info_avatar_size: 10em;
$bot_thumbnail_width: 16em;
$bot_thumbnail_height: 9em;

.containerPlaylist {
    flex-grow: 1;
    flex-shrink: 1;

    min-height: calc(3em + 4px);
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: stretch;

    @include user-select(none);

    .overlay {
        position: absolute;
        z-index: 1;

        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        background: #2b2b28;

        display: flex;
        flex-direction: column;
        justify-content: center;

        border-radius: 0.2em;
        border: 1px #161616 solid;

        a {
            text-align: center;

            font-size: 1.5em;
            color: hsla(0, 1%, 40%, 1);
        }

        code {
            margin-left: .25em;
        }

        .button {
            width: 8em;
            font-size: .8em;
            align-self: center;
            margin-top: .5em;
        }

        &.hidden {
            display: none;
        }

        &.error {
            /* TODO: Text color */
        }
    }

    .playlist {
        flex-grow: 1;
        flex-shrink: 1;
        min-height: 3em;

        cursor: pointer;

        display: flex;
        flex-direction: column;
        justify-content: flex-start;

        overflow-x: hidden;
        overflow-y: auto;

        border: 1px #161616 solid;
        border-radius: 0.2em;
        background-color: rgba(43, 43, 40, 1);

        @include chat-scrollbar-vertical();

        .reorderIndicator {
            $indicator_thickness: .2em;

            height: 0;
            border: none;
            border-top: $indicator_thickness solid hsla(0, 0%, 30%, 1);

            margin-top: $indicator_thickness / -2;
            margin-bottom: $indicator_thickness / -2;
        }
    }
}

$playlist_entry_height: 3.7em;
.playlistEntry {
    flex-shrink: 0;
    flex-grow: 0;

    position: relative;

    display: flex;
    flex-direction: row;
    justify-content: stretch;

    width: 100%;
    padding: .5em;

    color: #999;
    border-bottom: 1px solid #242527;

    opacity: 0;
    height: 0;

    @include transition(background-color $button_hover_animation_time ease-in-out);

    &:hover {
        background-color: hsla(220, 0%, 20%, 1);
    }

    &.shown {
        opacity: 1;
        height: $playlist_entry_height;
    }

    &.animation {
        @include transition(opacity 0.5s ease-in-out, height 0.5s ease-in);
    }

    &.deleted {
        @include transition(opacity 0.5s ease-in-out, height 0.5s ease-in, padding 0.5s ease-in);

        padding: 0;
        opacity: 0;
        height: 0;
    }

    &.reordering {
        z-index: 10000;

        position: fixed;
        cursor: move;

        border: 1px #161616 solid;
        border-radius: 0.2em;
        background-color: #2b2b28;
    }

    .thumbnail {
        flex-shrink: 0;
        flex-grow: 0;

        align-self: center;

        height: .9em;
        width: 1.6em;

        font-size: 3em;
        position: relative;

        border-radius: 0.05em;
        overflow: hidden;

        img {
            position: absolute;

            width: 100%;
            height: 100%;
        }
    }

    .data {
        margin-left: .5em;

        display: flex;
        flex-direction: column;
        justify-content: center;

        flex-shrink: 1;
        flex-grow: 1;
        min-width: 2em;

        .row {
            display: flex;
            flex-direction: row;
            justify-content: space-between;

            &.second {
                font-size: .8em;
            }

            .name {
                flex-shrink: 1;
                min-width: 1em;

                @include text-dotdotdot();
            }

            .delete {
                flex-grow: 0;
                flex-shrink: 0;

                width: 1.5em;
                height: 1em;
                margin-left: .5em;

                opacity: .4;
                @include transition($button_hover_animation_time ease-in-out);

                &:hover {
                    opacity: 1;
                }
            }

            .description {
                flex-shrink: 1;
                min-width: 1em;

                @include text-dotdotdot();
            }

            .length {
                flex-grow: 0;
                flex-shrink: 0;

                margin-left: .5em;
            }
        }
    }

    &.currentSong {
        background-color: hsla(130, 50%, 30%, .25);

        &:hover {
            background-color: hsla(130, 50%, 50%, .25);
        }

        .delete {
            display: none;
        }
    }

    &.insertMarkerAbove {
        &::before {
            content: "";
            position: absolute;

            width: 100%;
            top: -1px;
            left: 0;

            border-top: 2px solid var(--channel-tree-move-border);
        }
    }

    &.insertMarkerBellow {
        z-index: 1;

        &::after {
            content: "";
            position: absolute;

            width: 100%;
            bottom: -2px;
            left: 0;

            border-bottom: 2px solid var(--channel-tree-move-border);
        }
    }
}