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

.settings-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;

  .settings-title {
    height: 40px;
    margin-left: 40px;
    display: flex;
    align-items: center;
    font-size: 13px;

    i {
      font-size: 26px;
      margin-top: 5px;
    }

    h1 {
      margin-top: 14px;
      margin-left: 6px;
      text-transform: uppercase;
    }

    .settings-title-active {
      cursor: pointer;
    }

    .settings-title-inactive {
      cursor: pointer;
    }
  }

  .settings-content {
    background-color: white;
    box-shadow: 0 2px 10px 0 rgba(0, 0, 1, 0.09);
    height: calc(100% - 105px);
    margin: 4px 20px 0;
    position: relative;
    width: calc(100% - 40px);

    .settings-content-items {
      border-bottom: 1px solid transparent;
      display: flex;
      height: 33px;
      list-style: none;
      margin: 0;
      padding: 0;

      .section-item {
        cursor: pointer;

        &.selected {
          color: #0091ff;

          span {
            border-bottom: 1px solid #0091ff;
            font-weight: 700;
          }
        }

        span {
          align-items: center;
          display: flex;
          font-size: 13px;
          font-weight: 400;
          height: calc(100% - 5px);
          margin: 5px 10px 0;
          padding: 0 15px;
          text-transform: capitalize;
        }
      }
    }

    .settings-content-scroll {
      height: calc(100% - 35px);
      overflow-y: auto;

      > div {
        padding-bottom: 50px;
      }

      .section-block {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        padding: 15px 20px;
        width: calc(100% - 40px);

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

        .section-block-title {
          align-items: flex-start;
          display: flex;
          width: 200px;
          min-width: 200px;
          user-select: none;

          h1 {
            font-weight: 700;
            text-transform: capitalize;
          }
        }

        .section-block-content {
          align-items: left;
          display: flex;
          flex-direction: column;
          flex-grow: 1;
        }

        .section-block-content-item {
          margin: auto 0px;
          display: flex;
          width: 100%;
          user-select: none;

          .cptx-section-item-title {
            font-size: 11px;
            font-weight: 600;
            margin-top: 22px;
            text-transform: uppercase;
            user-select: none;
          }
        }
      }
    }

    .settings-footer {
      align-items: center;
      bottom: 0;
      box-shadow: 0 -2px 0px rgba(216, 216, 216, 0.5);
      display: flex;
      height: 50px;
      justify-content: space-between;
      margin-right: 10px;
      position: absolute;
      width: calc(100% - 10px);
      z-index: 1;

      .settings-footer-version-info {
        display: flex;
        flex-direction: row;
        min-width: 347px;

        .settings-footer-version {
          align-items: center;
          display: flex;
          margin: 0 20px;

          span {
            font-size: 13px;
            font-weight: 600;
          }
        }

        .settings-footer-check-for-updates {
          align-items: center;
          background-color: #0091ff;
          border-radius: 13px;
          cursor: pointer;
          display: flex;
          height: 26px;
          padding: 0 15px;

          span {
            color: white;
            font-size: 13px;
            font-weight: 600;
            margin-left: 5px;
          }
        }
      }

      .settings-footer-logout {
        padding-right: 35px;
        line-height: 10px;
        display: flex;
        flex-direction: row;
        min-width: 140px;

        hr {
          border: 0px;
          border-left: 1px solid rgba(0, 0, 0, 0.1);
          margin: 0px 25px 0px 0px;
          height: 35px;
        }

        .logout-label {
          display: flex;
          cursor: pointer;
          position: relative;
          top: 10px;

          i {
            width: 14px;
            height: 12px;
          }
  
          span {
            font-weight: 600;
            position: relative;
            bottom: -3px;
            left: 6px;
          }
        }
      }
    }
  }
}

.cptx-section-block{
  display: flex;
  flex-direction: column;
  width: 100%;

  .cptx-section-block-title{
    align-items: center;
    display: flex;
    height: 41px;

    h1{
      color: #6a707e;
      font-weight: 700;
      margin-left: 28px;
      text-transform: uppercase;
    }
  }

  .cptx-section-block-content{
    display: flex;
    flex-direction: column;

    .cptx-section-item{
      border-bottom: 1px solid rgba(0,0,0,0.5);
      display: flex;
      flex-direction: column;
      margin: 0 auto;
      padding: 17px 28px;
      position: relative;
      width: 518px;

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

      .cptx-section-item-title{
        font-size: 12px;
        font-weight: 600;
      }

      .cptx-section-item-description{
        font-size: 12px;
        font-weight: 300;
        width: calc(100% - 38px);
      }

      .cptx-section-item-control{
        display: flex;
        flex-direction: column;
        position: absolute;
        right: 20px;
        top: 30px;

        button{
          align-self: flex-end;
          display: inherit;
          width: fit-content;
        }
      }
    }
  }
}

