/**
 * Preview Mode Group Styles - Desktop/Mobile toggle buttons
 */

@import '~@capillarytech/cap-ui-library/styles/_variables.scss';

.preview-mode-group {
  display: flex;
  gap: 0.25rem; // 4px = 0.25rem
  align-items: center;

  &__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 0.0625rem solid $CAP_G07;
    border-radius: 0.25rem;
    background-color: $CAP_WHITE;
    color: $CAP_G04;
    transition: all 0.2s ease-in-out;
    cursor: pointer;

    &:hover {
      background-color: $CAP_G09;
      color: $CAP_G03;
      border-color: $CAP_G06;
    }

    &:focus {
      outline: none;
      box-shadow: 0 0 0 0.125rem rgba(map-get($CAP_PRIMARY, base), 0.2);
      border-color: map-get($CAP_PRIMARY, base);
    }

    &--active {
      background-color: map-get($CAP_PRIMARY, base);
      color: $CAP_WHITE;
      border-color: map-get($CAP_PRIMARY, base);

      &:hover {
        background-color: map-get($CAP_PRIMARY, hover);
        border-color: map-get($CAP_PRIMARY, hover);
        color: $CAP_WHITE;
      }

      &:focus {
        box-shadow: 0 0 0 0.125rem rgba(map-get($CAP_PRIMARY, base), 0.3);
      }
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;

      &:hover {
        background-color: $CAP_WHITE;
        color: $CAP_G04;
        border-color: $CAP_G07;
      }

      &.preview-mode-group__btn--active {
        background-color: map-get($CAP_PRIMARY, base);
        color: $CAP_WHITE;
        border-color: map-get($CAP_PRIMARY, base);
      }
    }

    // Icon styling
    .cap-icon {
      font-size: 1rem;
      color: inherit;
    }
  }
}

// Integration with editor toolbar
.editor-toolbar {
  .preview-mode-group {
    margin-left: auto; // Push to the right side of the toolbar
  }
}