@mixin grid-select-smart-grid-element {
  &[appearance_allow-hover] {

    smart-grid-cell:not([focus]) {
      &:hover {
        &:not(.smart-add-new-column) {
          background: var(--smart-ui-state-hover);
          color: var(--smart-ui-state-color-hover);

          .smart-label {
            background: var(--smart-ui-state-hover) !important;
            color: var(--smart-ui-state-color-hover) !important;
          }
        }
      }
    }

    &:not([selection_allow-cell-selection]) {
      smart-grid-row:hover {
        smart-grid-cell:not([focus]) {
          background: var(--smart-ui-state-hover);
          color: var(--smart-ui-state-color-hover);

          .smart-label {
            background: var(--smart-ui-state-hover) !important;
            color: var(--smart-ui-state-color-hover) !important;
          }
        }
      }
    }
  }

  &:not([selection_allow-cell-selection]) {
    &[focus] {
      &[appearance_show-selection-on-top] {
        smart-grid-row[focus] {

          smart-grid-cell:not([editor]):not([header]),
          smart-grid-cell:not([editor]):not([header]) .smart-label {
            background: rgba(var(--smart-primary-rgb), 0.7) !important;
            color: var(--smart-primary-color) !important;
            border-color: var(--smart-primary) !important;
          }
        }
      }

      smart-grid-row[focus] {
        >.smart-grid-cell-container {

          smart-grid-cell:not([editor]):not([header]),
          smart-grid-cell:not([editor]):not([header]) .smart-label:not([style]) {
            background: rgba(var(--smart-primary-rgb), 0.7) !important;
            color: var(--smart-primary-color) !important;
            border-color: var(--smart-primary) !important;
          }

          smart-grid-cell:not([editor]):not([header]) {
            &:before {
              background: var(--smart-primary);
            }
          }
        }
      }
    }
  }

  &[selection_allow-cell-selection] {
    smart-grid-row[focus] {
      smart-grid-cell[focus]:not([editor]):not([header]) {
        background: var(--smart-primary);
        color: var(--smart-primary-color);
        border-color: var(--smart-primary);
      }
    }
  }
}

@mixin grid-select-dot-smart-grid-allow-hover {
  &[appearance_allow-hover] {
    &:not([selection_allow-cell-selection]) {
      smart-grid-row {
        &:hover {
          smart-grid-cell {
            &:not(.smart-add-new-column) {
              background: var(--smart-ui-state-hover);
              color: var(--smart-ui-state-color-hover);
              cursor: default;
            }
          }
        }
      }
    }
  }
}

