/*

███████╗███████╗███╗   ███╗ █████╗ ███╗   ██╗████████╗██╗ ██████╗    ██╗   ██╗██╗
██╔════╝██╔════╝████╗ ████║██╔══██╗████╗  ██║╚══██╔══╝██║██╔════╝    ██║   ██║██║
███████╗█████╗  ██╔████╔██║███████║██╔██╗ ██║   ██║   ██║██║         ██║   ██║██║
╚════██║██╔══╝  ██║╚██╔╝██║██╔══██║██║╚██╗██║   ██║   ██║██║         ██║   ██║██║
███████║███████╗██║ ╚═╝ ██║██║  ██║██║ ╚████║   ██║   ██║╚██████╗    ╚██████╔╝██║
╚══════╝╚══════╝╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═╝ ╚═════╝     ╚═════╝ ╚═╝

  Import this file into your LESS project to use Semantic UI without build tools
*/

// Those fomantic-ui-css/*.scss don't exist in the package, but we create them
// via scripts/link-scss-files.sh on postinstall, so we can include theme
// under a class namespace

/* Global */
@import "~fomantic-ui-css/components/reset.css";
// we use our custom site css here to avoid loading google font
@import "./site";

/* Elements */
@import "~fomantic-ui-css/components/button.css";
@import "~fomantic-ui-css/components/container.css";
@import "~fomantic-ui-css/components/divider.css";
// @import "~fomantic-ui-css/components/flag.css";
@import "~fomantic-ui-css/components/header.css";
@import "~fomantic-ui-css/components/icon.css";
@import "~fomantic-ui-css/components/image.css";
@import "~fomantic-ui-css/components/input.css";
@import "~fomantic-ui-css/components/label.css";
@import "~fomantic-ui-css/components/list.css";
@import "~fomantic-ui-css/components/loader.css";
@import "~fomantic-ui-css/components/placeholder.css";
// @import "~fomantic-ui-css/components/rail.css";
// @import "~fomantic-ui-css/components/reveal.css";
@import "~fomantic-ui-css/components/segment.css";
@import "~fomantic-ui-css/components/step.css";

/* Collections */
// @import "~fomantic-ui-css/components/breadcrumb.css";
@import "~fomantic-ui-css/components/form.css";
@import "~fomantic-ui-css/components/grid.css";
@import "~fomantic-ui-css/components/menu.css";
@import "~fomantic-ui-css/components/message.css";
@import "~fomantic-ui-css/components/table.css";

/* Views */
// @import "~fomantic-ui-css/components/ad.css";
@import "~fomantic-ui-css/components/card.css";
// @import "~fomantic-ui-css/components/comment.css";
@import "~fomantic-ui-css/components/feed.css";
@import "~fomantic-ui-css/components/item.css";
@import "~fomantic-ui-css/components/statistic.css";

/* Modules */
// @import "~fomantic-ui-css/components/accordion.css";
@import "~fomantic-ui-css/components/checkbox.css";
@import "~fomantic-ui-css/components/dimmer.css";
@import "~fomantic-ui-css/components/dropdown.css";
// @import "~fomantic-ui-css/components/embed.css";
@import "~fomantic-ui-css/components/modal.css";
// @import "~fomantic-ui-css/components/nag.css";
@import "~fomantic-ui-css/components/popup.css";
@import "~fomantic-ui-css/components/progress.css";
// @import "~fomantic-ui-css/components/rating.css";
@import "~fomantic-ui-css/components/search.css";
// @import "~fomantic-ui-css/components/shape.css";
@import "~fomantic-ui-css/components/sidebar.css";
@import "~fomantic-ui-css/components/sticky.css";
@import "~fomantic-ui-css/components/tab.css";
@import "~fomantic-ui-css/components/text.css";
@import "~fomantic-ui-css/components/toast.css";
@import "~fomantic-ui-css/components/transition.css";



// we do the import here instead in main.js
// as resolve order is not deterministric in webpack
// and we end up with CSS rules not applied,
// see https://github.com/webpack/webpack/issues/215
@import "./vendor/media";

$desktop-sidebar-width: 275px;
$widedesktop-sidebar-width: 275px;
$bottom-player-height: 4rem;

