/* CHANNELS */
html:not(%visualRefresh) %channelsSidebar:not(%channelsSidebarHidden) {
  width: cv('channels-width') !important;
  background: rgba(0, 0, 0, calc($bg-shading * 0.3));
}
%platformWin %channelsSidebar {
  border-radius: 0;
}
%themeDark %channelsContainer {
  background: transparent;
}

// CHANNELS HEADER
%channelsHeaderClickable, %channelsHeaderSelected {
  %channelsHeader {
    &:hover {
      background-color: hsla(0, 0%, 100%, 0.1);
    }
  }
}
%channelsHeaderContent {
  color: var(--header-primary);
  font-family: cv('font.main');
  font-weight: 600;
  text-shadow: 0 0 3px #000;
}

// GUILD BANNER
%channelBannerAnimatedContainer {
  background: transparent;
  box-shadow: none;
}
%channelBanner {
  width: cv('channels-width');
  mask: linear-gradient(to bottom, #000, transparent);
}
%channelBannerImage {
  width: cv('channels-width');
}
%threadChannelConnector {
  color: $main-color;
}
%threadChannelSpine {
  background: $main-color;
}

// SERVER BOOST
%themeDark %serverBoostProgressBar {
  background-color: cv('bg.general.card');
}

// CHANNEL CONTENT
%channelLink {
  position: relative;
  transition: all 0.15s ease-in-out;
  &:before {
    content: '';
    position: absolute;
    @include stretch;
    transition: all 0.15s ease-in-out;
    z-index: -1;
    border-radius: 4px;
  }
  &:after {
    content: '';
    position: absolute;
    @include pos(0, 100%, 0, 0);
    opacity: 0.9;
    transition: all 0.3s ease-in-out;
    z-index: -1;
    border-radius: 4px;
  }
}
%channelIcon {
  width: 18px;
  height: 18px;
  margin-right: 3px;
  color: var(--channel-color);
  transition: all 0.15s ease-in-out;
}
%channelName {
  color: var(--channel-color);
  transition: all 0.15s ease-in-out;
}
%channelButtons {
  margin-left: 1px;
  animation: cv-fade-to-3 0.15s ease-in-out;
}
%channelActionIcon {
  color: var(--channel-color);
  transition: all 0.15s ease-in-out;
  &:hover {
    color: var(--channel-hovered);
  }
}
%channelStatusText,
%channelStatusPencilIcon {
  color: hsla(0, 0%, 100%, 0.7);
}
%channelWrapper {
  // HOVER
  &:hover {
    %channelLink {
      background: var(--background-modifier-hover);
    }
    :is(%channelName, %channelIcon) {
      color: var(--channel-hovered); 
    }
  }
  // UNREAD
  &%channelWrapperUnread {
    %channelName {
      color: var(--channel-unread);
      text-shadow: 0 0 3px;
    }
    %channelIcon {
      color: var(--channel-unread);
      filter: drop-shadow(0 0 3px);
    }
    &:hover {
      :is(%channelName, %channelIcon) {
        color: var(--channel-selected);
      }
    }
  }
  // SELECTED
  &%channelWrapperSelected {
    :is(%channelName, %channelIcon) {
      color: var(--channel-selected);
    }
    %channelLink {
      background-color: transparent;
      &:before {
        background: hsla(0, 0%, 100%, 0.1);
      }
      &:after {
        right: 0;
        background: $main-color;
        animation: cv-channel-select 0.3s ease-in-out;
      }
    }
    %textExtraSmallMedium,
    %textExtraSmallNormal {
      color: #fff !important;
    }
  }

  // CONNECTED
  &%channelWrapperConnected {
    %channelName {
      color: var(--channel-unread);
      text-shadow: 0 0 3px;
    }
    %channelIcon {
      color: var(--channel-unread);
      filter: drop-shadow(0 0 3px);
    }
  }
  // MUTED
  &%channelWrapperMuted {
    :is(%channelName, %channelIcon) {
      color: var(--channel-muted);
    }
    &:hover {
      :is(%channelName, %channelIcon) {
        color: var(--channel-color);
        
      }
    }
  }
}

// UNREAD & MENTIONS INDICATION
%channelUnreadPill {
  display: none;
}

// ICONS
%channelIconLive {
  background-color: $main-color !important;
}

// USER LIMIT
%channelUserLimitUsers,
%channelUserLimitTotal {
  width: 24px;
  color: hsla(0, 0%, 100%, 0.3);
  font-weight: 600;
  text-align: right;
  transition: all 0.15s ease-in-out;
}
%channelUserLimitUsers {
  padding: 0 4px 0 6px;
  background: rgba(0, 0, 0, 0.15);
}
%channelUserLimitTotal {
  padding: 0 6px 0 4px;
  background: hsla(0, 0%, 100%, 0.04);
  box-shadow: inset 1px 0 hsla(0, 0%, 100%, 0.07);
  &:after {
    display: none;
  }
}
%channelWrapperConnected {
  %channelUserLimitUsers {
    color: $main-color;
    text-shadow: 0 0 1px;
  }
}

// VOICE USER LIST
%voiceUserList {
  padding-left: 24px;
  %voiceUserClickable:hover %voiceUserContent {
    background: rgba(0, 0, 0, 0.04);
  }
}

%voiceUser {
  z-index: 1;
  %voiceUserContent {
    border-radius: 3px;
    transition: all 0.15s ease-in-out;
  }
  &:hover,
  &:active,
  &%voiceUserSelected {
    %channels %voiceUserList & {
      %voiceUserContent {
        background: hsla(0, 0%, 100%, 0.04);
      }
      %voiceUserName {
        color: hsla(0, 0%, 100%, 0.7);
      }
    }
  }
  %voiceUserAvatarSpeaking {
    position: relative;
    transition: all 0.1s ease-in-out;
    &:after {
      content: '';
      position: absolute;
      height: 1.7em;
      background: linear-gradient(to right, $main-color 10%, transparent);
      opacity: 0.5;
      transition: all 0.1s ease-in-out, width 0.15s ease-in-out;
      pointer-events: none;
      z-index: -1;
      border-radius: 999px;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
  %voiceUserAvatarSpeaking {
    box-shadow: 0 0 0 2px $main-color, inset 0 0 3px rgba(0, 0, 0, 0.5);
    &:after {
      @include pos($top: -2px, $bottom: -2px);
      width: 150px;
    }
  }
  %voiceUserName {
    color: hsla(0, 0%, 100%, 0.5);
    transition: all 0.1s ease-in-out;
  }
  %voiceUserNameSpeaking {
    color: #fff !important;
  }
}
%voiceChannelsButton {
  border: 1px solid $main-color;
  &:hover {
    background: $hover-color;
    border: 1px solid $hover-color;
    transition: ease-in-out 0.15s;
  }
}

// USER SUMMARY
%userSummaryIcon {
  width: 18px;
  height: 18px;
  margin-right: 3px;
  color: hsla(0, 0%, 100%, 0.3);
}
%userSummaryMoreUsers {
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

// DRAG INDICATORS
%categoryContainerDrag,
%channelContainerDrag {
  &:before,
  &:after {
    background: $main-color;
    border-radius: 0;
  }
}
%channelContainerUserOver {
  &:after {
    background: $main-color;
    border-color: transparent;
    opacity: 0.1;
  }
}

// VC STREAM POPOUT
%themeDark {
  %streamPopoutPreview {
    background-color: cv('bg.general.popout');
  }
  %streamPopoutPreviewContainer {
    background-color: transparent;
  }
  %streamPopoutWatchButton {
    border-color: $main-color;
    color: hsla(0, 0%, 100%, 0.8);
    &:not([disabled]):hover {
      border-color: $hover-color;
      color: #fff;
    }
  }
}