@import '@/styles/mixins.less';
@import '@/styles/variables.less';

:global(.ant-form-item-has-error) {
  .universalEditor {
    &.formStatus {
      border-color: @color-error;
    }
  }
}

@toolbar-height: 3rem;
@states-height: 2em;

.universalEditor {
  width: 100%;
  border: 1px solid @color-border;
  border-radius: @border-radius;
  overflow: hidden;
  &.fullScreen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border: none;
    border-radius: 0;
    z-index: 1000;
    .editorWrapper {
      height: calc(100vh - @toolbar-height - @states-height);
    }
  }

  .editorWrapper {
    width: 100%;
    display: flex;
    position: relative;
    overflow: hidden;

    .editorPreview {
      position: absolute;
      left: 50%;
      top: 0;
      width: 50%;
      height: 100%;
      padding: @gap-lg;
      background-color: @module-background;
      border-left: 1px solid @color-border;
      overflow-y: scroll;
    }
  }
}

.editorToolbar {
  height: @toolbar-height;
  padding-inline: @gap-md;
  border-bottom: 1px solid @color-border;
  background-color: @module-background;

  .logo {
    user-select: none;
  }

  .language {
    min-width: 106px;
  }
}

.editorStatesBar {
  height: @states-height;
  padding-inline: @gap-sm;
  border-top: 1px solid @color-border;
  background-color: @module-background;
  user-select: none;

  .icon {
    font-size: @font-size-sm;
    color: @color-text-quaternary;
  }

  .text {
    font-size: @font-size-sm;
  }
}
