/**
 * Card Component Style for uxcore
 * @author eternalsky
 *
 * Copyright 2017-2018, Uxcore Team, Alinw.
 * All rights reserved.
 */

@__card-prefix-cls: uxcore-card;
.@{__card-prefix-cls} {
  * {
    box-sizing: border-box;
  }
  background: white;
  overflow: hidden;
  border-radius: @global-border-radius;
  &-header {
    height: 41px;
    line-height: 40px;
    width: 100%;
    display: flex;
    white-space: nowrap;
    border-bottom: 1px solid @split-line-color;
    padding: 0px 24px;
    border-top-left-radius: @global-border-radius;
    border-top-right-radius: @global-border-radius;
  }
  &-title {
    height: 100%;
    flex: 1;
    overflow: hidden;
    +.@{__card-prefix-cls}-extra {
      padding-left: 24px;
    }
    &-icon,
    &-text,
    &-tip {
      height: 100%;
      display: inline-block;
      vertical-align: middle;
      margin-right: 8px;
      &:last-child {
        margin-right: 0;
      }
    }
    &-icon {
      i,
      icon {
        font-size: 20px;
        color: @normal-alpha-4;
      }
      svg {
        fill: @normal-alpha-4;
        width: 18px;
        height: 18px;
      }
    }
    &-text {
      color: @dark-alpha-2;
      font-size: 14px;
      font-weight: bold;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      &__has-icon {
        max-width: calc(~"100% - 28px");
      }
      &__has-tip {
        max-width: calc(~"100% - 22px");
        &.@{__card-prefix-cls}-title-text__has-icon {
          max-width: calc(~"100% - 50px");
        }
      }
    }
    &-tip-icon {
      color: @gray-light;
      font-size: 14px;
    }
  }
  &-collapse-icon {
    font-size: 16px;
    color: @normal-alpha-4;
    display: inline-block;
    vertical-align: -1px;
    padding: 0px 4px;
    transition: transform 0.3s ease;
    cursor: pointer;
    line-height: 1;
    &__collapsed {
      transform: rotate(180deg);
      transform-origin: center center;
    }
  }
  &-extra {
    text-align: right;
    overflow: hidden;
    height: 40px;

    > a {
      cursor: pointer;
    }
  }
  &-content {
    padding: 24px;
    overflow: hidden;
    overflow-y: auto;
    transition: all .3s ease-out;
    &-none-padding {
      padding: 0;
    }
  }
}
