// See includePaths in webpack-config module
@import "variables";

// $fluent-color-base: #008a00;
$fluent-color-base: rgb(0, 138, 0);

// $fluent-color-invisible: #566b8d
$fluent-color-invisible: rgb(155, 40, 40);

// $fluent-color-invisible-text
$fluent-color-invisible-text: $text-muted;

// $fluent-color-localised: #660ff2
$fluent-color-localised: rgb(102, 15, 242);

// Fix cms-menu collapsed for dropdown
.cms-menu.collapsed {
  .cms-menu-list {
    float: left;
  }

  .cms-fluent-selector .text {
    display: none;
  }

  .cms-fluent-selector-locales {
    width: 100%;

    .full-title {
      display: none;
    }

    .short-title {
      display: block;
    }
  }
}

.cms-tree.jstree .status-fluentinvisible > a {
  // These styles should be applied only to the SiteTree item, not the whole sub-tree
  color: $fluent-color-invisible-text;
}

// Style of selector dropdown
.cms-fluent-selector {
  display: block;
  height: auto;
  line-height: $line-height-sm;
  overflow: visible;
  padding: 5px;
  position: relative;

  &:before {
    color: #fff;
    position: absolute;
    top: 50%;
    line-height: 0;
    right: 24px;
    width: 0;
    pointer-events: none;

    .cms-panel-layout.collapsed & {
      right: 36px;
    }
  }

  .cms-fluent-selector-locales {
    background-color: #368b39;
    background-image: url("../images/menu-icon-24-white.png");
    background-position: 6px center;
    background-repeat: none;
    background-size: 12px;
    border-radius: 5px;
    border: 0 none;
    color: #fff;
    padding: 5px 21px 5px 24px;
    width: 100%;

    .cms-panel-layout.collapsed & {
      // hide text on main dropdown when collapsed, show icon only
      color: transparent;
      padding: 2px;

      > option {
        color: #fff;
      }
    }
  }
}

// Styles for the custom badges that are pushed into the CMS breadcrumbs
.fluent-badge {
  color: $white;
  margin-left: 5px;

  &--default {
    background-color: $fluent-color-base;
  }

  &--invisible {
    background-color: $fluent-color-invisible;
  }

  &--localised {
    background-color: $fluent-color-localised;
  }
}

.fluent__localised-field .font-icon-translatable {
  color: $fluent-color-localised;
  top: 2px;
  position: relative;
  margin-right: 3px;
}

// Styles for extra actions menu
.cms .ss-ui-action-tabset.ss-tabset.fluent-actions-menu {
  margin-left: 5px;

  // button
  .popover-actions-simulate .ui-tabs-anchor {
    font-size: 1em;
    color: #303b4d;

    &:before {
      margin-right: 6px;
      font-size: 1.5rem;
    }

    &,
    &:hover,
    &:active {
      &:after {
        display: none !important;// sass-lint:disable-line no-important
      }
    }
  }

  // Popup menu
  .tab-pane {
    padding-top: 0;
    max-width: 500px;

    .action-description {
      font-size: 0.9em;
      line-height: 1em;
      display: block !important;// sass-lint:disable-line no-important
      margin: 0;
      padding: 0 11px 8px;
      border-bottom: 1px solid #ccc;
      color: #999;

      &:last-child {
        border-bottom: 0 none;
      }
    }
  }
}

.action-group-COPY_FROM .action-menu__toggle:before, // sass-lint:disable-line class-name-format
.action-group-COPY_TO .action-menu__toggle:before { // sass-lint:disable-line class-name-format
  font-family: inherit !important;// sass-lint:disable-line no-important
  line-height: 1em;
  font-size: 1em;
}

// Gridfield menu items
.action-group-COPY_FROM .action-menu__toggle:before {// sass-lint:disable-line class-name-format
  // force ... to turn into actual title
  // @todo i18n this
  content: "Copy from" !important;// sass-lint:disable-line no-important
}

.action-group-COPY_TO .action-menu__toggle:before {// sass-lint:disable-line class-name-format
  // force ... to turn into actual title
  // @todo i18n this
  content: "Copy to" !important;// sass-lint:disable-line no-important
}

// gridfield "visible locales" column
.fluent-visible-column .badge {
  font-size: 0.8em;
  padding: 3px 5px;
}
