@import '../../style/mixins';
@import '../../style/themes/default';

@noticebarPrefixCls: fm-noticebar;

.@{noticebarPrefixCls} {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: @v-spacing-sm @h-spacing-lg;
  color: @notice-bar-color;
  font-size: 0;
  background: @notice-bar-fill;

  &--btn-close {
    left: @h-spacing-lg;
    width: @notice-bar-btn-close-size;
    height: @notice-bar-btn-close-size;
    line-height: @notice-bar-btn-close-size;
    font-size: @notice-bar-font-size;

    + .@{noticebarPrefixCls}--content {
      margin-left: @h-spacing-md;
    }
  }

  &--content {
    display: flex;
    flex: 1;
    flex-direction: row;
    overflow: hidden;
    line-height: @notice-bar-height;
    word-break: break-all;
    word-wrap: break-word;

    &-icon {
      display: inline-block;
      margin-right: 12px;
      vertical-align: top;
      font-size: @notice-bar-font-size;
    }

    &-text {
      display: inline;
      overflow: hidden;
      font-size: @notice-bar-font-size;
    }

    &-inner {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  &--more {
    color: @color-text-caption;
    font-size: 0;

    &-text {
      font-size: @notice-bar-font-size;
      line-height: @line-height-paragraph;
      vertical-align: middle;
    }
  }

  &-marquee {
    .@{noticebarPrefixCls}--content {
      display: flex;
      flex-direction: row;
      justify-content: center;
      overflow: hidden;

      &-text {
        flex: 1;
        overflow: hidden;
      }

      &-inner {
        display: inline-block;
        vertical-align: top;
        white-space: nowrap;
        padding-left: 100%;
        animation: marquee 0s linear infinite both;
        transform: translateZ(0);
      }
    }
  }
}

@keyframes marquee {
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

@import './rtl.less';
