@import "./../styles/index.scss";

#cptx-settings-profile{
  .cptx-section-item{
    border-bottom: none;

    &:nth-child(1){
      align-items: center;
      flex-direction: row;

      .cptx-profile-avatar{
        align-items: center;
        border: 2px dashed #0091ff;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        margin-right: 15px;
        overflow: hidden;
        position: relative;
        height: 56px;
        width: 56px;

        img {
          object-fit: cover;
          width: 100%;
          height: 100%;
        }

        .avatar-letters{
          background-color: rgba(141, 166, 210, 0.8);
          span{
            color: white;
            margin: 0 auto;
          }
        }

        .cptx-profile-avatar-loading-overlay {
          position: absolute;
          display: flex;
          justify-content: center;
          align-items: center;
          width: 100%;
          height: 100%;
          background-color: rgba(0, 0, 0, 0.60);

          .loading-ring {
            top: -3px;
            left: -31px;

            div{
              align-items: center;
              background-color: rgba(141, 166, 210, 0.8);
              display: flex;
              height: 56px;
              width: 56px;
            }
          }
        }
      }

      .button-b{
        border-right: 1px solid #e1e1e1;
        padding: 0 10px;

        &:last-child{
          border-right: none;
        }

        span, label{
          font-weight: 600;
        }
      }

      #cptx-button-edit-avatar{
        input{
          display: none;
        }

        label{
          cursor: pointer;
        }
      }
    }

    &:nth-child(2), &:nth-child(3){
      padding-bottom: 8px;
      padding-top: 8px;

      > div{

        &.profile-name {
          font-size: 12px;
          font-weight: 300;

          &:hover > i {
            cursor: pointer;
            display: inline;
          }

          span{
            line-height: 21px;
          }

          i {
            color: rgb(179, 179, 179);
            margin-left: 15px;
            font-size: 14px;
            line-height: 13px;
            position: relative;
            top: 2px;
            display: none;
          }
        }

        input {
          font-size: 12px;
          padding-left: 3px;
          margin-bottom: 2px;
          position: relative;
          width: 200px;
        }
      }
    }

    &:nth-child(4){
      flex-direction: column;
      padding-bottom: 3px;

      .signature-switch {
        display: flex;
        margin: 10px 0px 7px 0px;

        .settings-switch-label {
          font-size: 12px;
        }
      }

      .cptx-signature-editor {
        font-family: initial !important;
        width: 75%;
        height: 220px;
        margin-bottom: 4px;
        border-radius: 4px;
        border: solid 1px transparent;
        overflow: auto;
        cursor: text;

        * {
          font-family: inherit;
        }

        &.cptx-signature-editor-disabled {
          cursor: not-allowed;
          background-color: rgba($color: #d3d3d3, $alpha: 0.4);

          .rdw-option-wrapper,
          .rdw-dropdown-wrapper {
            background-color: inherit;
          }

          .rdw-editor-wrapper {
            pointer-events: none;
          }
        }

        &:focus{
          outline: none;
        }
      }
    }

    &:nth-child(5){
      padding-top: 3px;

      .cptx-section-item-control{
        left: 200px;
        top: 3px;
      }
    }

    &:last-child{
      padding-bottom: 17px;
    }
  }
}

/* THEME
   ----------------------------- */
@mixin themable($_THEME, $_COLOR_TEXT_SETTINGS_CONTENT, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE, $_BORDER_COLOR_SETTINGS_SIGNATURE, $_COLOR_TEXT_SETTINGS_SIGNATURE){
  [data-theme^=#{$_THEME}],
  [data-theme] [data-theme^=#{$_THEME}] {
    #cptx-settings-profile{
      .cptx-section-item{
        &:nth-child(1){
          label{
            color: $_COLOR_TEXT_SETTINGS_CONTENT;
          }
        }

        &:nth-child(2){
          > div{
            &.profile-name {
              color: $_COLOR_TEXT_SETTINGS_CONTENT;
            }
          }
        }

        &:nth-child(4){
          .cptx-signature-editor {
            background-color: $_BACKGROUND_COLOR_SETTINGS_SIGNATURE;
            border-color: $_BORDER_COLOR_SETTINGS_SIGNATURE;

            .rdw-editor-main{
              color: $_COLOR_TEXT_SETTINGS_SIGNATURE;
            }
          }
        }
      }
    }
  }
}

@include themable($_THEME_LIGHT, $_COLOR_TEXT_SETTINGS_CONTENT_LIGHT, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_LIGHT, $_BORDER_COLOR_SETTINGS_SIGNATURE_LIGHT, $_COLOR_TEXT_SETTINGS_SIGNATURE_LIGHT);
@include themable($_THEME_DARK, $_COLOR_TEXT_SETTINGS_CONTENT_DARK, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_DARK, $_BORDER_COLOR_SETTINGS_SIGNATURE_DARK, $_COLOR_TEXT_SETTINGS_SIGNATURE_DARK);