.badge {
  display: inline-block;
  position: relative;
  background-color: var(--color-white);
  color: #231F20;
  font-size: 16px;
  font-weight: 400;
  padding: 6px 16px 5px 16px;
  min-width: 130px;
  margin-right: 16px;
  margin-bottom: 5px;
  border-radius: 25px;
  /*min-width: 70px;*/
  text-align: center;
  z-index: 1;
}

.badge.has-hidden-text {
  z-index: 3;
}

.badge .hidden-text {
  background-color: var(--color-white);
}

.badge .badge-icon {
  width: 18px;
  height: 18px;
}

.badge.green {
  background-color: #CEF5D9;
  color: var(--color-green-30, #277F36);
}

.badge.red {
  background-color: var( --color-red-10, #FACCC2 );
  color: var( --color-red-20, #C53A1F );
}

.badge.purple {
  background-color: var( --color-purple-10, #D9C2FF );
  color: var( --color-purple-20, #7745C8 );
}

.badge.blue,
.badge.blue .hidden-text {
  background-color: #EBF3FF;
  color: var(--color-primary);
}

.badge.blue.has-hidden-text {
  outline: 1px solid #deebff;
}

.badge.grey {
  background-color: var(--color-background-grey);
  color: #999;
}

.badge.yellow {
  background-color: var( --color-yellow-20, #FCE8B3 );
  color: var( --color-yellow-30, #98792D)
}

.badge.bold {
  font-weight: 600;
}

.badge.small {
  font-size: 12px;
  padding: 5px 10px;
  margin-right: 5px;
  border-radius: 15px;
  font-weight: 300;
}

.badge.no-padding {
  padding: 0;
  min-width: unset;
  background: none;
}

.badge.border-yellow {
  border: 1px solid #FFCE00;
}

.badge.open {
  z-index: 4;
}

.badge > img {
  /*max-height: 12px;*/
  max-height: 20px;
  vertical-align: middle;
  margin-right: 7px;
}

.badge.remote > img {
  max-height: 15px;
}

.badge.is-abroad > img {
  max-height: 16px;
}

.badge.no-bg {
  background-color: transparent;
}

.badge.blue.has-hidden-text:not(.small):hover,
.badge.blue.has-hidden-text:not(.small):hover .hidden-text {
  background-color: #C8DAF8;
  outline: none;
}

.badge:hover ~ .badge { /* make sure the badge tooltip is *above* any other badges */
  z-index: 1;
}

.badge.has-hidden-text .hidden-text {
  position: absolute;
  padding: 6px 16px 5px 20px;
  margin-top: -6px;
  top: 6px;
  border-radius: 15px;
  left: calc(100% - 55px);
  opacity: 0;
  width: auto;
  z-index: -1;
  font-size: 15px;
  transform: translateX(9999px);
  white-space: nowrap;
  transition: opacity 0.2s ease-in-out 0s, left 0.2s ease-in-out 0s, transform 0s linear 0.2s;
}

.badge:hover:not(.small) .hidden-text {
  left: calc(100% - 30px);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.2s ease-in-out 0s, left 0.2s ease-in-out 0s;
}

.w-mod-touch .badge .hidden-text { /* This causes issues on ipad. We don't need it on touch devices anyway */
  display: none;
}

.badge .badge-toggle {
  transform: rotate(90deg);
  height: 13px;
  margin-left: 2px;
  margin-top: 2px;
  transition: all 0.2s ease-in-out;
}

.badge.open .badge-toggle {
  transform: rotate(-90deg);
}

.badge .badge-tooltip {
  position: absolute;
  display: block;
  padding: 17px 14px 12px;
  min-width: 200px;
  max-width: 280px;
  top: calc( 100% - 6px );
  left: 3px;
  font-size: 10px;
  font-weight: 100;
  color: #999;
  background-color: var(--color-white);
  border-radius: 5px;
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(9999px);
  transition: opacity 0.2s ease-in-out 0s, top 0.2s ease-in-out 0s, transform 0s linear 0.2s;
  z-index: 4;
}

.badge:hover:not(.small) .badge-tooltip,
.badge.open .badge-tooltip {
  top: calc( 100% - 1px );
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.2s ease-in-out 0s, top 0.2s ease-in-out 0s;
}

.w-mod-touch .badge .badge-tooltip { /* The tooltip causes issues on ipad. We don't need it on touch devices anyway */
  display: none;
}

.badge .badge-tooltip::before {
  content: '';
  display: block;
  position: absolute;
  top: -6px;
  left: 10px;
  width: 20px;
  height: 20px;
  background-color: var(--color-white);
  transform: rotate(45deg);
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.05);
}

.badge .badge-tooltip span {
  display: block;
  line-height: 1.5;
  text-align: left;
  font-size: 10px
}

.badge .badge-tooltip > a {
  display: block;
  text-align: left;
  color: #304ffe;
  font-weight: bold;
  text-decoration: underline;
}

.badge .badge-tooltip .tooltip-title {
  font-size: 12px;
  font-weight: bold;
  color: black;
  margin-bottom: 5px;
}

/* hybrid badge styling */
.badge.hybrid {
  background: linear-gradient(to right, white, #CEF5D9);
}

.badge.hybrid, 
.badge.hybrid a {
  color: #231F20;
}

.badge .suffix-hybrid {
  position: relative;
  display: inline-block;
  padding-left: 0.6em;
  margin-left: 0.2em;
  border-left: 1px solid #127C30;
  color: #127C30;
  font-weight: bold;
}
/* end of hybrid badge styling */

/* Badge counts */
.badge-count {
  position: relative;
  padding-top: 4px;
  font-size: 22px;
  font-weight: 500;
  color: var(--color-white);
  line-height: 2;
  text-shadow: 0 0 1px #1e1d1d;
  z-index: 1;
}

.badge-count::after {
  content: '';
  position: absolute;
  display: block;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}
  /* bright green */
.badge-count.badge-bright-green {
  color: #127C30;
}

.badge-count.badge-bright-green::after {
  background-color: #B3F7D6;
}

  /* red */
.badge-count.badge-red {
  color: #750808;
}

.badge-count.badge-red::after {
  background-color: #F5CECE;
}
/* END Badge counts */

/********** INPUT TAGS *********/
.input-tag {
  position: relative;
  background-color: #d5d5d5;
  color: black;
  padding: 5px 25px 5px 10px;
  text-align: center;
  margin-right: 10px;
  border-radius: 5px;
  font-size: 14px;
}

.input-tag .btn-close {
  position: absolute;
  top: 5px;
  right: 0;
  filter: none;
  color: black;
}

/* Small */
@media screen and (max-width: 950px) {
  .badge {
    padding: 0 !important;
    background-color: transparent !important;
    text-align: left;
    font-size: 12px;
    margin-right: 2px;
    min-width: 70px;
  }

  .badge > img {
    margin-right: 2px;
  }

  .badge.remote > img {
    display: none;
  }

  .badge.has-hidden-text {
    z-index: 1; /* we don't want this to be clickable on mobile */
  }

  .badge.blue.has-hidden-text {
    outline: none;
  }

  .badge .hidden-text {
    display: none;
  }

  .badge .badge-tooltip,
  .badge.open .badge-tooltip {
    display: none;
  }

  .badge.open .badge-tooltip.tooltip {
    top: calc( 100% + 10px );
    left: unset;
    right: -15px;
    font-size: 10px;
  }

  .badge.open .badge-tooltip::before {
    right: 10px;
    left: unset;
  }

  .badge.hybrid {
    background: none;
  }

  /* disable the badge toggle on mobile (DVB-854) */
  .badge .badge-toggle.mobile-only {
    display: none;
  }

}