/* THEME
   ----------------------------- */
@mixin themable(
  $_THEME,
  $_BACKGROUND_COLOR_MAIN,
  $_BACKGROUND_COLOR_SETTINGS_TITLE,
  $_COLOR_TEXT_MAIN_TITLE,
  $_BACKGROUND_COLOR_SETTINGS,
  $_COLOR_TEXT_SETTINGS_TITLE,
  $_BORDER_COLOR_SETTINGS_HEADER,
  $_COLOR_TEXT_SETTINGS_BREADCRUMBS_TITLE
) {
  [data-theme^="#{$_THEME}"],
  [data-theme] [data-theme^="#{$_THEME}"] {
    .settings-container {
      background-color: $_BACKGROUND_COLOR_MAIN;

      .settings-title {
        h1 {
          color: $_COLOR_TEXT_MAIN_TITLE;
        }

        i {
          color: $_COLOR_TEXT_MAIN_TITLE;
        }

        .settings-title-active {
          color: $_COLOR_TEXT_SETTINGS_TITLE;
        }

        .settings-title-inactive {
          color: $_COLOR_TEXT_SETTINGS_BREADCRUMBS_TITLE;
        }

        .icon-arrow-right {
          color: $_COLOR_TEXT_SETTINGS_BREADCRUMBS_TITLE;
        }
      }

      .settings-content {
        background-color: $_BACKGROUND_COLOR_SETTINGS;

        .settings-content-items {
          border-bottom-color: $_BORDER_COLOR_SETTINGS_HEADER;

          .section-item {
            span {
              color: $_COLOR_TEXT_SETTINGS_TITLE;
            }
            &.selected {
              span {
                color: #0091ff;
              }
            }
          }
        }

        .settings-content-scroll {
          .cptx-section-block{
            .cptx-section-block-title {
              background-color: $_BACKGROUND_COLOR_SETTINGS_TITLE;
            }
          }

          .cptx-section-item {
            border-color: $_BORDER_COLOR_SETTINGS_HEADER;
            
            .cptx-section-item-title {
              color: $_COLOR_TEXT_MAIN_TITLE;
            }

            .cptx-section-item-description{
              color: $_COLOR_TEXT_MAIN_TITLE;
            }
          }
        }

        .settings-footer {
          background-color: $_BACKGROUND_COLOR_SETTINGS;

          .settings-footer-version-info {
            .settings-footer-version {
              color: $_COLOR_TEXT_MAIN_TITLE;
            }
          }

          .settings-footer-logout {
            color: $_COLOR_TEXT_MAIN_TITLE;
          }
        }
      }
    }
  }
}

@include themable(
  $_THEME_LIGHT,
  $_BACKGROUND_COLOR_MAIN_LIGHT,
  $_BACKGROUND_COLOR_SETTINGS_TITLE_LIGHT,
  $_COLOR_TEXT_MAIN_TITLE_LIGHT,
  $_BACKGROUND_COLOR_SETTINGS_LIGHT,
  $_COLOR_TEXT_SETTINGS_TITLE_LIGHT,
  $_BORDER_COLOR_SETTINGS_HEADER_LIGHT,
  $_COLOR_TEXT_SETTINGS_BREADCRUMBS_TITLE_LIGHT
);
@include themable(
  $_THEME_DARK,
  $_BACKGROUND_COLOR_MAIN_DARK,
  $_BACKGROUND_COLOR_SETTINGS_TITLE_DARK,
  $_COLOR_TEXT_MAIN_TITLE_DARK,
  $_BACKGROUND_COLOR_SETTINGS_DARK,
  $_COLOR_TEXT_SETTINGS_TITLE_DARK,
  $_BORDER_COLOR_SETTINGS_HEADER_DARK,
  $_COLOR_TEXT_SETTINGS_BREADCRUMBS_TITLE_DARK
);