@mixin grid-select-dot-smart-grid-row-header-select-icon {
  &[appearance_show-row-header-select-icon][selection_enabled][selection_allow-row-header-selection] {
    smart-grid-row:hover smart-grid-cell[header]:not([group]) {

      &:not([detail]),
      &:not([detail])[selected] {
        >.smart-label {
          height: 100%;
          font-family: var(--smart-font-family-icon);
          font-style: normal;
          font-weight: normal;
          color: inherit;
          font-size: 14px;
          text-decoration: inherit;
          font-variant: normal;
          text-transform: none;
          flex-wrap: wrap;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          width: 100%;
          position: absolute;
          left: 0;
          top: 0;
          min-width: 0px;

          &:before {
            content: var(--smart-icon-check-empty);
            background: var(--smart-surface);
            color: var(--smart-surface-color);
            position: absolute;
            left: 0px;
            width: 100%;
          }
        }

        &:last-child {
          >.smart-label {
            height: 100%;
            font-family: var(--smart-font-family-icon);
            font-style: normal;
            font-weight: normal;
            color: inherit;
            font-size: 14px;
            text-decoration: inherit;
            font-variant: normal;
            text-transform: none;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            width: 100%;
            position: absolute;
            left: 0;
            top: 0;
            min-width: 0px;
          }
        }

        &[selected] {
          >.smart-label:before {
            content: var(--smart-icon-check-squared);
            transform: rotate(0deg);
          }
        }
      }

      &:not([detail])[selected] {
        >.smart-label:before {
          font-family: var(--smart-font-family-icon);
          font-style: normal;
          font-weight: normal;
          content: var(--smart-icon-check-squared);
          transform: rotate(0deg);
        }
      }
    }

    smart-grid-row smart-grid-cell[header]:not([group]) {

      &:not([detail]):hover,
      &:not([detail])[selected] {
        >.smart-label {
          height: 100%;
          font-family: var(--smart-font-family-icon);
          font-style: normal;
          font-weight: normal;
          color: inherit;
          font-size: 14px;
          text-decoration: inherit;
          font-variant: normal;
          text-transform: none;
          flex-wrap: wrap;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          width: 100%;
          position: absolute;
          left: 0;
          top: 0;
          min-width: 0px;

          &:before {
            content: var(--smart-icon-check-empty);
            background: var(--smart-ui-state-hover);
            color: var(--smart-ui-state-color-hover);
            position: absolute;
            left: 0px;
            width: 100%;
          }
        }

        &:last-child {
          >.smart-label {
            height: 100%;
            font-family: var(--smart-font-family-icon);
            font-style: normal;
            font-weight: normal;
            color: inherit;
            font-size: 14px;
            text-decoration: inherit;
            font-variant: normal;
            text-transform: none;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            width: 100%;
            position: absolute;
            left: 0;
            top: 0;
            min-width: 0px;
          }
        }

        &[selected] {
          >.smart-label:before {
            content: var(--smart-icon-check-squared);
            transform: rotate(0deg);
          }
        }
      }

      &:not([detail])[selected] {
        >.smart-label:before {
          font-family: var(--smart-font-family-icon);
          font-style: normal;
          font-weight: normal;
          content: var(--smart-icon-check-squared);
          transform: rotate(0deg);
        }
      }
    }
  }
}

@mixin grid-select-marching-ants {
  .marching-ants {}

  .marching-ants::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    pointer-events: none;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.0) 50%, rgba(255, 255, 255, 0.0) 50%), linear-gradient(175deg, rgba(255, 255, 255, 0.6) 50%, rgba(var(--smart-primary-rgb), 0.6) 50%), linear-gradient(175deg, rgba(255, 255, 255, 0.6) 50%, rgba(var(--smart-primary-rgb), 0.6) 50%), linear-gradient(90deg, rgba(255, 255, 255, 0.0) 50%, rgba(255, 255, 255, 0) 50%);
    background-position: top, left, right, bottom;
    background-repeat: repeat-x, repeat-y, repeat-y, repeat-x;
    background-size: 10px 2px, 2px 10px, 2px 10px, 10px 2px;
    animation: marqueeAnimate var(--duration, 12s) linear infinite;
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    box-sizing: border-box;
    border: 2px solid transparent;
  }

  .marching-ants::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    pointer-events: none;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.6) 50%, rgba(var(--smart-primary-rgb), 0.6) 50%), linear-gradient(175deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 50%), linear-gradient(175deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 50%), linear-gradient(90deg, rgba(255, 255, 255, 0.6) 50%, rgba(var(--smart-primary-rgb), 0.6) 50%);
    background-position: top, left, right, bottom;
    background-repeat: repeat-x, repeat-y, repeat-y, repeat-x;
    background-size: 10px 2px, 2px 10px, 2px 10px, 10px 2px;
    animation: marqueeAnimate var(--alt-duration, 12s) linear infinite;
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    box-sizing: border-box;
    border: 2px solid transparent;
  }

  @keyframes marqueeAnimate {
    0% {
      background-position: 0 0, 0 0, 100% 0, 0 100%;
    }

    100% {
      background-position: 100% 0, 0 -100%, 100% 100%, -100% 100%;
    }
  }
}