html,
body {
  @include media("<=desktop") {
    font-size: 90%;
  }
}

html {
  scroll-behavior: smooth;
}
@media screen and (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  &.has-bottom-player {
    padding-bottom: $bottom-player-height;
    .toast-container {
      bottom: $bottom-player-height + 1rem;
    }
  }
}

#footer {
  border-bottom: none;
  border-top: 1px solid rgba(34, 36, 38, 0.15);
}
#app > main, #app > .main {
  flex: 1;
}

.instance-chooser {
  margin-top: 2em;
}

.ui.wide.left.sidebar {
  @include media(">desktop") {
    width: $desktop-sidebar-width;
  }

  @include media(">widedesktop") {
    width: $widedesktop-sidebar-width;
  }
}

#app {
  > .main.pusher,
  > .footer {
    position: relative;
    @include media(">desktop") {
      margin-left: $desktop-sidebar-width !important;
    }

    @include media(">widedesktop") {
      margin-left: $widedesktop-sidebar-width !important;;
    }
    transform: none !important;
  }
}

.main.pusher.hidden {
  display: none;
}
.main.pusher > .ui.secondary.menu {
  margin-left: 0;
  margin-right: 0;
  border: none;
  overflow-y: auto;
  .ui.item {
    border: none;
    border-bottom-style: none;
    margin-bottom: 0px;
  }
  @include media(">tablet") {
    padding: 0 2.5rem;
  }
  .item {
    padding-top: 1.5em;
    padding-bottom: 1.5em;
  }
}

.ui.stripe.segment,
#footer {
  padding: 1em;
  &.ui.container {
    margin: 0;
  }
  @include media(">tablet") {
    padding: 2em;
  }
  @include media(">widedesktop") {
    padding: 3em;
  }
}

.stripe.segment > .secondary.menu:last-child {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-bottom: none;
}
.center.aligned.menu {
  justify-content: center;
}
.text.center.aligned {
  text-align: center;
}
.ellipsis:not(.icon) {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ellipsis-rows tr > {
  td:nth-child(1) {
    max-width: 4em;
  }
  td:nth-child(2) {
    position: relative;
    &:before {
      content: '&nbsp;';
      visibility: hidden;
    }
    > * {
      position: absolute;
      left: 0;
      right: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-right: 0.5em;
    }
  }
}
.ui.small.text.container {
  max-width: 500px !important;
}

.button.icon.tiny {
  padding: 0.5em !important;
}

.sidebar {
  .logo {
    &.bordered.icon {
      padding: .5em .41em !important;
    }
    path {
      fill: white;
    }
  }
  .tab {
    flex-direction: column;
  }
}

.link {
  cursor: pointer;
}

.ui.really.basic.button {
  &:not(:focus) {
    box-shadow: none !important;
    background-color: none !important;
  }
}

.floated.buttons .button ~ .dropdown {
  border-left: none;
}

.ui.icon.header .circular.icon {
  display: flex;
  justify-content: center;
}

.header-buttons > .buttons {
  display: inline-block;
  padding: 0.2em;
  margin: 0;
  font-size: 1em;
  .buttons {
    margin: 0;
  }

}

a {
  cursor: pointer;
}
.segment.hidden {
  display: none;
}
.hidden:not(.divider) {
  display: none !important;
}

.nomargin {
  margin: 0 !important;
}
button.reset {
  border: none;
  margin: 0;
  padding: 0;
  width: auto;
  overflow: visible;

  background: transparent;

  /* inherit font & color from ancestor */
  color: inherit;
  font: inherit;

  /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */
  line-height: normal;

  /* Corrects font smoothing for webkit */
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;
  /* Corrects inability to style clickable `input` types in iOS */
  -webkit-appearance: none;
  text-align: inherit;
}

.text.align.left {
  text-align: left;
}
.ui.table > caption {
  font-weight: bold;
  padding: 0.5em;
  text-align: left;
}
[role="button"] {
  cursor: pointer;
}

.left.floated {
  float: left;
}

.right.floated {
  float: right;
}


[data-tooltip]::after {
  white-space: normal;
  width: 500px;
  max-width: 500px;
  z-index: 999;
}

label .tooltip {
  margin-left: 1em;
}

.ui.list .list.icon {
  padding-left: 0;
}


.ui.dropdown .item[disabled] {
  display: none;
}

span.diff.added {
  background-color:rgba(0, 255, 0, 0.25);
}


span.diff.removed {
  background-color: rgba(255, 0, 0, 0.25);
}

.table-wrapper {
  display: block;
  overflow-x: auto;
}

td.align.right {
  text-align: right;
}

.ui.pagination.menu {
  margin-top: 1em;
  + span {
    margin-left: 1em;
  }
}

.card .description {
  word-wrap: break-word;
}

.ui.checkbox label {
  cursor: pointer;
}

input + .help {
  margin-top: 0.5em;
}


.expandable {
  &:not(.expanded) {
    overflow: hidden;
    max-height: 15vh;
    background: linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0.3) 100%);
  }
}

