@import "./common/flags.less";

.react-tel-input {
  .form-control {
    position: relative;
    font-size: 14px;
    letter-spacing: .01rem;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-left: 48px;
    margin-left: 0;
    background: #FFFFFF;
    border: 1px solid #CACACA;
    border-radius: 5px;
    line-height: 25px;
    height: 35px;
    width: 300px;
    outline: none;
    &:hover {
      border-color: #a2a2a2;
    }
    &.invalid-number {
      border: 1px solid #d79f9f;
      background-color: #FAF0F0;
      border-left-color: #cacaca;
      &:focus {
        border: 1px solid #d79f9f;
        border-left-color: #cacaca;
        background-color: #FAF0F0;
      }
    }
    &.open {
      box-shadow: rgba(34, 36, 38, 0.15) 0px 2px 3px 0px;
      border-color: rgb(150, 200, 218);
      border-radius: 5px 5px 0 0;
      border-bottom: none;
      box-shadow: none;
    }
  }
  .flag-dropdown {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0;
    background-color: #f5f5f5;
    border: 1px solid #cacaca;
    border-radius: 3px 0 0 3px;
    &:hover, &:focus {
      cursor: pointer;
    }
    &.open {
      background: #fff;
      border-radius: 3px 0 0 0;
      .selected-flag {
        background: #fff;
        border-radius: 3px 0 0 0;
      }
    }
  }
  input[disabled] {
    &+.flag-dropdown {
      &:hover {
        cursor: default;
        .selected-flag {
          background-color: transparent;
        }
      }
    }
  }
  .selected-flag {
    outline: none;
    position: relative;
    width: 38px;
    height: 100%;
    padding: 0 0 0 8px;
    border-radius: 3px 0 0 3px;
    &:hover, &:focus {
      background-color: #fff;
    }
    .flag {
      position: absolute;
      top: 50%;
      margin-top: -5px;
    }
    .arrow {
      position: relative;
      top: 50%;
      margin-top: -2px;
      left: 20px;
      width: 0;
      height: 0;
      border-left: 3px solid transparent;
      border-right: 3px solid transparent;
      border-top: 4px solid #555;
      &.up {
        border-top: none;
        border-bottom: 4px solid #555;
      }
    }
    &.open {
      z-index: 2;
    }
  }
  .country-list {
    outline: none;
    z-index: 1;
    border-radius: 0 0 5px 5px;
    border: 1px solid rgb(150, 200, 218);
    border-top: none;
    list-style: none;
    position: absolute;
    padding: 0;
    margin: 0px 0 10px -1px;
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.12);
    background-color: white;
    width: 300px;
    max-height: 200px;
    overflow-y: scroll;
    .flag {
      display: inline-block;
    }
    .divider {
      padding-bottom: 5px;
      margin-bottom: 5px;
      border-bottom: 1px solid #ccc;
    }
    .country {
      padding: 7px 9px;
      .dial-code {
        color: #6b6b6b;
      }
      &:hover {
        background-color: #f1f1f1;
      }
      &.highlight {
        background-color: #f1f1f1;
      }
    }
    .flag {
      margin-right: 7px;
      margin-top: 2px;
    }
    .country-name {
      margin-right: 6px;
    }
    .search {
      position: sticky;
      top: 0;
      background-color: #fff;
      padding: 5px 0 6px 10px;
    }
    .search-emoji {
      display: none;
      font-size: 15px;
    }
    .search-box {
      border: 1px solid #cacaca;
      border-radius: 3px;
      font-size: 15px;
      line-height: 15px;
      padding: 3px 8px 5px;
      outline: none;
    }
    .no-entries-message {
      padding: 7px 10px 11px;
      opacity: .7;
    }
    &::-webkit-scrollbar { width: 12px; }
    &::-webkit-scrollbar-track { background-color: #e6e6e6; }
    &::-webkit-scrollbar-thumb { background-color: #c5c5c4; border-radius: 5px; }
  }
  .invalid-number-message {
    position: absolute;
    z-index: 1;
    font-size: 13px;
    left: 46px;
    top: -8px;
    background: #fff;
    padding: 0 2px;
    color: #de0000;
  }
  .special-label {
    display: none;
    position: absolute;
    z-index: 1;
    font-size: 13px;
    left: 46px;
    top: -8px;
    background: #fff;
    padding: 0 2px;
    white-space: nowrap;
  }
}
