/* Copyright (C) 2019 Monomax Software Pty Ltd
 *
 * This file is part of Dnote.
 *
 * Dnote is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Dnote is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Dnote.  If not, see <https://www.gnu.org/licenses/>.
 */

@import '../App/responsive';
@import '../App/theme';
@import '../App/rem';
@import '../App/font';
@import '../App/variables';

.wrapper {
  position: relative;
  border: 1px solid $border-color;
  position: relative;
  border-radius: rem(4px);
  display: flex;
  cursor: text;
  user-select: none;

  &.disabled {
    cursor: not-allowed;
    background-color: $light-gray;
  }

  .input:disabled {
    background: inherit;
  }
}

.hidden {
  display: none;
}

.input-wrapper {
  display: inline-block;
}

.input {
  box-sizing: content-box;
  background: rgba(0, 0, 0, 0) none repeat scroll 0px center;
  border: 0px none;
  font-size: inherit;
  opacity: 1;
  outline: currentcolor none 0px;
  padding: 0px;
  color: inherit;
}
.active-input {
  margin-left: rem(8px);
}

.current-options {
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
}
.current-option-item {
  display: inline-flex;
  background-color: rgb(230, 230, 230);
  border-radius: 2px;
  margin: rem(2px);
  min-width: 0px;
  box-sizing: border-box;
  cursor: default;
}
.current-option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: rem(2px) rem(4px) rem(2px) rem(8px);
  @include font-size('small');
  border-radius: 4px;
}
.dismiss-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 rem(8px);
}

.suggestion-wrapper {
  width: 100%;
  z-index: 1;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.14);
  border: 1px solid $border-color;
  border-radius: rem(4px);
  display: none;

  &.suggestions-wrapper-shown {
    display: block;
  }
}

.suggestion {
  background: white;
  overflow-y: auto;
  max-height: rem(220px);

  @include landscape() {
    max-height: rem(140px);
  }
}

.suggestion-item {
}

.suggestion-item-button {
  padding: rem(8px) rem(12px);
  width: 100%;

  &.suggestion-item-focused,
  &:hover {
    background: $light-blue;
  }
}

.placeholder {
  color: rgb(128, 128, 128);
  margin-left: 2px;
  margin-right: 2px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
}