.ui.borderless.button {
  border: none !important;
  box-shadow: none !important;
  padding-left: 0;
  padding-right: 0;
}
.column .ui.text.container {
  max-width: 100% !important;
}

.ui.small.divider {
  margin: 0.5rem 0;
}
.ui.very.small.divider {
  margin: 0.25rem 0;
}
.ui.horizontal.divider {
  display: inline-block;
  margin: 0 0.5em;
}

.queue.segment.player-focused #queue-grid #player {
  @include media("<desktop") {
    padding-bottom: $bottom-player-height + 2rem;
  }
}
.queue-controls {

  @include media("<desktop") {
    height: $bottom-player-height;
  }
}

.desktop-and-up {
  @include media("<desktop") {
    display: none !important;
  }
}
.tablet-and-up {
  @include media("<tablet") {
    display: none !important;
  }
}
.tablet-and-below {
  @include media(">desktop") {
    display: none !important;
  }
}
.mobile-only {
  @include media(">tablet") {
    display: none !important;
  }
}
:not(.menu) > {
  a, .link {
    &:not(.button):not(.list) {
      &:hover {
        text-decoration: underline;
      }
    }
  }
}
.ui.cards.app-cards {
  $card-width: 14em;
  $card-height: 23em;
  $small-card-width: 11em;
  $small-card-height: 20em;
  .app-card {
    display: flex;
    width: $small-card-width;
    height: $small-card-height;
    font-size: 95%;
    @include media(">tablet") {
      font-size: 100%;
      width: $card-width;
      height: $card-height;
    }
    .content:not(.extra) {
      padding: 0.25em 0.5em 0;
      @include media(">tablet") {
        padding: 0.5em 1em 0;
      }
    }
    .content.extra {
      padding: 0.25em 0.5em;
      @include media(">tablet") {
        padding: 0.5em 1em;
      }
    }
    .head-image {
      height: $small-card-width;
      @include media(">tablet") {
        height: $card-width;
      }
      background-size: cover !important;
      background-position: center !important;
      display: flex !important;
      justify-content: flex-end !important;
      align-items: flex-end !important;
      .button {
        margin: 0;
      }
      &.circular {
        overflow: visible;
        border-radius: 50% !important;
        width: $small-card-width - 0.5em;
        height: $small-card-width - 0.5em;
        margin: 0.25em;
        @include media(">tablet") {
          width: $card-width - 1em;
          height: $card-width - 1em;
          margin: 0.5em;
        }

      }
      &.padded {
        margin: 0.5em;
        border-radius: 0.25em !important;
      }
      &.squares {
        display: block !important;
        position: relative;
        margin-bottom: -1px;
        .button {
          position: absolute !important;
          bottom: 0.5em;
          right: 0.5em;
        }
        img {
          display: inline-block;
          width: 50%;
          height: 50%;
          margin: 0;
          border-radius: 0;
          margin-bottom: -4px;
        }
        img:nth-child(1) {
          border-top-left-radius: 3px;
        }
        img:nth-child(2) {
          border-top-right-radius: 3px;
        }
      }
    }
    .extra {
      border-top: 0 !important;
    }
    .content:not(.extra) {
      &, & * {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-bottom: 0;
      }
    }
    .floating.dropdown > .icon {
      margin-right: 0;
    }
  }
}

