@import url("fonts.css");
@import '~@mattermost/compass-icons/css/compass-icons.css';

body {
    margin: 0;
    background-color: transparent;
    font-family: Open Sans;
    overflow: hidden;
}

#app {
    padding: 24px;
    display: inline-block;
    max-width: 600px;
}

.ServerDropdown {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0px;
    background: #FFFFFF;
    border: 1px solid rgba(61, 60, 64, 0.16);
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    min-width: 180px;
}

.ServerDropdown__droppable {
    width: 100%;
    overflow-y: scroll;

    &::-webkit-scrollbar {
        display: none;
    }

    > button {
        border: none;
        background: transparent;
    }
}

.ServerDropdown__header {
    padding: 6px 20px;
    display: flex;
    align-items: center;
    width: -webkit-fill-available;
    user-select: none;

    .ServerDropdown__servers {
        font-weight: 600;
        font-size: 14px;
        line-height: 20px;
        color: #3D3C40;
    }

    .ServerDropdown__keyboardShortcut {
        font-weight: 400;
        font-size: 12px;
        line-height: 16px;
        color: rgba(61, 60, 64, 0.56);
        margin-left: auto;
    }
}

.ServerDropdown__divider {
    border-top: 1px solid rgba(61, 60, 64, 0.08);
    border-bottom: 0;
    width: 100%;
    margin: 8px 0;
}

.ServerDropdown__button {
    background-color: transparent;
    border: none;
    padding: 8px 18px 8px 7px;
    display: flex;
    width: 100%;
    align-items: center;
    font-family: Open Sans;
    cursor: pointer;

    &:not(.anyDragging):hover {
        background-color: rgba(61, 60, 64, 0.08);

        .ServerDropdown__button-edit, .ServerDropdown__button-remove {
            opacity: 1;
            pointer-events: all;
        }

        .ServerDropdown__draggable-handle > i.icon-drag-vertical {
            opacity: 1;
        }
    }

    &:focus, &:focus-within {
        background-color: rgba(22, 109, 224, 0.08);
        outline: none;

        .ServerDropdown__button-edit, .ServerDropdown__button-remove {
            opacity: 1;
            pointer-events: all;
        }

        .ServerDropdown__draggable-handle > i.icon-drag-vertical {
            opacity: 1;
        }
    }

    &.dragging .ServerDropdown__draggable-handle {
        opacity: 1;
        pointer-events: all;
    }

    i {
        font-size: 18px;
        line-height: 20px;
        color: rgba(61, 60, 64, 0.56);
    }

    i.icon-server-variant, i.icon-check {
        margin-top: -1px;
    }

    &.active i.icon-check {
        color: #166de0;
    }

    > .ServerDropdown__draggable-handle > span, &.addServer > span {
        font-size: 14px;
        line-height: 20px;
        color: #3D3C40;
        margin-left: 12px;
        white-space: nowrap;
    }

    &.addServer {
        padding-left: 24px;

        > i.icon-plus {
            margin-top: -2px;

            &::before {
                margin: 0;
            }
        }
    }
}

.ServerDropdown__draggable-handle {
    cursor: pointer !important;
    display: flex;
    overflow: hidden;
    margin-right: 36px;

    &.dragging {
        cursor: grabbing !important;
    }

    > i.icon-drag-vertical {
        opacity: 0;
        margin-top: -2px;

        &::before {
            margin: 0;
            color: rgba(61, 60, 64, 0.32);
            font-size: 14px;
        }
    }

    > span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.ServerDropdown__badge {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 18px;
    min-width: 32px;
}

.ServerDropdown__badge-dot {
    background: #579EFF;
    height: 8px;
    width: 8px;
    border-radius: 8px;
    flex: 0 0 8px;
}

.ServerDropdown__badge-count {
    background: #F74343;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;

    > span {
        letter-spacing: 0.02em;
        -webkit-font-smoothing: antialiased;
        font-family: "Open Sans", sans-serif;
        line-height: 16px;
        padding: 0 2.5px;
        color: white;
        font-size: 11px;
        font-weight: bold;
    }
}

.ServerDropdown__indicators {
    margin-left: auto;
    display: flex;

    > button {
        margin-left: 14px;
        background-color: transparent;
        border: none;
        border-radius: 2px;
        padding: 0;
        cursor: pointer;

        &:hover, &:focus {
            background: rgba(61, 60, 64, 0.08);
            box-shadow: 0px 0px 0px 4px rgba(61, 60, 64, 0.08);
            outline: none;
        }

        &.ServerDropdown__button-remove:hover, &.ServerDropdown__button-remove:focus {
            background: rgba(247, 67, 67, 0.16);
            box-shadow: 0px 0px 0px 4px rgba(247, 67, 67, 0.16);
        }

        > i::before {
            margin: 0;
        }
    }
}

.ServerDropdown__button-edit, .ServerDropdown__button-remove {
    opacity: 0;
    pointer-events: none;

    &:focus {
        opacity: 1;
        pointer-events: all;
    }
}

.ServerDropdown__button-remove {
    margin-right: 7px;

    + .ServerDropdown__badge {
        margin-left: 3px;
    }

    i {
        color: #F74343;
    }
}

.ServerDropdown.darkMode {
    background: #1f1f1f;

    .ServerDropdown__header > span {
        color: #DDD;

        &.ServerDropdown__keyboardShortcut {
            color: rgba(221, 221, 221, 0.56);
        }
    }

    .ServerDropdown__divider {
        border-color: rgba(221, 221, 221, 0.08);
    }

    .ServerDropdown__button {
        &:not(.anyDragging):hover {
            background-color: rgba(221, 221, 221, 0.08);
        }

        &:focus {
            background-color: rgba(1, 119, 231, 0.08);
        }

        &:not(.active) i, i.icon-drag-vertical {
            color: rgba(221, 221, 221, 0.56);
        }

        > .ServerDropdown__draggable-handle > span, &.addServer > span {
            color: #DDD;
        }

        .ServerDropdown__button-remove i {
            color: #F74343;
        }

        .ServerDropdown__button-edit:hover, .ServerDropdown__button-edit:focus {
            background: rgba(221, 223, 228, 0.08);
            box-shadow: 0px 0px 0px 4px rgba(221, 223, 228, 0.08);
        }
    }

    .ServerDropdown__badge-expired i {
        color: rgba(221, 221, 221, 0.56);
    }

    .ServerDropdown__button-edit > i {
        color: rgba(221, 221, 221, 0.56);
    }

    .ServerDropdown__draggable-handle > i.icon-drag-vertical::before {
        color:rgba(221, 221, 221, 0.32);
    }

    .ServerDropdown__badge-count i {
        color: #e81023;
    }

    .ServerDropdown__badge-dot {
        background: #196CAF;
    }
}