//  channels stuff
@mixin two-images {
  margin-right: 1em;
  position: relative;
  width: 3.5em;
  height: 3.5em;
  &.large {
    width: 15em;
    height: 15em;
    img {
      width: 11em;
    }
  }
  img {
    width: 2.5em;
    position: absolute;
    &:last-child {
      bottom: 0;
      left: 0;
    }
    &:first-child {
      top: 0;
      right: 0;
    }
  }
}
.two-images {
  @include two-images;
}
.channel-entry-card, .channel-serie-card {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  .controls {
    margin-right: 1em;
  }
  .image {
    width: 3em;
    height: 3em;
    margin-right: 1em;
    line-height: 3em;
    text-align: center;
    font-weight: bold;
  }
  .two-images {
    @include two-images;
  }
  .content {
    flex-grow: 1;
  }
}
.album-entries {
  > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .content {
    flex-grow: 1;
  }
}
.ui.artist-label {
  .icon {
    width: 2em;
  }
  &.rounded {
    border-radius: 5em;
    padding: 0.2em 0.75em 0.2em 0.2em;
    line-height: 2em;
    img {
      border-radius: 50%;
      vertical-align: middle;
    }
  }
}
.album-entry, .channel-entry-card {
  border-radius: 5px;
  padding: 0.5em;
  .meta {
    text-align: right;
    min-width: 7em;
  }
  > div {
    padding: 0.25em;
    &:not(:last-child) {
      margin-right: 0.25em;
    }
  }
  &.active {
    background: rgba(155, 155, 155, 0.2);
  }
  &:hover {
    background: rgba(155, 155, 155, 0.1);
  }
  .favorite-icon.tiny.button {
    border: none !important;
    padding: 0 !important;
    margin: 0 0.5em;
  }
}
.channel-image {
  border: 1px solid rgba(0, 0, 0, 0.15);
  background-color: white;
  border-radius: 0.3em;
  &.large {
    width: 8em !important;
  }
}
.content-form {
  .segment:first-child {
    min-height: 15em;
  }
  .ui.secondary.menu {
    margin-top: -0.5em;
  }
  .input {
    width: 100%;
  }
}
.placeholder.image {
  background-color: rgba(0,0,0,.08);
  width: 3em;
  height: 3em;
  &.large {
    width: 8em;
    height: 8em;
  }
  max-width: 100%;
  display: block;
  &.circular {
    border-radius: 50%;
  }
  &.static {
    animation: none;
  }
}
.channel-type.field .radio {
  display: block;
  padding: 1.5em;
  &.selected {
    background-color: rgba(0, 0, 0, 0.05);
  }
}
.header.with-actions {
  @include media(">tablet") {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .actions {
    font-weight: normal;
    font-size: 0.6em;
  }

}
.file-uploads.channels.ui.button {
  display: block;
  padding: 2em 1em;
  width: 100%;
  box-shadow: none;
  border-style: dashed !important;
  border: 2px solid rgba(50, 50, 50, 0.5);
  font-size: 1.2em;
  padding: 0;
  > div:not(.divider) {
    padding: 1em;
  }
}

.channel-file {
  display: flex;
  align-items: top;
  margin-bottom: 1em;
  > :first-child {
    width: 3em;
  }
  .header {
    margin: 0 1em;
    .sub.header {
      margin-top: 0.5em;
    }
  }
}
.modal > .header {
  text-align: center;
}
.ui.header .content {
  display: block;
}
.with-image.item {
  display: flex !important;
  align-items: center;
  height: 3em;
  img.image {
    width: 3em;
    height: 3em;
    margin-right: 1em;
  }
  .icon.image {
    width: 3em;
    margin-right: 1em;
    display: block;
  }
  .content {
    font-size: 1em;
  }
  .meta {
    margin-top: 0.5em;
    font-size: 0.8em;
  }
}
.button-group {
  > *:not(:first-child) {
    margin-left: 0.5em;
  }
}
@import "./themes/_light.scss";
@import "./themes/_dark.scss";
